gitnexus 1.6.5-rc.8 → 1.6.5
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/dist/_shared/scope-resolution/finalize-algorithm.js +10 -2
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +26 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/method-dispatch-index.js +22 -3
- package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.js +18 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +2 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +1 -0
- package/dist/cli/ai-context.js +70 -16
- package/dist/cli/analyze.d.ts +30 -2
- package/dist/cli/analyze.js +45 -5
- package/dist/cli/index.js +8 -1
- package/dist/cli/setup.js +18 -0
- package/dist/cli/wiki.d.ts +2 -0
- package/dist/cli/wiki.js +11 -0
- package/dist/core/augmentation/engine.js +24 -4
- package/dist/core/embeddings/http-client.js +22 -6
- package/dist/core/incremental/shadow-candidates.d.ts +44 -0
- package/dist/core/incremental/shadow-candidates.js +74 -0
- package/dist/core/incremental/subgraph-extract.d.ts +64 -0
- package/dist/core/incremental/subgraph-extract.js +111 -0
- package/dist/core/ingestion/call-processor.d.ts +12 -1
- package/dist/core/ingestion/call-processor.js +183 -47
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +38 -0
- package/dist/core/ingestion/class-extractors/generic.js +8 -0
- package/dist/core/ingestion/class-types.d.ts +15 -0
- package/dist/core/ingestion/community-processor.js +18 -0
- package/dist/core/ingestion/import-resolvers/standard.d.ts +5 -0
- package/dist/core/ingestion/import-resolvers/standard.js +31 -1
- package/dist/core/ingestion/import-resolvers/utils.js +4 -0
- package/dist/core/ingestion/languages/c-cpp.js +20 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +141 -0
- package/dist/core/ingestion/languages/cpp/adl.js +478 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +170 -0
- package/dist/core/ingestion/languages/cpp/arity.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/arity.js +31 -0
- package/dist/core/ingestion/languages/cpp/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/cpp/captures.js +1131 -0
- package/dist/core/ingestion/languages/cpp/conversion-rank.d.ts +31 -0
- package/dist/core/ingestion/languages/cpp/conversion-rank.js +47 -0
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +118 -0
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +266 -0
- package/dist/core/ingestion/languages/cpp/header-scan.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/header-scan.js +50 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +19 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +111 -0
- package/dist/core/ingestion/languages/cpp/import-target.d.ts +10 -0
- package/dist/core/ingestion/languages/cpp/import-target.js +13 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +11 -0
- package/dist/core/ingestion/languages/cpp/index.js +11 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +67 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +176 -0
- package/dist/core/ingestion/languages/cpp/interpret.d.ts +35 -0
- package/dist/core/ingestion/languages/cpp/interpret.js +113 -0
- package/dist/core/ingestion/languages/cpp/merge-bindings.d.ts +13 -0
- package/dist/core/ingestion/languages/cpp/merge-bindings.js +29 -0
- package/dist/core/ingestion/languages/cpp/query.d.ts +3 -0
- package/dist/core/ingestion/languages/cpp/query.js +508 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +212 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +246 -0
- package/dist/core/ingestion/languages/cpp/simple-hooks.d.ts +24 -0
- package/dist/core/ingestion/languages/cpp/simple-hooks.js +62 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +76 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +195 -0
- package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
- package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
- package/dist/core/ingestion/languages/java/arity.js +24 -0
- package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
- package/dist/core/ingestion/languages/java/captures.js +187 -0
- package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
- package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
- package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
- package/dist/core/ingestion/languages/java/import-target.js +100 -0
- package/dist/core/ingestion/languages/java/index.d.ts +29 -0
- package/dist/core/ingestion/languages/java/index.js +29 -0
- package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
- package/dist/core/ingestion/languages/java/interpret.js +131 -0
- package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
- package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
- package/dist/core/ingestion/languages/java/query.d.ts +30 -0
- package/dist/core/ingestion/languages/java/query.js +192 -0
- package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
- package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
- package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
- package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
- package/dist/core/ingestion/languages/java.js +11 -0
- package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
- package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
- package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
- package/dist/core/ingestion/languages/php/arity.js +40 -0
- package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
- package/dist/core/ingestion/languages/php/captures.js +739 -0
- package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
- package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
- package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
- package/dist/core/ingestion/languages/php/import-target.js +100 -0
- package/dist/core/ingestion/languages/php/index.d.ts +68 -0
- package/dist/core/ingestion/languages/php/index.js +72 -0
- package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/php/interpret.js +241 -0
- package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
- package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
- package/dist/core/ingestion/languages/php/query.d.ts +32 -0
- package/dist/core/ingestion/languages/php/query.js +326 -0
- package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
- package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
- package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
- package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
- package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
- package/dist/core/ingestion/languages/php.d.ts +0 -7
- package/dist/core/ingestion/languages/php.js +15 -0
- package/dist/core/ingestion/markdown-processor.js +6 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -0
- package/dist/core/ingestion/model/symbol-table.js +3 -0
- package/dist/core/ingestion/parsing-processor.d.ts +22 -2
- package/dist/core/ingestion/parsing-processor.js +123 -50
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +54 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +5 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +119 -11
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +14 -0
- package/dist/core/ingestion/pipeline.d.ts +13 -0
- package/dist/core/ingestion/registry-primary-flag.js +2 -0
- package/dist/core/ingestion/scope-extractor.js +4 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +167 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +3 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +1 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +12 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +12 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +16 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +204 -13
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +1 -1
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +55 -4
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +186 -5
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +10 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +207 -9
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +13 -1
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +6 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +86 -8
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +30 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +90 -8
- package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
- package/dist/core/ingestion/tree-sitter-queries.js +23 -0
- package/dist/core/ingestion/utils/ast-helpers.js +6 -1
- package/dist/core/ingestion/utils/template-arguments.d.ts +11 -0
- package/dist/core/ingestion/utils/template-arguments.js +65 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +3 -0
- package/dist/core/ingestion/workers/parse-worker.js +42 -1
- package/dist/core/lbug/lbug-adapter.d.ts +39 -0
- package/dist/core/lbug/lbug-adapter.js +348 -48
- package/dist/core/run-analyze.d.ts +2 -0
- package/dist/core/run-analyze.js +323 -29
- package/dist/core/search/hybrid-search.d.ts +3 -0
- package/dist/core/search/hybrid-search.js +23 -6
- package/dist/core/wiki/generator.js +4 -3
- package/dist/core/wiki/html-viewer.js +2 -1
- package/dist/core/wiki/llm-client.d.ts +4 -0
- package/dist/core/wiki/llm-client.js +3 -3
- package/dist/core/wiki/mermaid-sanitizer.d.ts +2 -0
- package/dist/core/wiki/mermaid-sanitizer.js +100 -0
- package/dist/mcp/local/local-backend.js +20 -7
- package/dist/storage/file-hash.d.ts +47 -0
- package/dist/storage/file-hash.js +86 -0
- package/dist/storage/parse-cache.d.ts +73 -0
- package/dist/storage/parse-cache.js +253 -0
- package/dist/storage/repo-manager.d.ts +41 -1
- package/dist/storage/repo-manager.js +61 -6
- package/hooks/claude/gitnexus-hook.cjs +42 -4
- package/hooks/claude/hook-db-lock-probe.cjs +238 -0
- package/hooks/claude/hook-lock.cjs +119 -0
- package/hooks/claude/win-rm-list-json.ps1 +76 -0
- package/package.json +1 -1
- package/scripts/build.js +6 -2
- package/vendor/node_modules/node-addon-api/node_addon_api.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_except.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_except_all.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_maybe.target.mk +16 -16
- package/web/assets/{agent-BpHQleHE.js → agent-D2kLt6Dl.js} +91 -91
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-BETj2x4g.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-DvIkEGkp.js +36 -0
- package/web/assets/blockDiagram-7IZFK4PR-B4niSLvR.js +132 -0
- package/web/assets/{c4Diagram-DFAF54RM-DeJV1rCn.js → c4Diagram-Y2BXMSZH-DIzEXalR.js} +6 -6
- package/web/assets/chunk-2T2R6R2M-n6s9JZqv.js +4 -0
- package/web/assets/chunk-2UTLFMKG-CMBB1TMN.js +1 -0
- package/web/assets/{chunk-7RZVMHOQ-BdIU-RGO.js → chunk-3SSMPTDK-BzGeeheI.js} +1 -1
- package/web/assets/chunk-4R4BOZG6-mKhL59ul.js +159 -0
- package/web/assets/chunk-5IMINLNL-CnTLsXIV.js +1 -0
- package/web/assets/chunk-5VCL7Z4A-w1BCx98Z.js +1 -0
- package/web/assets/chunk-6764PJDD-ChwMM2z4.js +1 -0
- package/web/assets/chunk-67TQ5CYL-CChC2cAv.js +124 -0
- package/web/assets/chunk-7J6CGLKN-DT-b53FT.js +10 -0
- package/web/assets/chunk-7W6UQGC5-CgFyfZ6k.js +1 -0
- package/web/assets/chunk-AQ6EADP3-CCFje6lL.js +1 -0
- package/web/assets/{chunk-KSICW3F5-C2tZmXwv.js → chunk-AZZRMDJM-5E9ARdDQ.js} +1 -1
- package/web/assets/chunk-C62D2QBJ-CDAWj26E.js +1 -0
- package/web/assets/chunk-CEXFNPSA-D68Tk6ls.js +1 -0
- package/web/assets/chunk-INKRHTLW-ELpfuk9h.js +70 -0
- package/web/assets/chunk-J5EP6P6S-DxWW0yvu.js +1 -0
- package/web/assets/{chunk-AEOMTBSW-D7qjBMHW.js → chunk-JQRUD6KW-Dcq_Qnyy.js} +1 -1
- package/web/assets/chunk-KGFNY3KK-W-VR57xb.js +62 -0
- package/web/assets/chunk-KGYTTC2M-C6PHeuay.js +1 -0
- package/web/assets/chunk-KNLZD3CH-BuZBOcso.js +1 -0
- package/web/assets/chunk-KRXBNO2N-DH2NPM7I.js +1 -0
- package/web/assets/chunk-LCXTWHL2-CqJ0oo1x.js +231 -0
- package/web/assets/chunk-LII3EMHJ-3X33tCpU.js +1 -0
- package/web/assets/chunk-QA3QBVWF-D5Ha3GgB.js +2 -0
- package/web/assets/chunk-RERM46MO-DQNbXtfw.js +1 -0
- package/web/assets/chunk-RG4AUYOV-D0M6vdq9.js +206 -0
- package/web/assets/chunk-RKZBBQEN-BmTPLSyv.js +1 -0
- package/web/assets/chunk-RLI5ZMPA-DExu2DOK.js +1 -0
- package/web/assets/chunk-T2UQINTJ-kGYG7ppP.js +1 -0
- package/web/assets/chunk-T5OCTHI4--9wWpVws.js +1 -0
- package/web/assets/chunk-UP6H54XL-DsKdC6jC.js +1 -0
- package/web/assets/chunk-UXSXWOXI-DR81EqLr.js +1 -0
- package/web/assets/chunk-UY5QBCOK-Du-c56gs.js +1 -0
- package/web/assets/chunk-W44A43WB-lrCpuupA.js +1 -0
- package/web/assets/chunk-ZXARS5L4-CSZRiyOf.js +1 -0
- package/web/assets/classDiagram-KGZ6W3CR-BB-saqC1.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-Bp2bAlS5.js +1 -0
- package/web/assets/cose-bilkent-UX7MHV2Q-BHv2bbtl.js +1 -0
- package/web/assets/dagre-ND4H6XIP-DsIr9MOv.js +4 -0
- package/web/assets/diagram-3NCE3AQN-BUxnDPOY.js +43 -0
- package/web/assets/diagram-GF46GFSD-BJTyqqvI.js +24 -0
- package/web/assets/diagram-HNR7UZ2L-fUWreZzx.js +3 -0
- package/web/assets/diagram-QXG6HAR7-DilMHamP.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-8KUrarg1.js +10 -0
- package/web/assets/erDiagram-L5TCEMPS-Doj9mSiW.js +85 -0
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-B3myHUst.js +1 -0
- package/web/assets/{flowDiagram-OTCZ4VVT-aAZw4c_M.js → flowDiagram-H6V6AXG4-BOSR-i3p.js} +12 -12
- package/web/assets/ganttDiagram-JCBTUEKG-BHQssTz6.js +292 -0
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-DF3rtf4A.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CCwVLT__.js +106 -0
- package/web/assets/index-j4-NuleT.js +623 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-R4XV_akJ.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-Ce_TvtaV.js +2 -0
- package/web/assets/{ishikawaDiagram-YMYX4NHK-BF8AtDaj.js → ishikawaDiagram-BNXS4ZKH-4MXIDCSF.js} +6 -6
- package/web/assets/journeyDiagram-M6C3CM3L-DNPYCpvq.js +139 -0
- package/web/assets/kanban-definition-75IXJCU3-yYdfm8Kk.js +89 -0
- package/web/assets/{katex-GD7MH7QM-CJiOjBBJ.js → katex-K3KEBU37-CrVLz8l7.js} +1 -1
- package/web/assets/mindmap-definition-2TDM6QVE-DFNEKM77.js +96 -0
- package/web/assets/packet-YPE3B663-LP52Z2RK-CgQPdNZa.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-BzWOwc_c.js +1 -0
- package/web/assets/pieDiagram-CU6KROY3-iZAqpvhd.js +30 -0
- package/web/assets/quadrantDiagram-VICAPDV7-bAm6Hi_5.js +7 -0
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-B7KG0FN7.js +1 -0
- package/web/assets/requirementDiagram-JXO7QTGE-CtDijhnf.js +84 -0
- package/web/assets/sankeyDiagram-URQDO5SZ-LFJz53u5.js +40 -0
- package/web/assets/sequenceDiagram-VS2MUI6T-BdjvyCHM.js +162 -0
- package/web/assets/stateDiagram-7D4R322I-e5odN9fG.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-vPsvjR2D.js +1 -0
- package/web/assets/timeline-definition-O6YCAMPW-DPAksNQp.js +120 -0
- package/web/assets/treeView-BLDUP644-QA4HXRO3-CRSxEwLO.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-a0PfKoVn.js +1 -0
- package/web/assets/vennDiagram-MWXL3ELB-Dtlfdt7J.js +34 -0
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-BKQ6e5mC.js +1 -0
- package/web/assets/wardleyDiagram-CUQ6CDDI-B23uRMUC.js +78 -0
- package/web/assets/{xychartDiagram-ZHJ5623Y-DZ7fP1_3.js → xychartDiagram-N2JHSOCM-DxwHeksW.js} +6 -6
- package/web/index.html +13 -2
- package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BUzkWgDl.js +0 -1
- package/web/assets/architectureDiagram-EMZXCZ2Q-CXbzok1G.js +0 -36
- package/web/assets/blockDiagram-IGV67L2C-DA1QJ4ZB.js +0 -132
- package/web/assets/chunk-3GS5O3IE-B8hpnia8.js +0 -231
- package/web/assets/chunk-3YCYZ6SJ-B-BVu21C.js +0 -1
- package/web/assets/chunk-6NTNNK5N-DW-jYSDr.js +0 -1
- package/web/assets/chunk-A34GCYZU-BbZl-IKy.js +0 -1
- package/web/assets/chunk-DJ7UZH7F-B5tMfF87.js +0 -1
- package/web/assets/chunk-DKKBVRCY-Djm-6K_e.js +0 -4
- package/web/assets/chunk-DU5LTGQ6-QPoynYcp.js +0 -1
- package/web/assets/chunk-FXACKDTF-jieSmbe2.js +0 -159
- package/web/assets/chunk-H3VCZNTA-8EMHZ3SV.js +0 -1
- package/web/assets/chunk-HN6EAY2L-CgE_agsD.js +0 -1
- package/web/assets/chunk-O5ABG6QK-DEZV1O19.js +0 -1
- package/web/assets/chunk-PK6DOVAG-BXv0JnsJ.js +0 -206
- package/web/assets/chunk-RNJOYNJ4-BiBkF9dN.js +0 -1
- package/web/assets/chunk-RWUO3TPN-DTWzAhQ1.js +0 -1
- package/web/assets/chunk-TBF5ZNIQ-BSl6s9lT.js +0 -1
- package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +0 -1
- package/web/assets/chunk-TYMNRAUI-D1NDLIMG.js +0 -1
- package/web/assets/chunk-VELTKBKT-C9dVN39o.js +0 -1
- package/web/assets/chunk-W7ZLLLMY-Bu-cdLzs.js +0 -1
- package/web/assets/chunk-WSB5WSVC-Dor71SOz.js +0 -1
- package/web/assets/chunk-XGPFEOL4-CUonLRle.js +0 -1
- package/web/assets/classDiagram-PPOCWD7C-Cdd6UdVv.js +0 -1
- package/web/assets/classDiagram-v2-23LJLIIU-DNhxY2Ib.js +0 -1
- package/web/assets/cose-bilkent-PNC4W37J-DdZq7Qz_.js +0 -1
- package/web/assets/dagre-E77IOHMT-Cfj_6e17.js +0 -4
- package/web/assets/diagram-H7BISOXX-BNvpsrBv.js +0 -43
- package/web/assets/diagram-JC5VWROH-Cn0rtDbJ.js +0 -24
- package/web/assets/diagram-LXUTUG65-CHfoVKNm.js +0 -10
- package/web/assets/diagram-WEHSV5V5-BLxHksnu.js +0 -24
- package/web/assets/erDiagram-GCSMX5X6-DfdN6iqF.js +0 -85
- package/web/assets/ganttDiagram-MUNLMDZQ-BEfC_7Or.js +0 -292
- package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-B6ZeRLP0.js +0 -1
- package/web/assets/gitGraphDiagram-3HKGZ4G3-CG0kC8Q5.js +0 -106
- package/web/assets/index-3NUCUW2s.js +0 -886
- package/web/assets/info-OMHHGYJF-BF2H5H6G-BIOsZy0W.js +0 -1
- package/web/assets/infoDiagram-MN7RKWGX-DUoMH-pq.js +0 -2
- package/web/assets/journeyDiagram-SO5T7YLQ-BW8oKa3N.js +0 -139
- package/web/assets/kanban-definition-LJHFXRCJ-DzbOsR-2.js +0 -89
- package/web/assets/mindmap-definition-2EUWGEK5-BIXGQALq.js +0 -96
- package/web/assets/packet-4T2RLAQJ-EV4IVRXR-Bs7ysNMU.js +0 -1
- package/web/assets/pie-ZZUOXDRM-N23DN5KN-Csi8nnbH.js +0 -1
- package/web/assets/pieDiagram-3IATQBI2-QY-u7P6a.js +0 -30
- package/web/assets/quadrantDiagram-E256RVCF-Di4aNiU8.js +0 -7
- package/web/assets/radar-PYXPWWZC-P6TP7ZYP-DJlyXh2-.js +0 -1
- package/web/assets/requirementDiagram-M5DCFWZL-CzUUrhQD.js +0 -84
- package/web/assets/sankeyDiagram-L3NBLAOT-D2fbMiIU.js +0 -10
- package/web/assets/sequenceDiagram-ZOUHS735-BNdkqguh.js +0 -157
- package/web/assets/stateDiagram-MLPALWAM-51_Q2w2L.js +0 -1
- package/web/assets/stateDiagram-v2-B5LQ5ZB2-8nHs2aNE.js +0 -1
- package/web/assets/timeline-definition-5SPVSISX-DkMiGj4Z.js +0 -120
- package/web/assets/treeView-SZITEDCU-5DXDK3XO-Cy6P0_CZ.js +0 -1
- package/web/assets/treemap-W4RFUUIX-WYLRDWKO-C_pp1R7A.js +0 -1
- package/web/assets/vennDiagram-IE5QUKF5-BCxMmf9q.js +0 -34
- package/web/assets/wardley-RL74JXVD-BCRCBASE-CMStJhpn.js +0 -1
- package/web/assets/wardleyDiagram-XU3VSMPF-ijlLF77s.js +0 -20
- /package/web/assets/{context-builder-CqQNhRj1.js → context-builder-_HS0v2ma.js} +0 -0
|
@@ -30,7 +30,7 @@ import { isRegistryPrimary } from './registry-primary-flag.js';
|
|
|
30
30
|
import { isVerboseIngestionEnabled } from './utils/verbose.js';
|
|
31
31
|
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
32
32
|
import { parseSourceSafe } from '../tree-sitter/safe-parse.js';
|
|
33
|
-
import {
|
|
33
|
+
import { CLASS_CONTAINER_TYPES, FUNCTION_NODE_TYPES, findEnclosingClassInfo, genericFuncName, inferFunctionLabel, } from './utils/ast-helpers.js';
|
|
34
34
|
import { typeTagForId, constTagForId, buildCollisionGroups } from './utils/method-props.js';
|
|
35
35
|
import { countCallArguments, inferCallForm, extractReceiverName, extractReceiverNode, extractMixedChain, extractCallArgTypes, } from './utils/call-analysis.js';
|
|
36
36
|
import { buildTypeEnv, isSubclassOf } from './type-env.js';
|
|
@@ -39,6 +39,57 @@ import { normalizeFetchURL, routeMatches } from './route-extractors/nextjs.js';
|
|
|
39
39
|
import { extractTemplateComponents } from './vue-sfc-extractor.js';
|
|
40
40
|
import { extractReturnTypeName, stripNullable } from './type-extractors/shared.js';
|
|
41
41
|
import { logger } from '../logger.js';
|
|
42
|
+
// ── Property-prepass helpers (parity with parse-worker.ts) ──
|
|
43
|
+
// These mirror the sequential-path equivalents in parse-worker.ts so the main-
|
|
44
|
+
// thread `processCalls` pre-pass produces byte-identical Property nodes/symbols
|
|
45
|
+
// to the worker pool. Drift between the two paths breaks the
|
|
46
|
+
// `incremental ≡ --force` invariant the moment a repo crosses the worker
|
|
47
|
+
// threshold between runs.
|
|
48
|
+
/** Walk up to the nearest enclosing class/struct/interface AST node. */
|
|
49
|
+
const findEnclosingClassNode = (node) => {
|
|
50
|
+
let current = node.parent;
|
|
51
|
+
while (current) {
|
|
52
|
+
if (CLASS_CONTAINER_TYPES.has(current.type))
|
|
53
|
+
return current;
|
|
54
|
+
current = current.parent;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
};
|
|
58
|
+
/** No-op SymbolTable stub for FieldExtractorContext — matches parse-worker. */
|
|
59
|
+
const NOOP_SYMBOL_TABLE = {
|
|
60
|
+
lookupExact: () => undefined,
|
|
61
|
+
lookupExactFull: () => undefined,
|
|
62
|
+
lookupExactAll: () => [],
|
|
63
|
+
lookupCallableByName: () => [],
|
|
64
|
+
getFiles: () => [][Symbol.iterator](),
|
|
65
|
+
getStats: () => ({ fileCount: 0 }),
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Extract (and cache) field info for a class node. Cache is passed in so it
|
|
69
|
+
* stays scoped to a single `processCalls` invocation rather than leaking
|
|
70
|
+
* across analyze runs (worker uses module-level caching because each worker
|
|
71
|
+
* process is short-lived; the main thread is not).
|
|
72
|
+
*
|
|
73
|
+
* Cache key is `${filePath}:${classNode.startIndex}` — startIndex alone is a
|
|
74
|
+
* per-file byte offset, so almost every Ruby/Python file's leading class lands
|
|
75
|
+
* at byte 0 and would collide across files in the shared map.
|
|
76
|
+
*/
|
|
77
|
+
const getFieldInfo = (classNode, provider, context, cache) => {
|
|
78
|
+
if (!provider.fieldExtractor)
|
|
79
|
+
return undefined;
|
|
80
|
+
const cacheKey = `${context.filePath}:${classNode.startIndex}`;
|
|
81
|
+
const cached = cache.get(cacheKey);
|
|
82
|
+
if (cached)
|
|
83
|
+
return cached;
|
|
84
|
+
const result = provider.fieldExtractor.extract(classNode, context);
|
|
85
|
+
if (!result?.fields?.length)
|
|
86
|
+
return undefined;
|
|
87
|
+
const map = new Map();
|
|
88
|
+
for (const field of result.fields)
|
|
89
|
+
map.set(field.name, field);
|
|
90
|
+
cache.set(cacheKey, map);
|
|
91
|
+
return map;
|
|
92
|
+
};
|
|
42
93
|
/**
|
|
43
94
|
* Type labels treated as class-like **method-dispatch receivers** by the call
|
|
44
95
|
* resolver — the set walked by the MRO / heritage path for member and static
|
|
@@ -577,7 +628,16 @@ importedBindingsMap,
|
|
|
577
628
|
* Consulted ONLY when SymbolTable has no unambiguous match (local-first principle). */
|
|
578
629
|
importedReturnTypesMap,
|
|
579
630
|
/** Phase 14 E3: cross-file RAW return types for for-loop element extraction. Keyed by filePath → Map<calleeName, rawReturnType>. */
|
|
580
|
-
importedRawReturnTypesMap, heritageMap, bindingAccumulator
|
|
631
|
+
importedRawReturnTypesMap, heritageMap, bindingAccumulator,
|
|
632
|
+
/**
|
|
633
|
+
* Optional cache for compiled `Parser.Query` objects keyed by language name.
|
|
634
|
+
* When provided, compiled queries are reused across calls instead of being
|
|
635
|
+
* re-compiled from the query string for every file. Callers that invoke
|
|
636
|
+
* `processCalls` many times with single-file batches (e.g. the cross-file
|
|
637
|
+
* propagation phase) should pass a long-lived map here to avoid O(N)
|
|
638
|
+
* query recompilation overhead.
|
|
639
|
+
*/
|
|
640
|
+
compiledQueryCache) => {
|
|
581
641
|
const parser = await loadParser();
|
|
582
642
|
const collectedHeritage = [];
|
|
583
643
|
const pendingWrites = [];
|
|
@@ -627,7 +687,11 @@ importedRawReturnTypesMap, heritageMap, bindingAccumulator) => {
|
|
|
627
687
|
let matches;
|
|
628
688
|
try {
|
|
629
689
|
const lang = parser.getLanguage();
|
|
630
|
-
|
|
690
|
+
let query = compiledQueryCache?.get(language);
|
|
691
|
+
if (!query) {
|
|
692
|
+
query = new Parser.Query(lang, queryStr);
|
|
693
|
+
compiledQueryCache?.set(language, query);
|
|
694
|
+
}
|
|
631
695
|
matches = query.matches(tree.rootNode);
|
|
632
696
|
}
|
|
633
697
|
catch (queryError) {
|
|
@@ -702,6 +766,111 @@ importedRawReturnTypesMap, heritageMap, bindingAccumulator) => {
|
|
|
702
766
|
}
|
|
703
767
|
prepared.push({ file, language, provider, tree, matches, parentMap, typeEnv });
|
|
704
768
|
}
|
|
769
|
+
// ── Property-registration pre-pass ──
|
|
770
|
+
// Register all routed properties (e.g. Ruby attr_accessor) BEFORE the
|
|
771
|
+
// resolution loop so cross-file field-type lookups (e.g.
|
|
772
|
+
// `user.address.save → Address#save`) succeed regardless of file
|
|
773
|
+
// processing order. This MUST stay in lockstep with the equivalent
|
|
774
|
+
// worker-path block in parse-worker.ts (kind === 'properties') — any
|
|
775
|
+
// divergence between the two paths breaks the `incremental ≡ --force`
|
|
776
|
+
// invariant once a repo crosses the worker threshold between runs.
|
|
777
|
+
const fieldInfoCache = new Map();
|
|
778
|
+
for (const { file, language, provider, matches, typeEnv } of prepared) {
|
|
779
|
+
const callRouter = provider.callRouter;
|
|
780
|
+
if (!callRouter)
|
|
781
|
+
continue;
|
|
782
|
+
matches.forEach((match) => {
|
|
783
|
+
const captureMap = {};
|
|
784
|
+
match.captures.forEach((c) => (captureMap[c.name] = c.node));
|
|
785
|
+
if (!captureMap['call'])
|
|
786
|
+
return;
|
|
787
|
+
const callNameNode = captureMap['call.name'];
|
|
788
|
+
if (!callNameNode)
|
|
789
|
+
return;
|
|
790
|
+
const routed = callRouter(callNameNode.text, captureMap['call']);
|
|
791
|
+
if (!routed || routed.kind !== 'properties')
|
|
792
|
+
return;
|
|
793
|
+
const propEnclosingInfo = findEnclosingClassInfo(captureMap['call'], file.path, provider.resolveEnclosingOwner);
|
|
794
|
+
const propEnclosingClassId = propEnclosingInfo?.classId ?? null;
|
|
795
|
+
// Enrich routed properties with FieldExtractor metadata so types
|
|
796
|
+
// discovered from constructor assignments (e.g. `@address = Address.new`)
|
|
797
|
+
// are propagated even when the routing payload itself lacks declaredType.
|
|
798
|
+
let routedFieldMap;
|
|
799
|
+
if (provider.fieldExtractor && typeEnv) {
|
|
800
|
+
const classNode = findEnclosingClassNode(captureMap['call']);
|
|
801
|
+
if (classNode) {
|
|
802
|
+
routedFieldMap = getFieldInfo(classNode, provider, {
|
|
803
|
+
typeEnv,
|
|
804
|
+
symbolTable: NOOP_SYMBOL_TABLE,
|
|
805
|
+
filePath: file.path,
|
|
806
|
+
language,
|
|
807
|
+
}, fieldInfoCache);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
const fileId = generateId('File', file.path);
|
|
811
|
+
for (const item of routed.items) {
|
|
812
|
+
const routedFieldInfo = routedFieldMap?.get(item.propName);
|
|
813
|
+
const propQualifiedName = propEnclosingInfo
|
|
814
|
+
? `${propEnclosingInfo.className}.${item.propName}`
|
|
815
|
+
: item.propName;
|
|
816
|
+
const nodeId = generateId('Property', `${file.path}:${propQualifiedName}`);
|
|
817
|
+
graph.addNode({
|
|
818
|
+
id: nodeId,
|
|
819
|
+
label: 'Property',
|
|
820
|
+
properties: {
|
|
821
|
+
name: item.propName,
|
|
822
|
+
filePath: file.path,
|
|
823
|
+
startLine: item.startLine,
|
|
824
|
+
endLine: item.endLine,
|
|
825
|
+
language,
|
|
826
|
+
isExported: true,
|
|
827
|
+
description: item.accessorType,
|
|
828
|
+
...(item.declaredType
|
|
829
|
+
? { declaredType: item.declaredType }
|
|
830
|
+
: routedFieldInfo?.type
|
|
831
|
+
? { declaredType: routedFieldInfo.type }
|
|
832
|
+
: {}),
|
|
833
|
+
...(routedFieldInfo?.visibility !== undefined
|
|
834
|
+
? { visibility: routedFieldInfo.visibility }
|
|
835
|
+
: {}),
|
|
836
|
+
...(routedFieldInfo?.isStatic !== undefined
|
|
837
|
+
? { isStatic: routedFieldInfo.isStatic }
|
|
838
|
+
: {}),
|
|
839
|
+
...(routedFieldInfo?.isReadonly !== undefined
|
|
840
|
+
? { isReadonly: routedFieldInfo.isReadonly }
|
|
841
|
+
: {}),
|
|
842
|
+
},
|
|
843
|
+
});
|
|
844
|
+
ctx.model.symbols.add(file.path, item.propName, nodeId, 'Property', {
|
|
845
|
+
...(propEnclosingClassId ? { ownerId: propEnclosingClassId } : {}),
|
|
846
|
+
...(item.declaredType
|
|
847
|
+
? { declaredType: item.declaredType }
|
|
848
|
+
: routedFieldInfo?.type
|
|
849
|
+
? { declaredType: routedFieldInfo.type }
|
|
850
|
+
: {}),
|
|
851
|
+
});
|
|
852
|
+
const relId = generateId('DEFINES', `${fileId}->${nodeId}`);
|
|
853
|
+
graph.addRelationship({
|
|
854
|
+
id: relId,
|
|
855
|
+
sourceId: fileId,
|
|
856
|
+
targetId: nodeId,
|
|
857
|
+
type: 'DEFINES',
|
|
858
|
+
confidence: 1.0,
|
|
859
|
+
reason: '',
|
|
860
|
+
});
|
|
861
|
+
if (propEnclosingClassId) {
|
|
862
|
+
graph.addRelationship({
|
|
863
|
+
id: generateId('HAS_PROPERTY', `${propEnclosingClassId}->${nodeId}`),
|
|
864
|
+
sourceId: propEnclosingClassId,
|
|
865
|
+
targetId: nodeId,
|
|
866
|
+
type: 'HAS_PROPERTY',
|
|
867
|
+
confidence: 1.0,
|
|
868
|
+
reason: '',
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
705
874
|
// ── Resolution loop: verify constructor bindings and resolve calls ──
|
|
706
875
|
// The accumulator (if present) is now fully populated from the preparation
|
|
707
876
|
// loop above, so verifyConstructorBindings sees all provider bindings
|
|
@@ -753,7 +922,13 @@ importedRawReturnTypesMap, heritageMap, bindingAccumulator) => {
|
|
|
753
922
|
// Defer resolution: Ruby attr_accessor properties are registered during
|
|
754
923
|
// this same loop, so cross-file lookups fail if the declaring file hasn't
|
|
755
924
|
// been processed yet. Collect now, resolve after all files are done.
|
|
756
|
-
pendingWrites.push({
|
|
925
|
+
pendingWrites.push({
|
|
926
|
+
receiverTypeName,
|
|
927
|
+
propertyName,
|
|
928
|
+
filePath: file.path,
|
|
929
|
+
srcId,
|
|
930
|
+
line: captureMap['assignment'].startPosition.row + 1,
|
|
931
|
+
});
|
|
757
932
|
}
|
|
758
933
|
// Assignment-only capture (no @call sibling): skip the rest of this
|
|
759
934
|
// forEach iteration — this acts as a `continue` in the match loop.
|
|
@@ -842,47 +1017,8 @@ importedRawReturnTypesMap, heritageMap, bindingAccumulator) => {
|
|
|
842
1017
|
case 'import':
|
|
843
1018
|
return;
|
|
844
1019
|
case 'properties': {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
for (const item of routed.items) {
|
|
848
|
-
const nodeId = generateId('Property', `${file.path}:${item.propName}`);
|
|
849
|
-
graph.addNode({
|
|
850
|
-
id: nodeId,
|
|
851
|
-
label: 'Property',
|
|
852
|
-
properties: {
|
|
853
|
-
name: item.propName,
|
|
854
|
-
filePath: file.path,
|
|
855
|
-
startLine: item.startLine,
|
|
856
|
-
endLine: item.endLine,
|
|
857
|
-
language,
|
|
858
|
-
isExported: true,
|
|
859
|
-
description: item.accessorType,
|
|
860
|
-
},
|
|
861
|
-
});
|
|
862
|
-
ctx.model.symbols.add(file.path, item.propName, nodeId, 'Property', {
|
|
863
|
-
...(propEnclosingClassId ? { ownerId: propEnclosingClassId } : {}),
|
|
864
|
-
...(item.declaredType ? { declaredType: item.declaredType } : {}),
|
|
865
|
-
});
|
|
866
|
-
const relId = generateId('DEFINES', `${fileId}->${nodeId}`);
|
|
867
|
-
graph.addRelationship({
|
|
868
|
-
id: relId,
|
|
869
|
-
sourceId: fileId,
|
|
870
|
-
targetId: nodeId,
|
|
871
|
-
type: 'DEFINES',
|
|
872
|
-
confidence: 1.0,
|
|
873
|
-
reason: '',
|
|
874
|
-
});
|
|
875
|
-
if (propEnclosingClassId) {
|
|
876
|
-
graph.addRelationship({
|
|
877
|
-
id: generateId('HAS_PROPERTY', `${propEnclosingClassId}->${nodeId}`),
|
|
878
|
-
sourceId: propEnclosingClassId,
|
|
879
|
-
targetId: nodeId,
|
|
880
|
-
type: 'HAS_PROPERTY',
|
|
881
|
-
confidence: 1.0,
|
|
882
|
-
reason: '',
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
}
|
|
1020
|
+
// Properties already registered in the pre-pass above.
|
|
1021
|
+
// Skip to avoid duplicate nodes/edges.
|
|
886
1022
|
return;
|
|
887
1023
|
}
|
|
888
1024
|
case 'call':
|
|
@@ -1116,7 +1252,7 @@ importedRawReturnTypesMap, heritageMap, bindingAccumulator) => {
|
|
|
1116
1252
|
const fieldOwner = resolveFieldOwnership(pw.receiverTypeName, pw.propertyName, pw.filePath, ctx);
|
|
1117
1253
|
if (fieldOwner) {
|
|
1118
1254
|
graph.addRelationship({
|
|
1119
|
-
id: generateId('ACCESSES', `${pw.srcId}:${fieldOwner.nodeId}:write`),
|
|
1255
|
+
id: generateId('ACCESSES', `${pw.srcId}:${fieldOwner.nodeId}:write${pw.line !== undefined ? `:${pw.line}` : ''}`),
|
|
1120
1256
|
sourceId: pw.srcId,
|
|
1121
1257
|
targetId: fieldOwner.nodeId,
|
|
1122
1258
|
type: 'ACCESSES',
|
|
@@ -2315,7 +2451,7 @@ export const processAssignmentsFromExtracted = (graph, assignments, ctx, constru
|
|
|
2315
2451
|
if (!fieldOwner)
|
|
2316
2452
|
continue;
|
|
2317
2453
|
graph.addRelationship({
|
|
2318
|
-
id: generateId('ACCESSES', `${asn.sourceId}:${fieldOwner.nodeId}:write`),
|
|
2454
|
+
id: generateId('ACCESSES', `${asn.sourceId}:${fieldOwner.nodeId}:write${asn.line !== undefined ? `:${asn.line}` : ''}`),
|
|
2319
2455
|
sourceId: asn.sourceId,
|
|
2320
2456
|
targetId: fieldOwner.nodeId,
|
|
2321
2457
|
type: 'ACCESSES',
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
// gitnexus/src/core/ingestion/class-extractors/configs/c-cpp.ts
|
|
2
2
|
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
+
import { extractTemplateArguments, stripTemplateArguments, } from '../../utils/template-arguments.js';
|
|
4
|
+
function shouldSkipCppTemplateDuplicateCapture(captureMap, definitionName, capturedName) {
|
|
5
|
+
if (captureMap['template-arguments'] !== undefined)
|
|
6
|
+
return false;
|
|
7
|
+
if (!definitionName)
|
|
8
|
+
return false;
|
|
9
|
+
const argsFromDefinitionName = extractTemplateArguments(definitionName);
|
|
10
|
+
if (argsFromDefinitionName === undefined)
|
|
11
|
+
return false;
|
|
12
|
+
const argsFromCaptureName = capturedName ? extractTemplateArguments(capturedName) : undefined;
|
|
13
|
+
// Generic class capture emits only `List`, while the specialization-aware
|
|
14
|
+
// capture emits `List` + `@declaration.template-arguments`. Skip the former
|
|
15
|
+
// when the declaration name itself is templated to avoid duplicate class defs.
|
|
16
|
+
return argsFromCaptureName === undefined;
|
|
17
|
+
}
|
|
18
|
+
function extractCppTemplateArgumentsWithFallback(captureMap, definitionName, capturedName) {
|
|
19
|
+
return ((captureMap['template-arguments']
|
|
20
|
+
? extractTemplateArguments(captureMap['template-arguments'].text)
|
|
21
|
+
: undefined) ??
|
|
22
|
+
(definitionName ? extractTemplateArguments(definitionName) : undefined) ??
|
|
23
|
+
(capturedName ? extractTemplateArguments(capturedName) : undefined));
|
|
24
|
+
}
|
|
3
25
|
export const cClassConfig = {
|
|
4
26
|
language: SupportedLanguages.C,
|
|
5
27
|
typeDeclarationNodes: ['struct_specifier', 'enum_specifier'],
|
|
@@ -8,4 +30,20 @@ export const cppClassConfig = {
|
|
|
8
30
|
language: SupportedLanguages.CPlusPlus,
|
|
9
31
|
typeDeclarationNodes: ['class_specifier', 'struct_specifier', 'enum_specifier'],
|
|
10
32
|
ancestorScopeNodeTypes: ['namespace_definition', 'class_specifier', 'struct_specifier'],
|
|
33
|
+
extractName: (node) => {
|
|
34
|
+
const nameNode = node.childForFieldName?.('name');
|
|
35
|
+
if (!nameNode)
|
|
36
|
+
return undefined;
|
|
37
|
+
if (nameNode.type !== 'template_type')
|
|
38
|
+
return undefined;
|
|
39
|
+
return stripTemplateArguments(nameNode.text);
|
|
40
|
+
},
|
|
41
|
+
extractTemplateArguments: (node) => {
|
|
42
|
+
const nameNode = node.childForFieldName?.('name');
|
|
43
|
+
if (!nameNode || nameNode.type !== 'template_type')
|
|
44
|
+
return undefined;
|
|
45
|
+
return extractTemplateArguments(nameNode.text);
|
|
46
|
+
},
|
|
47
|
+
shouldSkipClassCapture: ({ captureMap, definitionNode, nameNode }) => shouldSkipCppTemplateDuplicateCapture(captureMap, definitionNode?.childForFieldName?.('name')?.text, nameNode?.text),
|
|
48
|
+
extractTemplateArgumentsFromCapture: ({ captureMap, definitionNode, nameNode }) => extractCppTemplateArgumentsWithFallback(captureMap, definitionNode?.childForFieldName?.('name')?.text, nameNode?.text),
|
|
11
49
|
};
|
|
@@ -116,10 +116,12 @@ export function createClassExtractor(config) {
|
|
|
116
116
|
(isClassLikeLabel(fallback?.type) ? fallback.type : undefined);
|
|
117
117
|
if (!name || !type)
|
|
118
118
|
return null;
|
|
119
|
+
const templateArguments = config.extractTemplateArguments?.(node);
|
|
119
120
|
return {
|
|
120
121
|
name,
|
|
121
122
|
type,
|
|
122
123
|
qualifiedName: buildQualifiedName(node, name) || name,
|
|
124
|
+
...(templateArguments !== undefined ? { templateArguments } : {}),
|
|
123
125
|
};
|
|
124
126
|
};
|
|
125
127
|
return {
|
|
@@ -131,5 +133,11 @@ export function createClassExtractor(config) {
|
|
|
131
133
|
extractQualifiedName(node, simpleName) {
|
|
132
134
|
return extract(node, { name: simpleName })?.qualifiedName ?? null;
|
|
133
135
|
},
|
|
136
|
+
shouldSkipClassCapture(context) {
|
|
137
|
+
return config.shouldSkipClassCapture?.(context) ?? false;
|
|
138
|
+
},
|
|
139
|
+
extractTemplateArgumentsFromCapture(context) {
|
|
140
|
+
return config.extractTemplateArgumentsFromCapture?.(context);
|
|
141
|
+
},
|
|
134
142
|
};
|
|
135
143
|
}
|
|
@@ -5,6 +5,12 @@ export interface ExtractedClassSymbol {
|
|
|
5
5
|
name: string;
|
|
6
6
|
type: ClassLikeNodeLabel;
|
|
7
7
|
qualifiedName: string;
|
|
8
|
+
templateArguments?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ClassCaptureContext {
|
|
11
|
+
captureMap: Record<string, SyntaxNode>;
|
|
12
|
+
definitionNode: SyntaxNode | null;
|
|
13
|
+
nameNode: SyntaxNode | undefined;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
10
16
|
* Cross-language qualified type names are normalized to dot-separated scope
|
|
@@ -21,6 +27,10 @@ export interface ClassExtractor {
|
|
|
21
27
|
type?: NodeLabel | null;
|
|
22
28
|
}): ExtractedClassSymbol | null;
|
|
23
29
|
extractQualifiedName(node: SyntaxNode, simpleName: string): string | null;
|
|
30
|
+
shouldSkipClassCapture?(context: ClassCaptureContext & {
|
|
31
|
+
nodeLabel: ClassLikeNodeLabel;
|
|
32
|
+
}): boolean;
|
|
33
|
+
extractTemplateArgumentsFromCapture?(context: ClassCaptureContext): string[] | undefined;
|
|
24
34
|
}
|
|
25
35
|
export interface ClassExtractionConfig {
|
|
26
36
|
language: SupportedLanguages;
|
|
@@ -31,4 +41,9 @@ export interface ClassExtractionConfig {
|
|
|
31
41
|
extractName?: (node: SyntaxNode) => string | undefined;
|
|
32
42
|
extractType?: (node: SyntaxNode) => ClassLikeNodeLabel | undefined;
|
|
33
43
|
extractScopeSegments?: (node: SyntaxNode) => string[] | null | undefined;
|
|
44
|
+
extractTemplateArguments?: (node: SyntaxNode) => string[] | undefined;
|
|
45
|
+
shouldSkipClassCapture?(context: ClassCaptureContext & {
|
|
46
|
+
nodeLabel: ClassLikeNodeLabel;
|
|
47
|
+
}): boolean;
|
|
48
|
+
extractTemplateArgumentsFromCapture?(context: ClassCaptureContext): string[] | undefined;
|
|
34
49
|
}
|
|
@@ -20,6 +20,23 @@ const __dirname = dirname(__filename);
|
|
|
20
20
|
const leidenPath = resolve(__dirname, '..', '..', '..', 'vendor', 'leiden', 'index.cjs');
|
|
21
21
|
const _require = createRequire(import.meta.url);
|
|
22
22
|
const leiden = _require(leidenPath);
|
|
23
|
+
/**
|
|
24
|
+
* Deterministic PRNG (mulberry32) seed for the vendored Leiden algorithm.
|
|
25
|
+
* Vendored Leiden defaults `rng: Math.random`, which makes community
|
|
26
|
+
* assignment non-deterministic across runs. Passing a seeded RNG gives us
|
|
27
|
+
* reproducible community/modularity output, which is required for the
|
|
28
|
+
* incremental-indexing equivalence test (incremental ≡ full rebuild).
|
|
29
|
+
*/
|
|
30
|
+
const LEIDEN_SEED = 0xc0de;
|
|
31
|
+
function createSeededRng(seed) {
|
|
32
|
+
let s = seed >>> 0;
|
|
33
|
+
return () => {
|
|
34
|
+
s = (s + 0x6d2b79f5) >>> 0;
|
|
35
|
+
let t = Math.imul(s ^ (s >>> 15), 1 | s);
|
|
36
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
37
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
23
40
|
// ============================================================================
|
|
24
41
|
// COMMUNITY COLORS (for visualization)
|
|
25
42
|
// ============================================================================
|
|
@@ -83,6 +100,7 @@ export const processCommunities = async (knowledgeGraph, onProgress) => {
|
|
|
83
100
|
Promise.resolve(leiden.detailed(graph, {
|
|
84
101
|
resolution: isLarge ? 2.0 : 1.0,
|
|
85
102
|
maxIterations: isLarge ? 3 : 0,
|
|
103
|
+
rng: createSeededRng(LEIDEN_SEED),
|
|
86
104
|
})),
|
|
87
105
|
new Promise((_, reject) => setTimeout(() => reject(new Error('Leiden timeout')), LEIDEN_TIMEOUT_MS)),
|
|
88
106
|
]);
|
|
@@ -28,3 +28,8 @@ export declare const resolveImportPath: (currentFile: string, importPath: string
|
|
|
28
28
|
export declare function resolveStandard(rawImportPath: string, filePath: string, ctx: ResolveCtx, language: SupportedLanguages): ImportResult;
|
|
29
29
|
/** Create a reusable standard-resolution strategy for a given language. */
|
|
30
30
|
export declare function createStandardStrategy(language: SupportedLanguages): ImportResolverStrategy;
|
|
31
|
+
/**
|
|
32
|
+
* Strip a JS-family extension from a path, returning the stem.
|
|
33
|
+
* Returns `null` if the path does not end with a JS-family extension.
|
|
34
|
+
*/
|
|
35
|
+
export declare function stripJsExtension(path: string): string | null;
|
|
@@ -52,6 +52,13 @@ export const resolveImportPath = (currentFile, importPath, allFiles, allFileList
|
|
|
52
52
|
const resolved = tryResolveWithExtensions(rewritten, allFiles);
|
|
53
53
|
if (resolved)
|
|
54
54
|
return cache(resolved);
|
|
55
|
+
// ESM fallback: strip .js/.jsx/.mjs/.cjs and retry with TS equivalents
|
|
56
|
+
const strippedAlias = stripJsExtension(rewritten);
|
|
57
|
+
if (strippedAlias !== null) {
|
|
58
|
+
const esmResolved = tryResolveWithExtensions(strippedAlias, allFiles);
|
|
59
|
+
if (esmResolved)
|
|
60
|
+
return cache(esmResolved);
|
|
61
|
+
}
|
|
55
62
|
// Try suffix matching as fallback
|
|
56
63
|
const parts = rewritten.split('/').filter(Boolean);
|
|
57
64
|
const suffixResult = suffixResolve(parts, normalizedFileList, allFileList, index);
|
|
@@ -108,7 +115,17 @@ export const resolveImportPath = (currentFile, importPath, allFiles, allFileList
|
|
|
108
115
|
const basePath = currentDir.join('/');
|
|
109
116
|
if (importPath.startsWith('.')) {
|
|
110
117
|
const resolved = tryResolveWithExtensions(basePath, allFiles);
|
|
111
|
-
|
|
118
|
+
if (resolved)
|
|
119
|
+
return cache(resolved);
|
|
120
|
+
// TypeScript ESM: imports use .js/.jsx/.mjs/.cjs but source files are
|
|
121
|
+
// .ts/.tsx/.mts/.cts. Strip the JS-family extension and re-resolve.
|
|
122
|
+
if (language === SupportedLanguages.TypeScript || language === SupportedLanguages.JavaScript) {
|
|
123
|
+
const stripped = stripJsExtension(basePath);
|
|
124
|
+
if (stripped !== null) {
|
|
125
|
+
return cache(tryResolveWithExtensions(stripped, allFiles));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return cache(null);
|
|
112
129
|
}
|
|
113
130
|
// ---- Generic package/absolute import resolution (suffix matching) ----
|
|
114
131
|
// Java wildcards are handled in processImports, not here
|
|
@@ -140,3 +157,16 @@ export function resolveStandard(rawImportPath, filePath, ctx, language) {
|
|
|
140
157
|
export function createStandardStrategy(language) {
|
|
141
158
|
return (raw, fp, ctx) => resolveStandard(raw, fp, ctx, language);
|
|
142
159
|
}
|
|
160
|
+
// ============================================================================
|
|
161
|
+
// ESM extension helpers
|
|
162
|
+
// ============================================================================
|
|
163
|
+
/** JS-family extensions that TypeScript ESM maps to TS equivalents. */
|
|
164
|
+
const JS_EXTENSION_PATTERN = /\.(js|jsx|mjs|cjs)$/;
|
|
165
|
+
/**
|
|
166
|
+
* Strip a JS-family extension from a path, returning the stem.
|
|
167
|
+
* Returns `null` if the path does not end with a JS-family extension.
|
|
168
|
+
*/
|
|
169
|
+
export function stripJsExtension(path) {
|
|
170
|
+
const match = JS_EXTENSION_PATTERN.exec(path);
|
|
171
|
+
return match ? path.slice(0, -match[0].length) : null;
|
|
172
|
+
}
|
|
@@ -38,6 +38,7 @@ import { cCallConfig, cppCallConfig } from '../call-extractors/configs/c-cpp.js'
|
|
|
38
38
|
import { createHeritageExtractor } from '../heritage-extractors/generic.js';
|
|
39
39
|
import { stripUeMacros } from '../cpp-ue-preprocessor.js';
|
|
40
40
|
import { emitCScopeCaptures, interpretCImport, interpretCTypeBinding, cArityCompatibility, cBindingScopeFor, cImportOwningScope, cReceiverBinding, } from './c/index.js';
|
|
41
|
+
import { emitCppScopeCaptures, interpretCppImport, interpretCppTypeBinding, cppArityCompatibility, cppBindingScopeFor, cppImportOwningScope, cppReceiverBinding, } from './cpp/index.js';
|
|
41
42
|
const C_BUILT_INS = new Set([
|
|
42
43
|
'printf',
|
|
43
44
|
'fprintf',
|
|
@@ -269,12 +270,20 @@ const cCppExtractFunctionName = (node) => {
|
|
|
269
270
|
}
|
|
270
271
|
return { funcName, label };
|
|
271
272
|
};
|
|
272
|
-
/** Check if a C/C++ function_definition is inside a class or struct body
|
|
273
|
+
/** Check if a C/C++ function_definition is inside a class or struct body
|
|
274
|
+
* (and NOT a friend declaration).
|
|
273
275
|
* Used by cppLabelOverride to skip duplicate function captures
|
|
274
|
-
* that are already covered by definition.method queries.
|
|
276
|
+
* that are already covered by definition.method queries.
|
|
277
|
+
* Friend functions are free functions defined inside class bodies —
|
|
278
|
+
* they must NOT be skipped (ISO C++ hidden-friend idiom). */
|
|
275
279
|
function isCppInsideClassOrStruct(functionNode) {
|
|
276
280
|
let ancestor = functionNode?.parent ?? null;
|
|
277
281
|
while (ancestor) {
|
|
282
|
+
// Friend declarations: the function_definition is wrapped in
|
|
283
|
+
// `friend_declaration` → `field_declaration_list` → class_specifier.
|
|
284
|
+
// These are free functions, not methods — don't skip them.
|
|
285
|
+
if (ancestor.type === 'friend_declaration')
|
|
286
|
+
return false;
|
|
278
287
|
if (ancestor.type === 'class_specifier' || ancestor.type === 'struct_specifier')
|
|
279
288
|
return true;
|
|
280
289
|
ancestor = ancestor.parent;
|
|
@@ -408,4 +417,13 @@ export const cppProvider = defineLanguage({
|
|
|
408
417
|
heritageExtractor: createHeritageExtractor(SupportedLanguages.CPlusPlus),
|
|
409
418
|
labelOverride: cppLabelOverride,
|
|
410
419
|
builtInNames: C_BUILT_INS,
|
|
420
|
+
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
421
|
+
emitScopeCaptures: emitCppScopeCaptures,
|
|
422
|
+
interpretImport: interpretCppImport,
|
|
423
|
+
interpretTypeBinding: interpretCppTypeBinding,
|
|
424
|
+
bindingScopeFor: cppBindingScopeFor,
|
|
425
|
+
importOwningScope: cppImportOwningScope,
|
|
426
|
+
receiverBinding: cppReceiverBinding,
|
|
427
|
+
arityCompatibility: cppArityCompatibility,
|
|
428
|
+
// mergeBindings + resolveImportTarget live on ScopeResolver (see cpp/scope-resolver.ts).
|
|
411
429
|
});
|