codebaseiq 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +481 -0
- package/LICENSE +202 -0
- package/README.md +349 -0
- package/dist/augment-vue-worker.js +2 -0
- package/dist/call-graph-evidence-gNsxjCW8.d.ts +16 -0
- package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
- package/dist/chunk-2Q2LW5JW.js +14 -0
- package/dist/chunk-2X7V4HS4.js +88 -0
- package/dist/chunk-34WBMAYK.js +2 -0
- package/dist/chunk-35NLDRZC.js +2 -0
- package/dist/chunk-362QOSFD.js +3 -0
- package/dist/chunk-3IER7Q6H.js +12 -0
- package/dist/chunk-3JSXXYTZ.js +345 -0
- package/dist/chunk-3LCDIREB.js +4 -0
- package/dist/chunk-476NR5B7.js +2 -0
- package/dist/chunk-4FC325IF.js +30 -0
- package/dist/chunk-4WKDMDEW.js +9 -0
- package/dist/chunk-4XTAUQFD.js +2 -0
- package/dist/chunk-5PUWMSDU.js +26 -0
- package/dist/chunk-5VKBFZZU.js +3 -0
- package/dist/chunk-6BQ3DSPK.js +2 -0
- package/dist/chunk-6CS3UQTN.js +3 -0
- package/dist/chunk-6MUIJMVL.js +6 -0
- package/dist/chunk-6NW7MU72.js +40 -0
- package/dist/chunk-6OAHRI2D.js +6 -0
- package/dist/chunk-6YTSKJJ3.js +2 -0
- package/dist/chunk-7FND7D7N.js +2 -0
- package/dist/chunk-7MGU3HPH.js +2 -0
- package/dist/chunk-7NVGT435.js +2 -0
- package/dist/chunk-7XAN6GKB.js +2 -0
- package/dist/chunk-AAQQPKCU.js +2 -0
- package/dist/chunk-ADTBPVUZ.js +21 -0
- package/dist/chunk-AKB7V7TV.js +2 -0
- package/dist/chunk-ANFVSJWQ.js +11 -0
- package/dist/chunk-B2OB55RR.js +3 -0
- package/dist/chunk-B3UYV66Z.js +4 -0
- package/dist/chunk-B75HZHUP.js +2 -0
- package/dist/chunk-BFFZDZQV.js +2 -0
- package/dist/chunk-BGBBVSH4.js +2 -0
- package/dist/chunk-BH5F2Q4O.js +2 -0
- package/dist/chunk-BJ6SQAEN.js +2 -0
- package/dist/chunk-BMYOV5GP.js +77 -0
- package/dist/chunk-BVAJLC5A.js +7 -0
- package/dist/chunk-C6SBF2WH.js +4 -0
- package/dist/chunk-C74PPYLA.js +3 -0
- package/dist/chunk-C7QOQX32.js +8 -0
- package/dist/chunk-CAUCPUOF.js +7 -0
- package/dist/chunk-CO5R3UNA.js +2 -0
- package/dist/chunk-CQP3THUZ.js +7 -0
- package/dist/chunk-CVYSU6BX.js +16 -0
- package/dist/chunk-CWONGW6P.js +3 -0
- package/dist/chunk-DDZ7VHWV.js +20 -0
- package/dist/chunk-DGXRDLV5.js +2 -0
- package/dist/chunk-DO6WQD2T.js +3 -0
- package/dist/chunk-DQMDCD24.js +2 -0
- package/dist/chunk-DR2LURYU.js +3 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-ECQBG7PW.js +564 -0
- package/dist/chunk-EF2R3WNQ.js +2 -0
- package/dist/chunk-ELNRLMC5.js +29 -0
- package/dist/chunk-EMNIHCRB.js +18 -0
- package/dist/chunk-ENCCHKM6.js +5 -0
- package/dist/chunk-EZNMUY67.js +5 -0
- package/dist/chunk-FAJQ7LWY.js +3 -0
- package/dist/chunk-FDGD5AB5.js +2 -0
- package/dist/chunk-FETNQCFO.js +117 -0
- package/dist/chunk-FM5BPL4V.js +60 -0
- package/dist/chunk-FQKZWM4L.js +49 -0
- package/dist/chunk-FW53T7EB.js +2 -0
- package/dist/chunk-G6XFR4ZL.js +4 -0
- package/dist/chunk-GCHRX4YW.js +4 -0
- package/dist/chunk-GTIYTDRE.js +562 -0
- package/dist/chunk-GTXSJDCO.js +2 -0
- package/dist/chunk-GW6Z3WGY.js +2 -0
- package/dist/chunk-H3LGFZVK.js +2 -0
- package/dist/chunk-HKQUXIFO.js +2 -0
- package/dist/chunk-HOA5YGOH.js +3 -0
- package/dist/chunk-HPJRBHVT.js +3 -0
- package/dist/chunk-HRWGYWRJ.js +49 -0
- package/dist/chunk-I2T2LLK2.js +4 -0
- package/dist/chunk-ICFDQHAM.js +3 -0
- package/dist/chunk-ID63777H.js +4 -0
- package/dist/chunk-IJ4HMYBE.js +3 -0
- package/dist/chunk-ILMHV3KM.js +2 -0
- package/dist/chunk-IOP6FWIM.js +2 -0
- package/dist/chunk-IRQOAM5G.js +2 -0
- package/dist/chunk-J77SU6VA.js +38 -0
- package/dist/chunk-JE3WZ6II.js +2 -0
- package/dist/chunk-JEJLSICM.js +4 -0
- package/dist/chunk-JOIRNPPY.js +2 -0
- package/dist/chunk-JSOYNVWH.js +3 -0
- package/dist/chunk-KMITESMT.js +2 -0
- package/dist/chunk-KUW32IRO.js +2 -0
- package/dist/chunk-KWVHSKHK.js +31 -0
- package/dist/chunk-L4NRUAGJ.js +18 -0
- package/dist/chunk-L57ZKWVG.js +6 -0
- package/dist/chunk-LTA3BRZX.js +2 -0
- package/dist/chunk-LU3BMVH2.js +10 -0
- package/dist/chunk-LZYFLFEH.js +2 -0
- package/dist/chunk-MOVBWNIP.js +16 -0
- package/dist/chunk-MVB3DAEY.js +3 -0
- package/dist/chunk-N3IQCBCF.js +29 -0
- package/dist/chunk-NAUD7LCA.js +2 -0
- package/dist/chunk-NCZUNH3E.js +109 -0
- package/dist/chunk-NE6IU5ZD.js +5 -0
- package/dist/chunk-NEDP5RFQ.js +60 -0
- package/dist/chunk-NMTSZXCL.js +2 -0
- package/dist/chunk-NNJ2KZZG.js +4 -0
- package/dist/chunk-NNO6A2PO.js +2 -0
- package/dist/chunk-NNOKTMZT.js +20 -0
- package/dist/chunk-O6QTXQPJ.js +13 -0
- package/dist/chunk-OANDYLJQ.js +2 -0
- package/dist/chunk-OFBE4NGP.js +2 -0
- package/dist/chunk-OGTFJ3XD.js +2 -0
- package/dist/chunk-OL6KJP3N.js +16 -0
- package/dist/chunk-OLF4MA5W.js +8 -0
- package/dist/chunk-OTOKVOJ3.js +2 -0
- package/dist/chunk-OVTS4DKB.js +2 -0
- package/dist/chunk-OZYRSMSH.js +3 -0
- package/dist/chunk-P5XHIJHI.js +2 -0
- package/dist/chunk-PBI2LFKH.js +2 -0
- package/dist/chunk-PIOMTC27.js +2 -0
- package/dist/chunk-PTAWHLVJ.js +6 -0
- package/dist/chunk-PX4RYAAK.js +2 -0
- package/dist/chunk-PYAB5SM6.js +7 -0
- package/dist/chunk-Q5ELPRKQ.js +2 -0
- package/dist/chunk-Q65CQ4XL.js +2 -0
- package/dist/chunk-Q72QSKXC.js +308 -0
- package/dist/chunk-QCN62RTF.js +3 -0
- package/dist/chunk-QDCCHMVZ.js +2 -0
- package/dist/chunk-QHRNXP3C.js +3 -0
- package/dist/chunk-QKPLA6IC.js +2 -0
- package/dist/chunk-QOKYJ33H.js +2 -0
- package/dist/chunk-QW7EP6WI.js +21 -0
- package/dist/chunk-R2NOK63J.js +4 -0
- package/dist/chunk-RBAS5ZHI.js +2 -0
- package/dist/chunk-RDBI2RXU.js +9 -0
- package/dist/chunk-RKEJ6VTF.js +73 -0
- package/dist/chunk-RR7SX44N.js +35 -0
- package/dist/chunk-RU65DDUP.js +215 -0
- package/dist/chunk-SELM5MER.js +2 -0
- package/dist/chunk-SGX43S2L.js +2 -0
- package/dist/chunk-SMRBZ6EC.js +2 -0
- package/dist/chunk-SNNWPCN7.js +4 -0
- package/dist/chunk-ST7V3SKN.js +2 -0
- package/dist/chunk-SWHMHUKF.js +2 -0
- package/dist/chunk-SYDJMPES.js +2 -0
- package/dist/chunk-SZD2KF7Q.js +2 -0
- package/dist/chunk-T3DGWPXM.js +3 -0
- package/dist/chunk-TFZB6XTM.js +239 -0
- package/dist/chunk-TIIC3ZE7.js +2 -0
- package/dist/chunk-TRRC4ZJ7.js +2 -0
- package/dist/chunk-TXXOEMZJ.js +2 -0
- package/dist/chunk-UBGWN7I4.js +2 -0
- package/dist/chunk-UCD3H3UZ.js +5 -0
- package/dist/chunk-UDS562V4.js +5 -0
- package/dist/chunk-UNBY47BC.js +3 -0
- package/dist/chunk-UP3BUZR5.js +74 -0
- package/dist/chunk-UXM43C7T.js +3 -0
- package/dist/chunk-UZGZB3VB.js +3 -0
- package/dist/chunk-VE5AVNMP.js +2 -0
- package/dist/chunk-VEXUL62T.js +2 -0
- package/dist/chunk-VFY6Y2H6.js +61 -0
- package/dist/chunk-VUIYB2V3.js +2 -0
- package/dist/chunk-VXYS3FZD.js +23 -0
- package/dist/chunk-WE5RZHZ7.js +5 -0
- package/dist/chunk-WMPRTGH2.js +2 -0
- package/dist/chunk-WOQBZPIF.js +2 -0
- package/dist/chunk-XLQ3GLWZ.js +2 -0
- package/dist/chunk-XME3HPXZ.js +2 -0
- package/dist/chunk-XMQ23E27.js +2 -0
- package/dist/chunk-XWUOUWYI.js +2 -0
- package/dist/chunk-XZEE23VG.js +5 -0
- package/dist/chunk-Y6KHROC3.js +7 -0
- package/dist/chunk-YESXMKX3.js +3 -0
- package/dist/chunk-YMGZZEW4.js +2 -0
- package/dist/chunk-YSNONTJ2.js +2 -0
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-YVCIMIOC.js +12 -0
- package/dist/chunk-Z54RD7VL.js +3 -0
- package/dist/chunk-ZKX2FRS6.js +15 -0
- package/dist/chunk-ZMI2JSX2.js +2 -0
- package/dist/chunk-ZV3JV5G5.js +8 -0
- package/dist/chunk-ZZ3MWF33.js +4 -0
- package/dist/chunk-ZZXSWSN6.js +2 -0
- package/dist/cli-context-3SNLDYBM.js +3 -0
- package/dist/cli-context-T3B7W6GG.js +2 -0
- package/dist/cli-program-YNOXO72B.js +7 -0
- package/dist/cli.js +3 -0
- package/dist/code-DlqpBDd0.d.ts +121 -0
- package/dist/command-descriptors-6AOUKWW7.js +346 -0
- package/dist/command-descriptors-ZFKJSRUP.js +344 -0
- package/dist/command-panels-SZONPMLJ.js +3 -0
- package/dist/config-types-BNoC96J3.d.ts +560 -0
- package/dist/db-D7sauVFH.d.ts +95 -0
- package/dist/direct-navigation-DP4LVMRX.js +3 -0
- package/dist/direct-navigation-FLUS3BT6.js +2 -0
- package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
- package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
- package/dist/file-kind-BKCVMNUf.d.ts +10 -0
- package/dist/frontend-behavior-evidence-EfM4_9bc.d.ts +4 -0
- package/dist/git-history-ChNHbfZQ.d.ts +13 -0
- package/dist/graph-evidence-BIFqyisO.d.ts +131 -0
- package/dist/health-DJaZXg8I.d.ts +340 -0
- package/dist/index.d.ts +183 -0
- package/dist/index.js +2 -0
- package/dist/invocation-command-descriptors-QT2JMY5J.js +3 -0
- package/dist/invocation-command-descriptors-YN4QJEAX.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-2V2SL4TD.js +2 -0
- package/dist/output-continuation-command-65J5IP3O.js +3 -0
- package/dist/postinstall.js +3 -0
- package/dist/project-reindex-5JOKXAXT.js +2 -0
- package/dist/project-reindex-UQBIKO4M.js +3 -0
- package/dist/queries/affected.d.ts +40 -0
- package/dist/queries/affected.js +2 -0
- package/dist/queries/anchors.d.ts +123 -0
- package/dist/queries/anchors.js +2 -0
- package/dist/queries/architecture.d.ts +166 -0
- package/dist/queries/architecture.js +2 -0
- package/dist/queries/bottlenecks.d.ts +68 -0
- package/dist/queries/bottlenecks.js +2 -0
- package/dist/queries/by-kind.d.ts +27 -0
- package/dist/queries/by-kind.js +2 -0
- package/dist/queries/call-graph.d.ts +52 -0
- package/dist/queries/call-graph.js +2 -0
- package/dist/queries/change-surface.d.ts +55 -0
- package/dist/queries/change-surface.js +2 -0
- package/dist/queries/cleanup-plan.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +90 -0
- package/dist/queries/co-change.js +2 -0
- package/dist/queries/code.d.ts +6 -0
- package/dist/queries/code.js +2 -0
- package/dist/queries/complexity-hotspots.d.ts +61 -0
- package/dist/queries/complexity-hotspots.js +2 -0
- package/dist/queries/complexity.d.ts +74 -0
- package/dist/queries/complexity.js +2 -0
- package/dist/queries/context.d.ts +146 -0
- package/dist/queries/context.js +2 -0
- package/dist/queries/convergence.d.ts +33 -0
- package/dist/queries/convergence.js +2 -0
- package/dist/queries/coupling.d.ts +32 -0
- package/dist/queries/coupling.js +2 -0
- package/dist/queries/cycles.d.ts +66 -0
- package/dist/queries/cycles.js +2 -0
- package/dist/queries/dataflow.d.ts +77 -0
- package/dist/queries/dataflow.js +2 -0
- package/dist/queries/dead.d.ts +58 -0
- package/dist/queries/dead.js +2 -0
- package/dist/queries/decorative-checkers.d.ts +34 -0
- package/dist/queries/decorative-checkers.js +2 -0
- package/dist/queries/deep-chains.d.ts +5 -0
- package/dist/queries/deep-chains.js +2 -0
- package/dist/queries/dependence-slice.d.ts +46 -0
- package/dist/queries/dependence-slice.js +2 -0
- package/dist/queries/dependency-depth.d.ts +49 -0
- package/dist/queries/dependency-depth.js +2 -0
- package/dist/queries/deps.d.ts +15 -0
- package/dist/queries/deps.js +2 -0
- package/dist/queries/diff-impact.d.ts +165 -0
- package/dist/queries/diff-impact.js +2 -0
- package/dist/queries/doc-drift.d.ts +115 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.d.ts +79 -0
- package/dist/queries/drift.js +2 -0
- package/dist/queries/duplicate-bodies.d.ts +55 -0
- package/dist/queries/duplicate-bodies.js +2 -0
- package/dist/queries/entry-map.d.ts +121 -0
- package/dist/queries/entry-map.js +2 -0
- package/dist/queries/evidence.d.ts +70 -0
- package/dist/queries/evidence.js +2 -0
- package/dist/queries/extract-candidates.d.ts +52 -0
- package/dist/queries/extract-candidates.js +2 -0
- package/dist/queries/fan.d.ts +53 -0
- package/dist/queries/fan.js +2 -0
- package/dist/queries/files.d.ts +20 -0
- package/dist/queries/files.js +2 -0
- package/dist/queries/health.d.ts +8 -0
- package/dist/queries/health.js +2 -0
- package/dist/queries/hierarchy.d.ts +21 -0
- package/dist/queries/hierarchy.js +2 -0
- package/dist/queries/hotspots.d.ts +42 -0
- package/dist/queries/hotspots.js +2 -0
- package/dist/queries/imports.d.ts +34 -0
- package/dist/queries/imports.js +2 -0
- package/dist/queries/incomplete-migration.d.ts +90 -0
- package/dist/queries/incomplete-migration.js +2 -0
- package/dist/queries/index.d.ts +180 -0
- package/dist/queries/index.js +2 -0
- package/dist/queries/isolated.d.ts +24 -0
- package/dist/queries/isolated.js +2 -0
- package/dist/queries/locality-candidates.d.ts +51 -0
- package/dist/queries/locality-candidates.js +2 -0
- package/dist/queries/members.d.ts +21 -0
- package/dist/queries/members.js +2 -0
- package/dist/queries/methods.d.ts +43 -0
- package/dist/queries/methods.js +2 -0
- package/dist/queries/not-implemented.d.ts +33 -0
- package/dist/queries/not-implemented.js +2 -0
- package/dist/queries/outline.d.ts +22 -0
- package/dist/queries/outline.js +2 -0
- package/dist/queries/passthrough-candidates.d.ts +41 -0
- package/dist/queries/passthrough-candidates.js +2 -0
- package/dist/queries/plan-context.d.ts +33 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/react-component-duplicates.d.ts +39 -0
- package/dist/queries/react-component-duplicates.js +2 -0
- package/dist/queries/react-hook-candidates.d.ts +44 -0
- package/dist/queries/react-hook-candidates.js +2 -0
- package/dist/queries/react-large-component-pressure.d.ts +34 -0
- package/dist/queries/react-large-component-pressure.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +79 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.d.ts +37 -0
- package/dist/queries/redundant-reexports.js +2 -0
- package/dist/queries/reference-neighborhood.d.ts +4 -0
- package/dist/queries/reference-neighborhood.js +2 -0
- package/dist/queries/reference-reachability.d.ts +48 -0
- package/dist/queries/reference-reachability.js +2 -0
- package/dist/queries/refs.d.ts +13 -0
- package/dist/queries/refs.js +2 -0
- package/dist/queries/self-audit.d.ts +65 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.d.ts +48 -0
- package/dist/queries/similar-chains.js +2 -0
- package/dist/queries/similar-files.d.ts +35 -0
- package/dist/queries/similar-files.js +2 -0
- package/dist/queries/similar-signatures.d.ts +46 -0
- package/dist/queries/similar-signatures.js +2 -0
- package/dist/queries/similar.d.ts +187 -0
- package/dist/queries/similar.js +2 -0
- package/dist/queries/slice.d.ts +4 -0
- package/dist/queries/slice.js +2 -0
- package/dist/queries/source-inspection.d.ts +209 -0
- package/dist/queries/source-inspection.js +2 -0
- package/dist/queries/source-search.d.ts +85 -0
- package/dist/queries/source-search.js +2 -0
- package/dist/queries/stale-abstractions.d.ts +72 -0
- package/dist/queries/stale-abstractions.js +2 -0
- package/dist/queries/stats.d.ts +15 -0
- package/dist/queries/stats.js +2 -0
- package/dist/queries/surface.d.ts +22 -0
- package/dist/queries/surface.js +2 -0
- package/dist/queries/symbols.d.ts +14 -0
- package/dist/queries/symbols.js +2 -0
- package/dist/queries/system-map.d.ts +449 -0
- package/dist/queries/system-map.js +2 -0
- package/dist/queries/system.d.ts +21 -0
- package/dist/queries/system.js +2 -0
- package/dist/queries/test-quality.d.ts +56 -0
- package/dist/queries/test-quality.js +2 -0
- package/dist/queries/trace.d.ts +68 -0
- package/dist/queries/trace.js +2 -0
- package/dist/queries/twin-ab.d.ts +66 -0
- package/dist/queries/twin-ab.js +2 -0
- package/dist/queries/twin-drift.d.ts +119 -0
- package/dist/queries/twin-drift.js +2 -0
- package/dist/queries/unused-imports.d.ts +4 -0
- package/dist/queries/unused-imports.js +2 -0
- package/dist/queries/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/value-flow.d.ts +42 -0
- package/dist/queries/value-flow.js +2 -0
- package/dist/queries/vue-component-duplicates.d.ts +43 -0
- package/dist/queries/vue-component-duplicates.js +2 -0
- package/dist/queries/vue-composable-candidates.d.ts +44 -0
- package/dist/queries/vue-composable-candidates.js +2 -0
- package/dist/queries/vue-large-view-pressure.d.ts +41 -0
- package/dist/queries/vue-large-view-pressure.js +2 -0
- package/dist/queries/wrapper-candidates.d.ts +34 -0
- package/dist/queries/wrapper-candidates.js +2 -0
- package/dist/reindex-worker.js +3 -0
- package/dist/reindex.d.ts +254 -0
- package/dist/reindex.js +298 -0
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +555 -0
- package/dist/runtime.js +4 -0
- package/dist/rust-semantic-session-server.js +2 -0
- package/dist/rust-semantic-session-worker.js +2 -0
- package/dist/rust-semantic-worker.js +2 -0
- package/dist/scip-cli-B7N3haxa.d.ts +67 -0
- package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
- package/dist/symbol-types-BIQwfoAx.d.ts +74 -0
- package/dist/typescript-mailbox-worker.js +2 -0
- package/dist/watch-server.js +8 -0
- package/docs/AGENT_GUIDE.md +148 -0
- package/docs/AI_FAILURE_MODES.md +43 -0
- package/docs/API.md +40 -0
- package/docs/API_EVOLUTION.md +77 -0
- package/docs/CLI_JSON_OUTPUT.md +389 -0
- package/docs/COMMAND_REFERENCE.md +294 -0
- package/docs/CONFIGURATION_WRITE_SAFETY.md +131 -0
- package/docs/DETECTOR_GUIDE.md +46 -0
- package/docs/DURABILITY.md +159 -0
- package/docs/INDEX_GENERATIONS.md +167 -0
- package/docs/LOCK_PROTOCOL.md +133 -0
- package/docs/MAILBOX_LIFECYCLE.md +224 -0
- package/docs/REGEX_POLICY.md +36 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +104 -0
- package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
- package/docs/SECURITY_MODEL.md +125 -0
- package/docs/TELEMETRY_RETENTION.md +84 -0
- package/docs/TIME_SEMANTICS.md +77 -0
- package/docs/WATCH_REFRESH_REQUESTS.md +123 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +424 -0
- package/docs/accuracy-audit-checklist.md +304 -0
- package/docs/accuracy-hardening-goal.md +500 -0
- package/docs/analyzer-inventory.md +78 -0
- package/docs/analyzer-validation-protocol.md +84 -0
- package/docs/architecture-coherence-vision.md +254 -0
- package/docs/assets/codebaseiq-logo-dark.svg +21 -0
- package/docs/assets/codebaseiq-logo.svg +24 -0
- package/docs/locality-analyzer-design.md +193 -0
- package/docs/schemas/cli-json-envelope.schema.json +237 -0
- package/docs/schemas/cli-output-page.schema.json +104 -0
- package/docs/schemas/npm-release-state.schema.json +146 -0
- package/docs/schemas/observation-receipt.schema.json +164 -0
- package/docs/schemas/project-config.schema.json +318 -0
- package/docs/schemas/suppression-record.schema.json +79 -0
- package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
- package/package.json +482 -0
- package/scripts/build-codebaseiq-windows.mjs +197 -0
- package/scripts/codebaseiq-windows-provenance.mjs +364 -0
- package/scripts/evidence-product-contract.mjs +197 -0
- package/scripts/verify-codebaseiq-windows.mjs +29 -0
- package/skills/codebaseiq/SKILL.md +75 -0
- package/skills/codebaseiq/agents/openai.yaml +4 -0
- package/skills/codebaseiq-explore/SKILL.md +34 -0
- package/skills/codebaseiq-explore/agents/openai.yaml +4 -0
- package/skills/concrete-plan/SKILL.md +79 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{k as o}from"./chunk-WE5RZHZ7.js";var f=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function l(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let t=r;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!f.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function c(r,t){return r.version===t.version&&r.pid===t.pid&&r.platform===t.platform&&r.startToken===t.startToken}import{execFileSync as m}from"child_process";import{platform as d}from"os";var s=new WeakMap,u=1e3,i=16*1024;function g(r,t=P){if(!Number.isSafeInteger(r)||r<=0)return null;if(r===process.pid){let n=s.get(t);if(n)return n}try{let n=p(r,t);if(!n)return null;let e={version:1,pid:r,platform:t.platform,startToken:n};return r===process.pid&&s.set(t,e),e}catch{return null}}function p(r,t){if(t.platform==="linux"||t.platform==="android")return y(t.readFile(`/proc/${r}/stat`));if(t.platform==="win32"){let n=`([DateTimeOffset](Get-Process -Id ${r} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return a(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",n]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?a(t.run("ps",["-p",String(r),"-o","lstart="])):null}function y(r){let t=r.lastIndexOf(")");if(t<0)return null;let e=r.slice(t+1).trim().split(/\s+/)[19];return e&&/^\d+$/.test(e)?e:null}function a(r){let t=r.trim();return t===""?null:t}var P={platform:d(),readFile(r){return o(r,{maxBytes:i,inputKind:"process identity pseudo-file"})},run(r,t){return m(r,[...t],{encoding:"utf8",timeout:u,maxBuffer:i,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};function k(){return performance.now()}export{l as a,c as b,g as c,k as d};
|
|
2
|
+
//# sourceMappingURL=chunk-EF2R3WNQ.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function m(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT
|
|
2
|
+
m.symbol_id,
|
|
3
|
+
d.relative_path,
|
|
4
|
+
COUNT(*) AS ref_count
|
|
5
|
+
FROM mentions m
|
|
6
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
+
JOIN documents d ON c.document_id = d.id
|
|
8
|
+
WHERE m.role != 1
|
|
9
|
+
${t}
|
|
10
|
+
${n.pathExclusionsFor("d")}
|
|
11
|
+
GROUP BY m.symbol_id, d.relative_path`,...e??[])})}function c(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
12
|
+
FROM mentions m
|
|
13
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
+
JOIN documents d ON c.document_id = d.id
|
|
15
|
+
WHERE m.role != 1
|
|
16
|
+
${t}
|
|
17
|
+
${n.pathExclusionsFor("d")}`,...e??[])}).filter(e=>e.symbol_id!==null)}function l(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id
|
|
18
|
+
FROM mentions m
|
|
19
|
+
WHERE m.role != 1
|
|
20
|
+
${t}`,...e??[])}).filter(e=>e.symbol_id!==null)}function u(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
21
|
+
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
22
|
+
FROM mentions m
|
|
23
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
24
|
+
JOIN documents d ON c.document_id = d.id
|
|
25
|
+
WHERE m.role != 1
|
|
26
|
+
${t}
|
|
27
|
+
${n.pathExclusionsFor("d")}
|
|
28
|
+
ORDER BY d.relative_path, c.start_line`,...e??[])})}function i(n,o,e){if(!o)return e();if(o.length===0)return[];let t=[];for(let r=0;r<o.length;r+=750)t.push(...e(o.slice(r,r+750)));return t}export{m as a,c as b,l as c,u as d};
|
|
29
|
+
//# sourceMappingURL=chunk-ELNRLMC5.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{c as S}from"./chunk-WMPRTGH2.js";import{c as m}from"./chunk-7FND7D7N.js";import{h as y}from"./chunk-6CS3UQTN.js";import{a as h}from"./chunk-TIIC3ZE7.js";import{p}from"./chunk-O6QTXQPJ.js";import{a as g}from"./chunk-ADTBPVUZ.js";import f from"path";function W(e,t){let{scope:i,minDeviation:r=5,limit:n=50}=t??{},a=t?.semantic!==!1,u=t?.includePatternDeviations===!0,o=new m(e).fileDependencyGraph(i),l=S(e,{scope:i}),c=x([...D(e,o,{scope:i,semantic:a}),...R(l.forbiddenEdges),...u?E(o,r):[]]);return t?.includeArchitecture===!0&&(c.architecture=l),n<=0||c.results.length<=n?c:{...c,results:c.results.slice(0,n),totalResults:c.results.length}}function D(e,t,i){let r=_(e,i.scope),n=[],a=new Set;for(let[s,o]of t){if(d(s))continue;let l=r.get(s)??new Set;for(let c of o)d(c)||l.has(c)||v(e,s,c,i)||(n.push({file:s,dep:c}),a.add(s))}a.size>0&&w(e,r,{paths:[...a]});let u=[];for(let{file:s,dep:o}of n)(r.get(s)??new Set).has(o)||u.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${s} to ${o}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return u}function v(e,t,i,r){return C(e,t,i)||M(e,t,i)||O(i)||P(e,t,i)||N(i)?!0:r.semantic&&A(e,t,i)}function R(e){return e.flatMap(t=>{let i=t.examples[0];return i?[{file:i.fromFile,kind:"architecture-violation",description:`${t.from} depends on forbidden boundary ${t.to} through ${t.fileEdgeCount} file edge(s)`,dep:i.toFile,detail:`${t.from} may not depend on ${t.to}`,actionTier:"direct",policyBasis:"explicit",architecture:{fromBoundary:t.from,toBoundary:t.to,fileEdgeCount:t.fileEdgeCount,importerCount:t.importerCount,importedFileCount:t.importedFileCount,examples:t.examples},evidenceReasons:[`configured dependency row for ${t.from} does not allow ${t.to}`,`${t.fileEdgeCount} file edge(s) connect ${t.importerCount} importer(s) to ${t.importedFileCount} imported file(s)`,...t.examples.map(r=>`${r.fromFile} imports ${r.toFile}`)],recommendation:"Move the dependency behind an allowed boundary, reverse the dependency through an owned interface, or deliberately update the project architecture rule."}]:[]})}function E(e,t){let i=[];for(let[r,n]of k(e)){let a=n.filter(s=>!d(s));if(a.length<t)continue;let u=I(e,a);for(let s of a)for(let o of e.get(s)??[])d(o)||(u.get(o)??0)===1&&f.dirname(o)!==r&&f.dirname(o)!==f.dirname(r)&&i.push({file:s,kind:"pattern-deviation",description:`Only file in ${r}/ that depends on ${o}`,dep:o,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${r}/ were compared`,`${s} is the only non-skipped sibling depending on ${o}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."})}return i}function x(e){let t=e.filter(i=>i.kind==="architecture-violation").length;return{results:e,unusedImports:e.filter(i=>i.kind==="unused-import").length,architectureViolations:t,layerViolations:t,patternDeviations:e.filter(i=>i.kind==="pattern-deviation").length}}function k(e){let t=new Map;for(let i of e.keys()){let r=f.dirname(i),n=t.get(r);n||(n=[],t.set(r,n)),n.push(i)}return t}function I(e,t){let i=new Map;for(let r of t)for(let n of e.get(r)??[])d(n)||i.set(n,(i.get(n)??0)+1);return i}function _(e,t){let i=new Map;return $(e,i,t),i}function $(e,t,i){for(let r of F(e,i))b(e,t,r.from_file,r.to_file)}function F(e,t){let i=t?"AND d1.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
+
JOIN (
|
|
7
|
+
SELECT m2.symbol_id, c2.document_id
|
|
8
|
+
FROM mentions m2
|
|
9
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
+
WHERE m2.role = 1
|
|
11
|
+
GROUP BY m2.symbol_id
|
|
12
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
+
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
14
|
+
WHERE d1.id != d2.id
|
|
15
|
+
AND m.role != 1
|
|
16
|
+
${e.pathExclusionsFor("d1","d2")}
|
|
17
|
+
${i}`,...r)}function w(e,t,i={}){new m(e).scanSourceReferences({paths:i.paths??g(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},n=>{n.target.relativePath!==n.sourceFile&&(e.isIgnored(n.target.relativePath)||b(e,t,n.sourceFile,n.target.relativePath))})}function b(e,t,i,r){if(e.isIgnored(i)||e.isIgnored(r))return;let n=t.get(i);n||(n=new Set,t.set(i,n)),n.add(r)}function O(e){return e.includes("types")||e.endsWith(".d.ts")}function A(e,t,i){let r=y(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.isUsed)}function C(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.used)}function M(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.every(n=>n.isTypeOnly===!0)}function N(e){return e.endsWith(".vue")}function P(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length===0?!1:r.every(n=>n.kind==="side-effect"||n.kind==="namespace"&&n.usedMembers.length===0&&!n.used)}function d(e){let t=h(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||T(f.basename(e)))}function T(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{W as a};
|
|
18
|
+
//# sourceMappingURL=chunk-EMNIHCRB.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as ze}from"./chunk-L57ZKWVG.js";import{b as Te,c as ge}from"./chunk-SMRBZ6EC.js";import{c as Be}from"./chunk-XLQ3GLWZ.js";import{d as we}from"./chunk-JEJLSICM.js";import{i as qe}from"./chunk-FQKZWM4L.js";import{c as Ke}from"./chunk-7FND7D7N.js";import{d as Ge,e as $e,f as Xe}from"./chunk-CVYSU6BX.js";import{a as U}from"./chunk-TIIC3ZE7.js";import{A as Ne,d as te,i as oe,t as be}from"./chunk-FETNQCFO.js";import{f as Q}from"./chunk-O6QTXQPJ.js";import{v as Re}from"./chunk-BMYOV5GP.js";var Ue=4,yn=3,fn=12,pn=48,bn=64,J=10,V=6,gn=24,Sn=320,Pe=6,vn=12,An=1,Mn=4,Ln=7,Dn=12,ke="source-construct:",Cn=96,Rn=32,We=4,wn=32,Tn=8,je=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function Nt(e,n,s={}){let a=Pn(n),r=ft(n);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=s.limit??Ue,t=s.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let i=new Ke(e),d=i.scopedDefinitions(s.scope).filter(g=>!oe(g.symbol)),l=[...d],c=new Map(l.map(g=>[g.symbol,g])),m=new Map;for(let g of d)He(m,g,a);let u=Be(e,{scope:s.scope});for(let g of u.files){let fe=be(e,g.relativePath).filter(_=>!oe(_.symbol));if(fe.length===0)continue;let ne=cn(g.text);for(let _=0;_<ne.length;_+=1){let pe=T(ne[_]??""),ae=a.filter(O=>pe.has(O));if(ae.length===0)continue;let D=Ne(fe,_);if(!(!D||oe(D.symbol)))for(let O of ae)le(m,D,O,"source",g.relativePath,_)}}let h=Ye(m),y=[...m.values()].map(g=>Se(g,h,r)).sort(R),b=xn(u.files,y,a),v=-1;for(let g of b){let z=be(e,g.relativePath),fe=z.filter(D=>!oe(D.symbol)),ne=Q(e,g.relativePath)?.callables??[],_=new Map,pe=D=>{let O=`${D.startLine}\0${D.endLine}\0${D.name}`,Y=_.get(O);if(Y)return Y;let N=In(g.relativePath,z,D,()=>v--);return N?(_.set(O,N),l.push(N),c.set(N.symbol,N),He(m,N,a),N):null};for(let D of ne){let O=T(D.name);a.some(Y=>O.has(Y))&&pe(D)}if(ne.length===0)continue;let ae=cn(g.text);for(let D=0;D<ae.length;D+=1){let O=T(ae[D]??""),Y=a.filter(Ce=>O.has(Ce));if(Y.length===0)continue;let N=En(ne,D),ce=N?pe(N):null;if(!ce)continue;let Oe=Qe(fe,D);if(Qe(Oe?[Oe,ce]:[ce],D)?.symbol===ce.symbol)for(let Ce of Y)le(m,ce,Ce,"source",g.relativePath,D)}}let S=Ye(m),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of m.values()){let z=M.get(g.definition.relativePath);z&&(g.sourceCharacters=z.slice(g.definition.startLine,g.definition.endLine+1).join(`
|
|
2
|
+
`).length)}let f=[...m.values()].map(g=>Se(g,S,r)).sort(R),C=Math.min(f.length,Math.max(fn,o*yn)),A=t?f:re([...f.slice(0,C),...[...f].sort(xe).slice(0,Math.max(pn,C)),...ct(f,a),...lt(f,a,S)]),P=A.length,I=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=Fn(l),E=kn(e,i,A,I,c,H,new Set(m.keys()),s.semantic!==!1),B=Nn(E,A,m,S,c),F=Gn(B,S,a),K=Zn(e,i,E,m,S,l,c,s.semantic!==!1),L=[...Xn(e,i,B,c,S,s.semantic!==!1),...F,...B,...K].map(g=>({...g,queryPathMatches:mt(g)})).sort((g,z)=>Z(g,z,S)),k=t?L:ut(L,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-P),ye=Math.max(0,L.length-k.length)+ee,hn=t?f.length:Math.min(f.length,o+Ue);return{query:n,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:k,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:P,omittedRootCount:ee,omittedGroupCount:ye,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:ye===0?null:`codebaseiq anchors ${Le(n)}${s.scope?` --scope ${Le(s.scope)}`:""} --limit ${hn}`}}function Pn(e){let n=De(e).filter(s=>!je.has(s.toLocaleLowerCase())).map(_e).filter(s=>s.length>=3&&!je.has(s));return[...new Set(n)]}function He(e,n,s){let a=T(n.leaf),r=T(n.relativePath),o=T(n.documentation??"");for(let i of s)a.has(i)&&le(e,n,i,"symbol"),r.has(i)&&le(e,n,i,"path"),o.has(i)&&le(e,n,i,"documentation");let t=e.get(n.symbol);t&&(t.symbolPhraseLength=bt(n.leaf,s))}function le(e,n,s,a,r,o){let t=e.get(n.symbol)??{definition:n,matches:new Map,symbolPhraseLength:0},i=t.matches.get(s)??{sources:new Set,locations:new Map};i.sources.add(a),r!==void 0&&o!==void 0&&i.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(s,i),e.set(n.symbol,t)}function Ye(e){let n=new Map;for(let s of e.values())for(let a of s.matches.keys())n.set(a,(n.get(a)??0)+1);return n}function In(e,n,s,a){let r=n[0]?.documentId;if(r===void 0||n.find(i=>i.isFunctionLike&&i.leaf===s.name&&i.startLine===s.startLine&&i.endLine===s.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${ke}${e}:${s.startLine}:${s.endLine}:${s.name}`,relativePath:e,startLine:s.startLine,startChar:0,endLine:s.endLine,endChar:0,leaf:s.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function xn(e,n,s){let a=new Set(n.slice(0,Cn).map(t=>t.file)),r=new Set(s),o=e.map(t=>{let i=T(t.relativePath),d=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(d),c=[...i].filter(u=>r.has(u)).length,m=[...l].filter(u=>r.has(u)).length;return{file:t,score:m*4+c}}).filter(t=>t.score>0).sort((t,i)=>i.score-t.score||x(U(t.file.relativePath))-x(U(i.file.relativePath))||t.file.relativePath.localeCompare(i.file.relativePath)).slice(0,Rn);for(let t of o)a.add(t.file.relativePath);return e.filter(t=>a.has(t.relativePath))}function En(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||s.startLine-a.startLine)[0]}function Fn(e){let n=new Map;for(let s of e){if(!G(s))continue;let a=`${s.relativePath}\0${$(s.leaf)}`,r=n.get(a)??[];r.push(s),n.set(a,r)}return n}function Qe(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||Number(G(a))-Number(G(s))||s.startLine-a.startLine||s.symbol.localeCompare(a.symbol))[0]}function G(e){return e.symbol.startsWith(ke)}function W(e){return G(e)?e.leaf:te(e.symbol)}function Se(e,n,s=[]){let a=e.definition,r=[...e.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(gt),locations:[...c.locations.values()].sort(un).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),i=r.reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0),d=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0);return{symbol:a.symbol,label:W(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:U(a.relativePath),matches:r,focusLocations:At(e,n),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:e.symbolPhraseLength,identityMatchedTerms:o,rarity:i,symbolRarity:d,queryPathMatches:pt(a.relativePath,s),...e.sourceCharacters===void 0?{}:{sourceCharacters:e.sourceCharacters}}}function kn(e,n,s,a,r,o,t,i){let d=a.filter(b=>!G(b)),l=n.calleeMap(d,{additive:!1,semantic:i}),c=new Map,m=new Map;for(let b of s){let v=r.get(b.symbol),S=v?G(v)?Ve(e,v,r,o,1):ve(e,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!G(v)||G(f))&&m.set(f.symbol,f)}}let u=[...m.values()],h=n.calleeMap(u.filter(b=>!G(b)),{additive:!1,semantic:i}),y=new Map;for(let b of u)y.set(b.symbol,G(b)?Ve(e,b,r,o,2):ve(e,b,h.get(b.symbolId)??[],r,2,t));return s.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=q([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function ve(e,n,s,a,r,o=new Set){let t=new Map;for(let i of s){let d=a.get(i.symbol);if(!d?.isFunctionLike||d.symbol===n.symbol||i.source==="ast-callsite"&&!On(e,n,d,i.callsiteLine))continue;let l=t.get(d.symbol);(!l||yt(i,l)<0)&&t.set(d.symbol,i)}return[...t.entries()].map(([i,d])=>{let l=a.get(i);return{kind:"call",fromSymbol:n.symbol,fromLabel:te(n.symbol),fromFile:n.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:Fe(d.source),evidence:d.source,callsiteLine:d.callsiteLine??_n(e,n,l)}}).sort((i,d)=>Number(o.has(d.toSymbol))-Number(o.has(i.toSymbol))||X(i,d)).slice(0,bn)}function Ve(e,n,s,a,r){let o=ge(e,n.relativePath,n.startLine,n.endLine).targets.flatMap(t=>{let i=s.get(t.definition.symbol)??t.definition;return!i.isFunctionLike||i.symbol===n.symbol?[]:[{kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:W(i),toFile:i.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of Te(e,n.relativePath,{ranges:[{startLine:n.startLine,endLine:n.endLine}],excludeIndexedTargets:!1}).targets){let i=[...a.get(`${t.targetFile}\0${$(t.calleeLeaf)}`)??[],...be(e,t.targetFile).filter(d=>d.isFunctionLike&&$(d.leaf)===t.calleeLeaf)].find(d=>d.startLine===t.targetStartLine&&d.endLine===t.targetEndLine);!i||i.symbol===n.symbol||o.push({kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:W(i),toFile:i.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(e,n.relativePath)?.callSites??[]){if(t.line<n.startLine||t.line>n.endLine||t.memberAccess)continue;let i=(a.get(`${n.relativePath}\0${$(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==n.symbol);if(i.length!==1)continue;let d=i[0];o.push({kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:d.symbol,toLabel:W(d),toFile:d.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return q(o).sort(X)}function _n(e,n,s){let a=$(s.leaf);return Q(e,n.relativePath)?.callSites.find(r=>r.line>=n.startLine&&r.line<=n.endLine&&$(r.calleeLeaf)===a)?.line??null}function On(e,n,s,a){if(a===void 0)return!1;let r=$(s.leaf);return Q(e,n.relativePath)?.callSites.some(o=>o.line===a&&$(o.calleeLeaf)===r)??!1}function $(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}function Nn(e,n,s,a,r){let o=new Map(n.map((c,m)=>[c.symbol,m])),t=n.map((c,m)=>m),i=c=>{let m=c;for(;t[m]!==m;)m=t[m];for(;t[c]!==c;){let u=t[c];t[c]=m,c=u}return m},d=(c,m)=>{let u=i(c),h=i(m);u!==h&&(t[h]=u)};for(let c of e){let m=o.get(c.root.symbol);if(m!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&d(m,h)}}let l=new Map;for(let c=0;c<n.length;c+=1){let m=i(c),u=l.get(m)??[];u.push(n[c]),l.set(m,u)}return[...l.values()].map((c,m)=>{let u=new Set(c.map(f=>f.symbol)),h=q(e.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=s.get(f);if(C)y.has(f)||y.set(f,Se(C,a));else{let A=r.get(f);A&&y.set(f,dn(A))}}let b=st(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=rt(h,b,u,y);return{id:`anchor-set:${m+1}:${me(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:he(b,h,S)}})}function Gn(e,n,s){let a=new Map(s.map((o,t)=>[o,t])),r=[];for(let o=0;o<e.length;o+=1){let t=e[o],i=Ze(t);if(i.size!==0)for(let d=o+1;d<e.length;d+=1){let l=e[d],c=Ze(l),m=[...i].filter(A=>c.has(A));if(m.length===0||![...i].some(A=>!c.has(A))||![...c].some(A=>!i.has(A)))continue;let u=$n(t,l);if(u.length<2)continue;let h=q([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=m.sort((A,P)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(P)??Number.MAX_SAFE_INTEGER)||A.localeCompare(P)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>n.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${me(t.roots[0])}:${me(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:he(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,n)).slice(0,Dn).map(o=>o.group)}function Ze(e){return new Set(e.roots.flatMap(n=>n.matches.filter(s=>s.sources.includes("path")).map(s=>s.term)))}function $n(e,n){return re([Je(e),Je(n)].filter(s=>s!==void 0))}function Je(e){let n=new Set(e.keyAnchors.map(a=>a.symbol)),s=new Map;for(let a of e.relations)!n.has(a.fromSymbol)||!n.has(a.toSymbol)||s.set(a.fromSymbol,(s.get(a.fromSymbol)??0)+1);return[...e.keyAnchors].sort((a,r)=>+((s.get(r.symbol)??0)>0)-+((s.get(a.symbol)??0)>0)||en(r)-en(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(s.get(r.symbol)??0)-(s.get(a.symbol)??0)||R(a,r))[0]}function en(e){return e.matchedTerms.length+e.identityMatchedTerms.length*2+(e.queryPathMatches?.length??0)*4}function Xn(e,n,s,a,r,o){let t=qe(e);if(!t||t.links.length===0||s.length<2)return[];let i=new Map(t.observations.map(h=>[h.id,h])),d=new Map,l=new Map,c=[...s].sort((h,y)=>Z(h,y,r)).slice(0,vn),m=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of m){let b=i.get(y.from),v=i.get(y.to);if(!b||!v||!Kn(h,b,a))continue;let S=qn(h,b,a);if(!S)continue;let M=d.get(v.id)??Un(e,n,v,a,o,Mn);if(d.set(v.id,M),M.reachedSymbols.size===0)continue;let f=s.filter(L=>L.id!==h.id&&Bn(L).some(k=>M.reachedSymbols.has(k))&&Ie(S,L)>=2).sort((L,k)=>Ie(S,k)-Ie(S,L)||Z(L,k,r)).slice(0,An);if(f.length===0)continue;let C=[h.id,b.id,...f.map(L=>L.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(ue)),P=Qn(de(v),A,M.relations);if(P.length===0)continue;let I=Yn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=q([I,...M.relations,...h.relations,...f.flatMap(L=>L.relations)]),E=Vn([I,...P],H,h,f),B=re([S,...f.flatMap(L=>L.roots)]).sort(R),F=re([S,...f.flatMap(L=>L.keyAnchors)]).slice(0,Ln),K=[...new Set([...S.matchedTerms,...f.flatMap(L=>L.matchedTerms)])].sort(),ie=zn(e,n,S,a,o);B.length===0||F.length<2||l.set(C,{id:`cross-boundary-set:${me(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:B,keyAnchors:F,candidateOwnerCount:F.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:K,relations:E,relationCount:H.length,omittedRelations:Math.max(0,H.length-E.length),systemMapCommand:he(F,H,K)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Kn(e,n,s){let a=new Set(ue(e));return n.owner.symbol&&a.has(n.owner.symbol)?!0:[...a].map(r=>s.get(r)).some(r=>r?.relativePath===n.source.file&&r.startLine<=n.source.startLine&&r.endLine>=n.source.endLine)}function qn(e,n,s){let a=re([...e.roots,...e.keyAnchors]);if(n.owner.symbol){let r=a.find(o=>o.symbol===n.owner.symbol);if(r)return r}return a.find(r=>{let o=s.get(r.symbol);return o?.relativePath===n.source.file&&o.startLine<=n.source.startLine&&o.endLine>=n.source.endLine})??null}function ue(e){return[...new Set([...e.roots.map(n=>n.symbol),...e.keyAnchors.map(n=>n.symbol),...e.relations.flatMap(n=>[n.fromSymbol,n.toSymbol])])]}function Bn(e){return[...new Set([...e.roots,...e.keyAnchors].map(n=>n.symbol))]}function Ie(e,n){let s=T(e.leaf),a=[...n.roots,...n.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let i of s)o.has(i)&&(t+=1);r=Math.max(r,t)}return r}function zn(e,n,s,a,r){let o=a.get(s.symbol);if(!o?.isFunctionLike)return[];let t=n.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let i=T(s.leaf);return[...t].filter(d=>d!==s.file&&U(d)!=="test").flatMap(d=>{let l=Q(e,d);return(l?.callSites??[]).filter(c=>$(c.calleeLeaf)===$(s.leaf)).flatMap(c=>{let m=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!m)return[];let u=[...T(m.name)].filter(h=>i.has(h)).length;return u>=2?[{name:m.name,file:d,line:m.startLine,endLine:m.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((d,l)=>l.overlap-d.overlap||d.file.localeCompare(l.file)||d.line-l.line).slice(0,1).map(({name:d,file:l,line:c,endLine:m,callsiteLine:u})=>({name:d,file:l,line:c,endLine:m,callsiteLine:u}))}function Un(e,n,s,a,r,o){let t=Wn(e,s,a),i=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:de(s),fromLabel:Ae(s),fromFile:s.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),d=jn(e,s);i.push(...d.relations);let l=ln([...t.map(u=>u.definition),...d.definitions]),c=l,m=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=n.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=ve(e,b,h.get(b.symbolId)??[],a,u);i.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!m.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)m.add(b.symbol)}return{entryDefinitions:l,relations:q(i),reachedSymbols:new Set([...l.map(u=>u.symbol),...i.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Wn(e,n,s){let a=n.owner.symbol?s.get(n.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:n.source.startLine}];let r=Re(e,n.source.file),o=we(e,n.source.file,0,Math.max(0,r.length-1),[n.source.startLine]),t=ge(e,n.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),i=Q(e,n.source.file),d=Xe(e),l=(i?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let m=Ge(n.source.file,d.get(c.calleeLeaf)??[]),u=$e(e,n.source.file,m,c.memberAccess,c.calleeQualifier),h=u?s.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Hn([...t,...l])}function jn(e,n){let s=Re(e,n.source.file),a=we(e,n.source.file,0,Math.max(0,s.length-1),[n.source.startLine]),r=Te(e,n.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let i of r){let d=`source-construct:${i.targetFile}:${i.targetStartLine}:${i.targetEndLine}:${i.calleeLeaf}`;t.push({kind:"call",fromSymbol:de(n),fromLabel:Ae(n),fromFile:n.source.file,toSymbol:d,toLabel:i.calleeLeaf,toFile:i.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:i.line});let l=ge(e,i.targetFile,i.targetStartLine,i.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:d,fromLabel:i.calleeLeaf,fromFile:i.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:ln(o),relations:q(t)}}function Hn(e){return[...new Map(e.map(n=>[n.definition.symbol,n])).values()]}function ln(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function de(e){return e.owner.symbol??e.id}function Ae(e){return e.owner.name??`${e.source.file}:${e.source.startLine+1}`}function Yn(e,n,s,a,r){return{kind:"runtime-boundary",fromSymbol:de(e),fromLabel:Ae(e),fromFile:e.source.file,toSymbol:de(n),toLabel:Ae(n),toFile:n.source.file,depth:1,strength:r,evidence:`runtime-boundary:${s}`,callsiteLine:e.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Qn(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t),a.set(t.fromSymbol,i)}let r=[{symbol:e,path:[]}],o=new Set([e]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&n.has(t.symbol))return t.path;for(let i of(a.get(t.symbol)??[]).sort(X))o.has(i.toSymbol)||(o.add(i.toSymbol),r.push({symbol:i.toSymbol,path:[...t.path,i]}))}return[]}function Vn(e,n,s,a){let r=q(e),o=new Set([s,...a].flatMap(t=>[...ue(t),...t.keyAnchors.map(i=>i.symbol)]));for(let t of n){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(i=>i.fromSymbol===t.fromSymbol&&i.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function Zn(e,n,s,a,r,o,t,i){let d=s.filter(c=>!c.root.symbol.startsWith(ke)).map(c=>({root:c.root,relations:c.relations.filter(m=>m.depth===1&&m.fromSymbol===c.root.symbol)}));return Jn(d).flatMap((c,m)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,ye])=>ye-w||et(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,gn);if(y.length===0)return[];let b=n.callerFileMap(y,{semantic:i,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(nt).slice(0,Sn),M=n.calleeMap(S,{additive:!1,semantic:i}),f=new Set(y.map(p=>p.symbol)),C=q(S.flatMap(p=>ve(e,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let P=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),I=C.filter(p=>P.has(p.fromSymbol));if(P.size<2||I.length===0)return[];let E=[...new Set(I.map(p=>p.toSymbol))].map(p=>Me(p,a,r,t)).filter(p=>p!==null).sort(R),B=[...P].map(p=>Me(p,a,r,t)).filter(p=>p!==null),F=tt(B,I),K=F.slice(0,Pe),ie=F.slice(Pe);if(E.length===0||K.length===0)return[];let L=[...new Set([...E.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),k=ot(I,K);return[{id:`effect-owner-set:${m+1}:${me(E[0])}`,kind:"shared-callee-owners",roots:E,keyAnchors:K,candidateOwnerCount:F.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Mt(ie,Pe),upstreamEntries:[],matchedTerms:L,relations:k,relationCount:I.length,omittedRelations:Math.max(0,I.length-k.length),systemMapCommand:he(K,I,L)}]})}function Jn(e){let n=e.map((t,i)=>i),s=t=>{for(;n[t]!==t;)n[t]=n[n[t]],t=n[t];return t},a=(t,i)=>{let d=s(t),l=s(i);d!==l&&(n[l]=d)},r=e.map(t=>new Set(t.relations.map(i=>i.toSymbol)));for(let t=0;t<e.length;t+=1)for(let i=t+1;i<e.length;i+=1){let d=0;for(let l of r[t]??[])if((r[i]??new Set).has(l)&&(d+=1),d>=2)break;d>=2&&a(t,i)}let o=new Map;for(let t=0;t<e.length;t+=1){let i=s(t),d=o.get(i)??[];d.push(e[t]),o.set(i,d)}return[...o.values()].filter(t=>t.length>=2)}function et(e,n,s,a,r){let o=Me(e,s,a,r),t=Me(n,s,a,r);return o?t?R(o,t):-1:t?1:e.localeCompare(n)}function nt(e,n){return x(U(e.relativePath))-x(U(n.relativePath))||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine}function Me(e,n,s,a){let r=n.get(e);if(r)return Se(r,s);let o=a.get(e);return o?dn(o):null}function tt(e,n){let s=new Map;for(let r of n){let o=s.get(r.toSymbol)??new Set;o.add(r.fromSymbol),s.set(r.toSymbol,o)}let a=new Map;for(let r of n){let o=s.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...e].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function ot(e,n){let s=new Map(n.map((t,i)=>[t.symbol,i])),a=n.map(t=>e.filter(i=>i.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let i=t[o];if(i&&r.push(i),r.length>=J)break}o+=1}return r.sort((t,i)=>s.get(t.fromSymbol)-s.get(i.fromSymbol)||X(t,i))}function rt(e,n,s,a){let r=new Map(n.map((i,d)=>[i.symbol,d])),o=new Map;for(let i of e)o.set(i.fromSymbol,(o.get(i.fromSymbol)??0)+1);return[...e].sort((i,d)=>{let l=c=>{let m=0;return r.has(c.fromSymbol)&&(m+=100),s.has(c.toSymbol)&&(m+=60),m+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(m+=25),c.fromFile!==c.toFile&&(m+=15),c.strength==="exact"&&(m+=5),m};return l(d)-l(i)||X(i,d)}).slice(0,J).sort((i,d)=>(r.get(i.fromSymbol)??V)-(r.get(d.fromSymbol)??V)||i.depth-d.depth||(i.callsiteLine??Number.MAX_SAFE_INTEGER)-(d.callsiteLine??Number.MAX_SAFE_INTEGER)||X(i,d))}function dn(e){return{symbol:e.symbol,label:W(e),leaf:e.leaf,file:e.relativePath,line:e.startLine,endLine:e.endLine,kind:e.isFunctionLike?"callable":e.isTypeLike?"type":"symbol",fileKind:U(e.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function st(e,n,s){let a=[...e].sort(R),r=[],o=new Map;for(let c of n)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,i=new Set,d=c=>{if(!(!c||r.some(m=>m.symbol===c.symbol))){r.push(c);for(let m of c.matchedTerms)t.add(m);for(let m of c.symbolMatchedTerms)i.add(m)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.symbolMatchedTerms.filter(h=>!i.has(h)).length-m.symbolMatchedTerms.filter(h=>!i.has(h)).length||u.symbolPhraseLength-m.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(m.symbol)??0)||xe(m,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(m=>i.has(m)))break;d(c)}if(d(a[0]),r.length>=2){let c=it(r[0].symbol,r[1].symbol,n,s);for(let m of c?.slice(1,-1)??[]){if(r.length>=V)break;d(s.get(m))}if(r.length<V){let m=new Set(r.map(y=>y.symbol)),u=new Set(n.filter(y=>y.depth===1&&m.has(y.fromSymbol)&&m.has(y.toSymbol)).map(y=>y.fromSymbol)),h=n.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!m.has(y.toSymbol)).map(y=>({relation:y,candidate:s.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||xe(y.candidate,b.candidate))[0]?.candidate;d(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-m.matchedTerms.filter(h=>!t.has(h)).length||R(m,u))[0];if(!c||c.matchedTerms.every(m=>t.has(m)))break;d(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),m=[...s.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&n.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!m)break;d(m)}if(r.length<2){let c=r[0],m=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:at(u.symbol,c.symbol,n)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;d(m)}return r}function it(e,n,s,a){let r=new Map;for(let i of s){let d=r.get(i.fromSymbol)??new Set;d.add(i.toSymbol),r.set(i.fromSymbol,d);let l=r.get(i.toSymbol)??new Set;l.add(i.fromSymbol),r.set(i.toSymbol,l)}let o=[{path:[e],cost:0}],t=new Map([[e,0]]);for(;o.length>0;){o.sort((c,m)=>c.cost-m.cost||c.path.length-m.path.length);let{path:i,cost:d}=o.shift(),l=i.at(-1);if(l===n)return i;for(let c of r.get(l)??[]){let m=a.get(c),u=c===n?1:!m||m.matchedTerms.length===0?9:m.symbolPhraseLength>=2?1:m.identityMatchedTerms.length>=2?2:4,h=d+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...i,c],cost:h}))}}return null}function at(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t.toSymbol),a.set(t.fromSymbol,i)}let r=[[e]],o=new Set([e]);for(;r.length>0;){let t=r.shift(),i=t.at(-1);if(i===n)return t;for(let d of a.get(i)??[])o.has(d)||(o.add(d),r.push([...t,d]))}return null}function R(e,n){return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||n.identityMatchedTerms.length-e.identityMatchedTerms.length||n.matchedTerms.length-e.matchedTerms.length||n.rarity-e.rarity||se(e.kind)-se(n.kind)||x(e.fileKind)-x(n.fileKind)||e.file.localeCompare(n.file)||e.line-n.line}function xe(e,n){return n.symbolPhraseLength-e.symbolPhraseLength||n.symbolMatchedTerms.length-e.symbolMatchedTerms.length||se(e.kind)-se(n.kind)||n.symbolRarity-e.symbolRarity||R(e,n)}function ct(e,n){return n.flatMap(s=>{let a=e.filter(t=>t.matchedTerms.includes(s)).sort((t,i)=>dt(t,i,s)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=We))return r;for(let t of a)if(!r.some(i=>i.symbol===t.symbol)&&(r.push(t),r.length>=We))break;return r})}function lt(e,n,s){let a=new Set(n),r=new Map;for(let o of e){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(d=>a.has(d)))continue;let i=r.get(o.file)??[];i.push(o),r.set(o.file,i)}return[...r.entries()].map(([o,t])=>{let i=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),d=[...T(i)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...d.map(l=>s.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>x(o.fileCandidates[0].fileKind)-x(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,Tn)).slice(0,wn)}function dt(e,n,s){return nn(e,s)-nn(n,s)||x(e.fileKind)-x(n.fileKind)||n.symbolPhraseLength-e.symbolPhraseLength||se(e.kind)-se(n.kind)||R(e,n)}function nn(e,n){let s=e.matches.find(a=>a.term===n)?.sources??[];return Math.min(...s.map(Ee),Number.MAX_SAFE_INTEGER)}function re(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function Z(e,n,s){let a=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms));return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||sn(e.kind)-sn(n.kind)||on(e)-on(n)||rn(e)-rn(n)||(e.kind==="parallel-paths"&&n.kind==="parallel-paths"?(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(n.parallelOrchestrationSides??0)-(e.parallelOrchestrationSides??0)||(n.parallelSharedPathTerms?.length??0)-(e.parallelSharedPathTerms?.length??0):0)||tn(n,s)-tn(e,s)||n.matchedTerms.length-e.matchedTerms.length||Math.max(...n.roots.map(o=>o.symbolPhraseLength))-Math.max(...e.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(e.roots[0],n.roots[0])||n.roots.length-e.roots.length||e.relationCount-n.relationCount||e.id.localeCompare(n.id)}function tn(e,n){return e.matchedTerms.reduce((s,a)=>s+1/Math.max(1,n.get(a)??1),0)}function mt(e){return[...new Set(e.roots.flatMap(n=>n.queryPathMatches??[]))].sort()}function on(e){let n=e.keyAnchors.length>0?e.keyAnchors:e.roots;return Math.max(...n.map(s=>x(s.fileKind)))}function rn(e){return e.kind==="parallel-paths"?2-(e.parallelConnectedSides??0):e.kind!=="connected-flow"||e.relationCount>0?0:1}function ut(e,n,s){let a=e.slice(0,n);if(n<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=e.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(ue(o)),i=r.map(l=>({group:l,overlap:ht(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:m,overlap:u})=>u-c||Z(l,m,s))[0]?.group;if(!i)continue;let d=a.length-1;for(;d>=0&&a[d]===o;)d-=1;return d<0?a:(a[d]=i,[...a].sort((l,c)=>Z(l,c,s)))}return a}function ht(e,n){return ue(e).filter(s=>n.has(s)).length}function sn(e){switch(e){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(e,n){return e.depth-n.depth||j(n.strength)-j(e.strength)||e.fromLabel.localeCompare(n.fromLabel)||e.toLabel.localeCompare(n.toLabel)||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)}function yt(e,n){return j(Fe(n.source))-j(Fe(e.source))||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)||e.symbol.localeCompare(n.symbol)}function q(e){let n=new Map;for(let s of e){let a=`${s.fromSymbol}\0${s.toSymbol}`,r=n.get(a);(!r||X(s,r)<0)&&n.set(a,s)}return[...n.values()]}function De(e){return e.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function ft(e){let n=e.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(n.map(s=>s.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function pt(e,n){let s=e.replace(/\\/gu,"/").toLocaleLowerCase();return n.filter(a=>{let r=s.indexOf(a);if(r<0)return!1;let o=r===0?"/":s[r-1],t=s[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function bt(e,n){let s=De(e).map(_e),a=0;for(let r=0;r<s.length;r+=1)for(let o=0;o<n.length;o+=1){let t=0;for(;r+t<s.length&&o+t<n.length&&s[r+t]===n[o+t];)t+=1;a=Math.max(a,t)}return a}function T(e){return new Set(De(e).flatMap(mn).filter(n=>n.length>=3))}function mn(e){let n=_e(e);return n.length>4&&n.endsWith("e")?[n,n.slice(0,-1)]:[n]}function _e(e){let n=e.toLocaleLowerCase();return n.length>5&&n.endsWith("ies")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ied")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ed")?an(n.slice(0,-2)):n.length>5&&n.endsWith("ing")?an(n.slice(0,-3)):n.length>4&&n.endsWith("ers")||n.length>3&&n.endsWith("s")&&!n.endsWith("ss")?n.slice(0,-1):n}function an(e){if(e.length<2)return e;let n=e.at(-1),s=e.at(-2);return n===s&&!"aeiou".includes(n)?e.slice(0,-1):e}function cn(e){if(e.length===0)return[];let n=e.split(`
|
|
3
|
+
`);return e.endsWith(`
|
|
4
|
+
`)&&n.pop(),n}function gt(e,n){return Ee(e)-Ee(n)}function Ee(e){switch(e){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(e){return e==="callable"?0:e==="type"?1:2}function x(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function Fe(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function j(e){return e==="exact"?2:1}function un(e,n){return e.file.localeCompare(n.file)||e.line-n.line}function me(e){return`${e.file}:${e.line+1}`}function he(e,n=[],s=[]){let a=e.map(t=>`--symbol ${Le(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(e.map(t=>t.symbol)),o=e.flatMap(t=>(t.sourceCharacters??0)>ze?St(t,n,s,r).map(i=>`--focus-at ${Le(`${i.file}:${i.line+1}`)}`):[]);return`codebaseiq system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function St(e,n,s,a){let r=new Set(s),o=n.filter(l=>l.fromSymbol===e.symbol&&l.callsiteLine!==null&&l.callsiteLine>=e.line&&l.callsiteLine<=e.endLine).map(l=>({file:e.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(De(vt(l.toLabel)).flatMap(mn).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),i=[...t.length>0?t:o,...t.length>0?[]:e.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],d=[];for(let l of i)if(!d.some(c=>c.file===l.file&&c.line===l.line)&&(d.push({file:l.file,line:l.line}),d.length>=3))break;return d}function vt(e){return e.slice(Math.max(e.lastIndexOf(":"),e.lastIndexOf("."))+1)}function At(e,n){let s=new Map;for(let[o,t]of e.matches)for(let i of t.locations.values()){if(i.file!==e.definition.relativePath||i.line<e.definition.startLine||i.line>e.definition.endLine)continue;let d=`${i.file}\0${i.line}`,l=s.get(d)??{...i,matchedTerms:new Set};l.matchedTerms.add(o),s.set(d,l)}let a=[...s.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)-[...o.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)||un(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Mt(e,n){let s=[];for(let a=0;a<e.length;a+=n)s.push(he(e.slice(a,a+n)));return s}function Le(e){return`'${e.replaceAll("'",`'"'"'`)}'`}export{Nt as a,Pn as b};
|
|
5
|
+
//# sourceMappingURL=chunk-ENCCHKM6.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as Q,b as ee,c as ne}from"./chunk-CQP3THUZ.js";import{a as Z}from"./chunk-ICFDQHAM.js";import{c as Y}from"./chunk-MVB3DAEY.js";import{a as X,b as z,c as W}from"./chunk-Y6KHROC3.js";import{a as J,d as w}from"./chunk-PTAWHLVJ.js";import{a as K}from"./chunk-GTXSJDCO.js";import{a as H,d as V}from"./chunk-JEJLSICM.js";import{h as G}from"./chunk-FQKZWM4L.js";import{a as x}from"./chunk-TIIC3ZE7.js";import{p as q}from"./chunk-O6QTXQPJ.js";import{v as U}from"./chunk-BMYOV5GP.js";import{createHash as ue}from"crypto";var le=6,ve=12,be=48,Ce=2e4,te=12,L=Number.MAX_SAFE_INTEGER,ye=["definition","callers","callees"],_={search:12,"exact-source":24,definition:24,caller:8,callee:8,"production-reference":6,"test-reference":2,dependency:6,consumer:6};function tn(e,t){if(t.cursor)throw new Error("Inspect no longer accepts semantic packet cursors. Run the original inspect selectors again.");let n=xe(t),r=we(e,n),i=r.candidates.sort((c,p)=>M(c,p));n.view==="behavior"&&Pe(e,i),Re(e,i),n.view==="behavior"&&Ee(e,i);let o=Q(i.map(c=>O(c,n.view)),n.evidenceBudgets,(c,p)=>M(c.candidate,p.candidate)),{selected:u,omitted:a}=ee(o.selected,n.maxUnits,n.maxCharacters,(c,p)=>M(c.candidate,p.candidate),n.view==="source"),d=u.map(c=>c.candidate),s=[...o.omitted,...a].map(c=>c.candidate),l=d.map(Ae),m=z(d.map(c=>c.kind==="source"?c.bindingClosure:void 0),d.filter(c=>c.kind==="source").map(c=>({relativePath:c.relativePath,startLine:c.startLine,endLine:c.endLine}))),h=l.reduce((c,p)=>c+(p.kind==="source"?qe(p.source):0),0),g=l.reduce((c,p)=>c+(p.kind==="source"?p.source.length:0),0),y=l.reduce((c,p)=>c+he(p,n.view),0),v=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).map(De),b=i.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,fe=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,P=r.searches.map(c=>Me(c,i,d)),ge=Fe(s),N=r.locations.every(c=>c.matched)&&r.evidence.every(c=>c.kind==="matched")&&r.searches.every(c=>Te(c.textCoverage))&&s.every(c=>!c.roles.some(p=>p==="location"||p==="definition")),A=P.reduce((c,p)=>c+p.omittedMatches,0),R=s.length===0&&A===0,$=R?void 0:me(n,!0),D=$e(n,s),Se=Le(R,N,s.length+A,D,P,$),j=i.filter(c=>n.view==="behavior"&&c.kind==="source"&&c.roles.some(p=>p==="location"||p==="definition"||p==="search")).map(c=>({id:`inspect:${c.relativePath}:${c.startLine}-${c.endLine}`,label:c.ownerShort??`${c.relativePath}:${c.startLine+1}`,file:c.relativePath,startLine:c.startLine,endLine:c.endLine})),B=j.length>0?Y(e,j):void 0;return{searches:P,evidence:r.evidence,locations:r.locations,slices:v,candidateSlices:b,omittedSlices:b-fe,maxSlices:b,maxTotalLines:h,units:l,candidateUnits:i.length,omittedUnits:s.length,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,returnedLines:h,returnedCharacters:g,returnedViewCharacters:y,view:n.view,omissionGroups:D,packetCoverage:{mode:R?"complete":"bounded",candidateUnits:i.length,returnedUnits:l.length,omittedUnits:s.length,omittedByRole:ge,exactSelectorsComplete:N,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,channels:Oe(i,d,n.evidenceBudgets,n.view),...$?{expansionCommand:$}:{}},stoppingSummary:Se,...B&&B.candidateAnchors>0?{causalFrontier:B}:{},bindingClosure:m,continuation:null}}function Le(e,t,n,r,i,o){let u=f([...r.map(a=>a.drillCommand),...i.flatMap(a=>a.exactFollowup?[a.exactFollowup]:[]),...o?[o]:[]]);return e&&t?{queryStatus:"selection-complete",status:"stop-ready",openEvidence:0,guidance:"All evidence requested by this inspect query was materialized.",drillCommands:[]}:t?{queryStatus:"frontier-accounted",status:"relevance-check-required",openEvidence:n,guidance:"Withheld evidence is accounted for by recoverable groups; drill the groups relevant to the current decision.",drillCommands:u}:{queryStatus:"coverage-incomplete",status:"exact-evidence-withheld",openEvidence:n,guidance:"A requested identity, exact source unit, or current-text coverage requirement is unresolved; drill before relying on it.",drillCommands:u}}function xe(e){let t=F(e.searches),n=F(e.symbols),r=F(e.locations),i=t.length+n.length+r.length;if(i===0)throw new Error("inspect requires at least one --search, --symbol, or --at selector.");if(i>24)throw new RangeError(`inspect accepts at most ${24} selectors; received ${i}.`);let o=e.evidence??{};if(e.unitLines!==void 0&&C(e.unitLines,"unitLines"),e.totalLines!==void 0&&C(e.totalLines,"totalLines"),e.sliceLimit!==void 0&&C(e.sliceLimit,"sliceLimit"),e.maxCharacters!==void 0&&C(e.maxCharacters,"maxCharacters"),e.maxUnits!==void 0&&C(e.maxUnits,"maxUnits"),e.view!==void 0&&e.view!=="source"&&e.view!=="behavior")throw new Error(`Unknown inspect view: ${String(e.view)}. Use source or behavior.`);if(e.full&&(e.searchLimit!==void 0||e.maxUnits!==void 0||e.maxCharacters!==void 0||e.evidenceBudgets!==void 0))throw new Error("full inspect cannot be combined with searchLimit, maxUnits, maxCharacters, or evidenceBudgets.");let u=e.full??!1;return{searches:t,symbols:n,locations:r,...e.scope?.trim()?{scope:e.scope.trim()}:{},context:ae(e.context??le,"context"),searchLimit:C(e.searchLimit??(u?L:ve),"searchLimit"),maxUnits:C(u?L:e.maxUnits??be,"maxUnits"),maxCharacters:C(u?L:e.maxCharacters??Ce,"maxCharacters"),evidenceBudgets:u?Ue():Ie(e.evidenceBudgets??_),view:e.view??"source",evidence:{...o.parts?{parts:[...o.parts]}:n.length>0?{parts:[...ye]}:{},...o.referenceContext!==void 0?{referenceContext:ae(o.referenceContext,"referenceContext")}:{},relatedSourceLines:o.relatedSourceLines??60,...o.semantic!==void 0?{semantic:o.semantic}:{}}}}function Ie(e){let t={..._};for(let[n,r]of Object.entries(e)){if(!(n in t))throw new Error(`Unknown inspect evidence channel: ${n}.`);if(!Number.isSafeInteger(r)||(r??-1)<0)throw new RangeError(`Evidence budget ${n} must be a non-negative safe integer; received ${r}.`);t[n]=r}return t}function Ue(){return Object.fromEntries(Object.keys(_).map(e=>[e,L]))}function we(e,t){let n=[],r=0,i=t.searches.map(s=>{let l=ne(e,s,{scope:t.scope,context:0,limit:t.searchLimit,ranking:"structural"});return{pattern:s,result:l,matches:l.matches}}),o=Math.max(0,...i.map(s=>s.matches.length));for(let s=0;s<o;s+=1)for(let l of i){let m=l.matches[s];if(!m)continue;let h=w(e,m.relativePath,m.focusLine,L,t.context);h&&I(e,n,h,"search",`search:${l.pattern}`,m.ownerSymbol,m.ownerShort,1,r++)}let u=i.map(({pattern:s,result:l})=>{let m=l.omittedMatches>0?de(s,t.scope):void 0,h=l.fileCoverage??[],g=_e(s,h,t.scope);return{pattern:s,matchingLines:l.matchingLines,returnedMatches:l.matches.length,omittedMatches:l.omittedMatches,matchingFiles:h.length,returnedFiles:h.filter(y=>y.returnedMatches>0).length,omittedFiles:h.filter(y=>y.returnedMatches===0).length,candidateUnits:0,selectedUnits:0,omittedUnits:0,scopeHints:g.slice(0,te),omittedScopeHints:Math.max(0,g.length-te),textCoverage:l.textCoverage,...m?{exactFollowup:m}:{}}}),a=t.locations.map(s=>{let l=je(s),m=l?K(e,l.path):null,h=m?w(e,m,l.line-1,L,t.context):null;return h&&I(e,n,h,"location",`at:${s}`,null,null,0,r++),{target:s,matched:h!==null}}),d=t.symbols.map(s=>Z(e,s,t.evidence));for(let s of d)if(s.kind==="matched"){if(s.definition){let l=w(e,s.definition.relativePath,s.definition.startLine,L,t.context);l&&I(e,n,l,"definition",`definition:${s.shortName}`,s.symbol,s.shortName,0,r++)}for(let l of s.referenceWindows){let m=l.references[0];I(e,n,{...l,focusLine:m?.line??l.startLine,unitType:null,unitStartLine:l.startLine,unitEndLine:l.endLine,omittedLines:0},"reference",`reference:${s.shortName}`,m?.enclosingSymbol??null,m?.enclosingShort??null,x(l.relativePath)==="test"?5:4,r++,l.references.map(h=>h.line),s.symbol)}for(let l of s.callers)re(e,n,l,"caller",s,2,r++);for(let l of s.callees)re(e,n,l,"callee",s,3,r++);for(let l of s.dependencies)oe(e,n,"dependency",s.file,l.relativePath,s.symbol,t.context,6,r++);for(let l of s.consumers)oe(e,n,"consumer",l.relativePath,s.file,s.symbol,t.context,7,r++)}return{searches:u,evidence:d,locations:a,candidates:n}}function M(e,t){return e.priority-t.priority||t.roles.length-e.roles.length||t.reasons.length-e.reasons.length||ie(x(e.relativePath))-ie(x(t.relativePath))||e.sequence-t.sequence}function ie(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function O(e,t){return{candidate:e,priority:e.priority,sequence:e.sequence,relativePath:e.relativePath,fileKind:x(e.relativePath),evidenceCharacters:he(e,t),roles:e.roles,reasons:e.reasons,symbols:e.symbols,behaviorSignals:e.kind==="source"?e.behavior?.signals??[]:[],channel:T(e)}}function T(e){let t=e.roles;return t.includes("location")?"exact-source":t.includes("definition")?"definition":t.includes("caller")?"caller":t.includes("callee")?"callee":t.includes("reference")?x(e.relativePath)==="test"?"test-reference":"production-reference":t.includes("dependency")?"dependency":t.includes("consumer")?"consumer":"search"}function Ee(e,t){let n=t.filter(i=>i.kind==="source"),r=G(e,{files:f(n.map(i=>i.relativePath))});for(let i of n){i.behavior=H(e,i.relativePath,i.startLine,i.endLine,i.focusLines)??void 0;let o=r.filter(a=>a.source.file===i.relativePath&&a.source.startLine<=i.endLine&&a.source.endLine>=i.startLine),u=o.filter(a=>!ke(a,o)).map(a=>({observationId:a.id,protocol:a.protocol,action:a.action,role:a.role,strength:a.strength,resolution:a.resolution,line:a.source.startLine,endLine:a.source.endLine,keyParts:a.keyParts.map(d=>({name:d.name,value:d.value,evidence:d.evidence})),derivation:{kind:a.derivation.kind,rule:a.derivation.rule,sourceSpans:a.derivation.sourceSpans.length}}));i.runtimeFacts=u.length>0?u:void 0}}function ke(e,t){if(e.strength!=="candidate"||e.protocol!=="http")return!1;let n=e.keyParts.find(i=>i.name==="path")?.value,r=e.keyParts.find(i=>i.name==="method")?.value;return n?t.some(i=>{if(i===e||i.action!==e.action||i.role!==e.role||i.source.startLine!==e.source.startLine||i.derivation.rule!=="http.mount-prefix")return!1;let o=i.keyParts.find(a=>a.name==="path")?.value,u=i.keyParts.find(a=>a.name==="method")?.value;return!!(o&&o!==n&&o.endsWith(n)&&(!r||r===u))}):!1}function Pe(e,t){for(let n of t){if(n.kind!=="source")continue;let r=V(e,n.relativePath,n.startLine,n.endLine,n.focusLines);r.startLine===n.startLine&&r.endLine===n.endLine||(n.startLine=r.startLine,n.endLine=r.endLine,n.source=U(e,n.relativePath).slice(r.startLine,r.endLine+1).join(`
|
|
2
|
+
`),n.unitStartLine=r.startLine,n.unitEndLine=r.endLine,n.omittedLines=0)}}function Re(e,t){for(let n of t)n.kind==="source"&&(n.bindingClosure=X(e,n.relativePath,n.startLine,n.endLine))}function $e(e,t){let n=new Map;for(let r of t){let i=k(r.relativePath),o=T(r),u=[...r.roles].sort().join(","),a=r.kind==="path"?r.relationship:"",d=`${i}|${o}|${u}|${a}`,s=n.get(d)??[];s.push(r),n.set(d,s)}return[...n.entries()].map(([r,i])=>{let o=i[0],u=f(i.flatMap(d=>[...d.roles])).sort(),a=f(i.flatMap(d=>d.kind==="source"?d.behavior?.signals??[]:[])).sort();return{id:`g-${ue("sha256").update(r).digest("hex").slice(0,8)}`,scope:k(o.relativePath),channel:T(o),roles:u,behaviorSignals:a,candidateUnits:i.length,sourceCharacters:i.reduce((d,s)=>d+(s.kind==="source"?s.source.length:0),0),anchors:i.map(d=>({relativePath:d.relativePath,line:d.kind==="source"?d.focusLine:0,ownerShort:d.kind==="source"?d.ownerShort:null,roles:[...d.roles],behaviorSignals:d.kind==="source"?[...d.behavior?.signals??[]]:[]})),drillCommand:Be(e,i)}}).sort((r,i)=>i.candidateUnits-r.candidateUnits||i.sourceCharacters-r.sourceCharacters||r.scope.localeCompare(i.scope)||r.id.localeCompare(i.id))}function Be(e,t){let n=f(t.flatMap(o=>o.reasons.filter(u=>u.startsWith("search:")).map(u=>u.slice(7)))),r=k(t[0].relativePath);if(n.length>0&&t.every(o=>o.kind==="source"&&o.roles.includes("search"))){let o=["codebaseiq inspect"];for(let u of n)o.push(`--search ${S(u)}`);return o.push(`--scope ${S(r)}`,"--full"),e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}let i=t.filter(o=>o.kind==="source");if(i.length>0&&i.length<=24){let o=["codebaseiq inspect"];for(let u of i)o.push(`--at ${S(`${u.relativePath}:${u.focusLine+1}`)}`);return e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}return t.length===1&&t[0].kind==="path"?t[0].exactFollowup:me(e,!0)}function Me(e,t,n){let r=`search:${e.pattern}`,i=t.filter(a=>a.reasons.includes(r)).length,o=new Set(n),u=t.filter(a=>a.reasons.includes(r)&&o.has(a)).length;return{...e,candidateUnits:i,selectedUnits:u,omittedUnits:i-u}}function Fe(e){let t={};for(let n of e)for(let r of n.roles)t[r]=(t[r]??0)+1;return t}function Oe(e,t,n,r){let i=e.map(u=>O(u,r).channel),o=t.map(u=>O(u,r).channel);return Object.fromEntries(Object.keys(n).map(u=>{let a=i.filter(s=>s===u).length,d=o.filter(s=>s===u).length;return[u,{candidateUnits:a,returnedUnits:d,omittedUnits:a-d,maxUnits:n[u]}]}))}function Te(e){return!!(e&&e.skippedUnreadablePaths.length===0&&e.skippedOversizedPaths.length===0)}function _e(e,t,n){let r=new Map;for(let i of t){let o=k(i.relativePath),u=r.get(o)??{matchingLines:0,returnedMatches:0};u.matchingLines+=i.matchingLines,u.returnedMatches+=i.returnedMatches,r.set(o,u)}return[...r.entries()].map(([i,o])=>({scope:i,...o,exactFollowup:de(e,i||n)})).sort((i,o)=>o.matchingLines-i.matchingLines||o.returnedMatches-i.returnedMatches||i.scope.localeCompare(o.scope))}function k(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}function de(e,t){return`codebaseiq inspect --search ${S(e)}${t?` --scope ${S(t)}`:""} --full`}function me(e,t){let n=["codebaseiq inspect"];for(let r of e.searches)n.push(`--search ${S(r)}`);for(let r of e.symbols)n.push(`--symbol ${S(r)}`);for(let r of e.locations)n.push(`--at ${S(r)}`);return e.scope&&n.push(`--scope ${S(e.scope)}`),e.context!==le&&n.push(`--context ${e.context}`),e.evidence.parts&&n.push(`--include ${S(e.evidence.parts.join(","))}`),t&&n.push("--full"),e.view==="behavior"&&n.push("--view behavior"),n.join(" ")}function re(e,t,n,r,i,o,u){I(e,t,{...n,unitType:null,unitStartLine:n.startLine,unitEndLine:n.endLine+n.omittedLines},r,`${r}:${i.shortName}`,n.symbol,n.shortName,o,u,[n.focusLine],i.symbol)}function oe(e,t,n,r,i,o,u,a,d){let s=`${r} -> ${i}`,l=q(e,r).filter(b=>b.sourcePath===i),m=U(e,r),h=Ne(m,l,i),g=h===null?null:J(e,r,h,Math.min(u,4));if(g){I(e,t,{...g,unitType:null,unitStartLine:g.startLine,unitEndLine:g.endLine,omittedLines:0},n,`${n}:${s}`,null,null,a,d,[g.focusLine],o);return}let y=`codebaseiq inspect --search ${S(pe(i))} --scope ${S(r)}`,v=t.find(b=>b.kind==="path"&&b.relativePath===r&&b.relationship===s);if(v){v.roles=f([...v.roles,n]),v.reasons=f([...v.reasons,`${n}:${s}`]),v.symbols=f([...v.symbols,o]),v.priority=Math.min(v.priority,a);return}t.push({kind:"path",roles:[n],relativePath:r,relationship:s,reasons:[`${n}:${s}`],symbols:[o],exactFollowup:y,priority:a,sequence:d})}function Ne(e,t,n){let r=f(t.flatMap(d=>[d.importedName,d.localName??""]).filter(d=>d.length>1)),i=pe(n).replace(/\.[^.]+$/u,""),o=f([...r,i]).filter(Boolean),u=/\b(?:from|import|include|require|use)\b/u,a=e.findIndex(d=>u.test(d)&&o.some(s=>d.includes(s)));return a>=0?a:null}function I(e,t,n,r,i,o,u,a,d,s=[n.focusLine],l){let m=t.find(h=>h.kind==="source"&&h.relativePath===n.relativePath&&h.startLine<=n.endLine&&n.startLine<=h.endLine);if(m){let h=Math.min(m.startLine,n.startLine),g=Math.max(m.endLine,n.endLine);m.startLine=h,m.endLine=g,m.source=U(e,n.relativePath).slice(h,g+1).join(`
|
|
3
|
+
`),m.focusLine=Math.min(m.focusLine,n.focusLine),m.focusLines=ce([...m.focusLines,...s]),m.unitStartLine=Math.min(m.unitStartLine,n.unitStartLine),m.unitEndLine=Math.max(m.unitEndLine,n.unitEndLine),m.omittedLines=Math.max(m.omittedLines,n.omittedLines),m.reasons=f([...m.reasons,i]),m.roles=f([...m.roles,r]),m.symbols=f([...m.symbols,...l?[l]:[]]),!m.ownerSymbol&&o&&(m.ownerSymbol=o),!m.ownerShort&&u&&(m.ownerShort=u),m.priority=Math.min(m.priority,a);return}t.push({kind:"source",...n,reasons:[i],focusLines:ce(s),ownerSymbol:o,ownerShort:u,roles:[r],symbols:l?[l]:[],priority:a,sequence:d})}function Ae(e){if(e.kind==="path"){let{priority:o,sequence:u,...a}=e;return{...a,id:se(a)}}let{priority:t,sequence:n,bindingClosure:r,...i}=e;return{...i,id:se(i),omittedCharacters:0}}function De(e){let{kind:t,id:n,roles:r,symbols:i,omittedCharacters:o,behavior:u,runtimeFacts:a,...d}=e;return d}function se(e){return ue("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}function je(e){let t=e.match(/^(.+\.\w+):(\d+)$/u);if(!t)return null;let n=Number(t[2]);return Number.isSafeInteger(n)&&n>0?{path:t[1],line:n}:null}function F(e){return f((e??[]).map(t=>t.trim()).filter(Boolean))}function f(e){return[...new Set(e)]}function ce(e){return f(e).sort((t,n)=>t-n)}function qe(e){return e.length===0?0:e.split(`
|
|
4
|
+
`).length}function he(e,t){if(e.kind==="path")return e.relationship.length+e.exactFollowup.length;let n="bindingClosure"in e?W(e.bindingClosure):0,r=(e.runtimeFacts??[]).reduce((i,o)=>i+o.action.length+o.derivation.rule.length+o.keyParts.reduce((u,a)=>u+a.name.length+a.value.length+4,0)+24,0);return t!=="behavior"?e.source.length+n:e.behavior?e.behavior.lines.reduce((i,o)=>i+o.text.length+o.signals.join(",").length+12,0)+e.behavior.testCases.reduce((i,o)=>i+o.length+2,0)+r+n:e.source.length+n+r}function pe(e){return e.split("/").at(-1)??e}function S(e){return`'${e.replaceAll("'","'\\''")}'`}function C(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new RangeError(`${t} must be a positive safe integer; received ${e}`);return e}function ae(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer; received ${e}`);return e}export{tn as a};
|
|
5
|
+
//# sourceMappingURL=chunk-EZNMUY67.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{S as U,T as H,U as pe,W as de,X as B,_ as me,ga as P,ha as ye,l as ae,m as le,o as _,u as fe}from"./chunk-RU65DDUP.js";import{a as ce,e as O}from"./chunk-3IER7Q6H.js";import{d as E,e as ue}from"./chunk-DRENNWRG.js";import{a as A,i as x}from"./chunk-R2NOK63J.js";import{$ as se,ca as K,h as re}from"./chunk-WE5RZHZ7.js";import{existsSync as j}from"fs";import b from"path";var z=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function V(r,t){let e=t?b.dirname(b.join(r,t)):r,o=b.resolve(r);for(;e.startsWith(o);){for(let s of z){let c=b.join(e,s);if(j(c))return c}let i=b.dirname(e);if(i===e)break;e=i}for(let i of z){let s=b.join(r,i);if(j(s))return s}return null}function ge(r){let t=r.config.projectRoot,n=new Set(Ee(t,r.config.semantic?.typescript?.tsconfigs)),e=O(r,{includeIgnored:!1,extensions:U});for(let o of e){let i=V(t,o);i&&n.add(b.resolve(i))}if(n.size===0){let o=V(t);o&&n.add(b.resolve(o))}return[...n].filter(o=>!he(t,o)).sort((o,i)=>o.localeCompare(i))}function Ee(r,t=[]){let n=new Set;for(let e of t){let o=b.isAbsolute(e)?e:b.join(r,e);j(o)&&n.add(b.resolve(o))}for(let e of je(r))for(let o of z){let i=b.join(e,o);j(i)&&n.add(b.resolve(i))}if(n.size===0){let e=V(r);e&&n.add(b.resolve(e))}return[...n].filter(e=>!he(r,e)).sort((e,o)=>e.localeCompare(o))}function je(r){let t=b.join(r,"package.json");if(!j(t))return[];let n;try{n=JSON.parse(re(t,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(o=>le(r,o))}function he(r,t){let n=b.relative(r,t).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as u}from"perf_hooks";function k(r,t,n){if(r.has(t))return r.get(t);let e=n();return r.set(t,e),e}import Ie from"path";import{realpathSync as Se}from"fs";function Ae(r,t){return r.getReferences().map(n=>{let e=n.getNode();return $(e,t)})}function Oe(r){let t=r;return typeof t.findReferences=="function"?t.findReferences():[]}function Me(r,t,n,e){let o=[];for(let i of Oe(r))for(let s of Ae(i,e))s.file===t.relativePath&&s.line>=t.startLine&&s.line<=t.endLine||o.push(s);for(let i of n)o.push(i);return L(o)}function Fe(r,t,n,e){let o=[],i=n?.getStart();for(let s of r.getReferences()){let c=s.getNode();w(e,c.getSourceFile().getFilePath())===t&&(i!==void 0&&c.getStart()===i||o.push({location:$(c,e),node:c}))}return o}function $(r,t){let n=r.getSourceFile(),e=n.getLineAndColumnAtPos(r.getStart());return{file:w(t,n.getFilePath())??n.getBaseName(),line:e.line-1,column:e.column-1}}function q(r,t,n){let e=r.getSourceFile(),o=G(e,r),i=r.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),c=e.getFullText().split(`
|
|
2
|
+
`),a=[];for(let l=0;l<c.length;l++){if(l===o)continue;let f=c[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)a.push({file:t,line:l,column:p.index})}return L(a.filter(l=>w(n,Ie.join(n,l.file))===t))}function Y(r){for(let t=r;t;t=t.getParent()){let n=t.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function G(r,t){return r.getLineAndColumnAtPos(t.getStart()).line-1}function L(r){let t=new Set,n=[];for(let e of r){let o=`${e.file}:${e.line}:${e.column}`;t.has(o)||(t.add(o),n.push(e))}return n}function w(r,t){let n=r||process.cwd(),e=be(n,t);if(e)return e;try{return be(Se(n),Se(t))}catch{return null}}function be(r,t){let n=Ie.relative(r,t).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function xe(r,t,n,e){let o=Ue(t,e);return o.size===0?new Map:He(r,n,o)}function Ue(r,t){let n=new Map;for(let e of P(r,t)){let o=E(e.symbol)??e.leaf;if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(e)}return n}function He(r,t,n){let e=new Map,o=new Map;return t.forEachDescendant(i=>{for(let s of Be(r,i)){let c=n.get(s);if(!c)continue;let a=G(t,i);for(let l of c){if(a<l.startLine-1||a>l.endLine+1)continue;let f=Math.abs(a-l.startLine),p=o.get(l.symbolId);p!==void 0&&p<=f||(o.set(l.symbolId,f),e.set(l.symbolId,i))}}}),e}function Be(r,t){let n=[],e=o=>{o&&!n.includes(o)&&n.push(o)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let o=t.getNameNode();e(o?.getText())}if("getName"in t&&typeof t.getName=="function"){let o=t.getName();e(o)}return r.Node.isIdentifier(t)&&e(t.getText()),n}var $e=ce("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(r,t,n,e){let o=Q(r,t),i=J(o.get(e)??[],n);if(i)return i;let s=[];for(let c of o.values())for(let a of c)((a.leaf||E(a.symbol)||"").includes(e)||a.symbol.includes(e))&&s.push(a);return J(s,n)}function X(r,t,n,e){return J(Q(r,t).get(e)??[],n)}function Te(r,t){let n=new Map;for(let[e,o]of Q(r,t)){let i=o[0];i&&n.set(e,i)}return n}function Q(r,t){return $e.get(r,t,()=>{let n=new Map;for(let e of P(r,t)){let o=e.leaf||E(e.symbol);if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push({...e,leaf:o})}for(let e of n.values())e.sort((o,i)=>o.startLine-i.startLine||o.endLine-i.endLine||o.symbolId-i.symbolId);return n})}function J(r,t){let n=null,e=Number.POSITIVE_INFINITY;for(let o of r){let i=Math.abs(o.startLine-t);(i<e||i===e&&n&&o.startLine<n.startLine)&&(n=o,e=i)}return n}import We from"path";import{realpathSync as Ke}from"fs";function De(r,t){let n=new Map,e=null,o=null,i=()=>(o??=O(r,{extensions:U}),o),s=()=>(e??=x("typescript.source-file-index",()=>_e(r.config.projectRoot,t,i()),()=>({projects:t.length,indexedDocuments:i().length})),e),c=a=>H(a)?k(n,a,()=>{let l=Ce(r.config.projectRoot,a);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&Z(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:a=>c(a)?.sourceFile??null,sourceFileMatch:c,indexedTypeScriptLikeDocuments:i}}function _e(r,t,n){let e=t.map(({project:o})=>{let i=new Map;for(let s of o.getSourceFiles())Z(i,s);return{project:o,sourceFiles:i}});for(let o of n){let i=Ce(r,o);if(i)for(let s of e){if(s.sourceFiles.has(i))break;let c=s.project.addSourceFileAtPathIfExists(i)??null;if(c){Z(s.sourceFiles,c);break}}}return e}function Z(r,t){let n=ee(t.getFilePath());r.set(n,t);try{r.set(ee(Ke(n)),t)}catch(e){if(!K(e))throw e}}function Ce(r,t){try{return ee(se(r,t,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function ee(r){return We.resolve(r)}function te(r,t){for(let n of r)if(t===n.name||t.startsWith(`${n.name}/`))return n.name;return null}function Ne(r){let t=`${r.relativeDir}/src`;return[`${t}/index.ts`,`${t}/index.tsx`,`${t}/index.mts`,`${t}/index.cts`]}function ne(r,t){try{return r()}catch{t?.();return}}var ze=32;function Yt(r,t){let n=x("typescript.provider.load",()=>pe());if(!n)return B("ts-morph is not installed");let e=x("typescript.provider.tsconfig-discovery",()=>ge(r));if(e.length===0)return B("no tsconfig found");try{let o=x("typescript.provider.project-bundles",()=>de(n,e),()=>({tsconfigs:e.length}));return Ve(r,n,o)}catch(o){return B(o instanceof Error?o.message:String(o),e[0],e)}}function Ve(r,t,n,e={}){return x("typescript.provider.construct",()=>new oe(r,t,n),()=>({tsconfigs:n.length,reusedProjects:e.reusedProjects===!0}))}var oe=class{constructor(t,n,e){this.db=t;this.tsMorph=n;this.projects=e;this.workspacePackages=ae(t.config.projectRoot),this.sourceFiles=De(t,e)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return k(this.importUsageCache,t,()=>{let n=this.sourceFiles.sourceFile(t);if(!n)return[];let e=Ye();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,n,e),()=>({file:t,...e}))})}referencesFor(t){return k(this.referencesCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,n)})}referencesForDefinitions(t,n={}){let e=new Map,o=A(),i=[];for(let f of t){let p=this.referencesCache.get(f.symbolId);p?e.set(f.symbolId,p):i.push(f)}if(i.length===0)return e;let s=i,c=n.exact?[]:i.filter(f=>!ve(f));if(c.length>=ze){let f=this.referencesForDefinitionsBySymbolScan(c);if(f.incompleteFiles.size===0)for(let p of c){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}if(s=i.filter(p=>ve(p)),s.length===0)return e}let a=new Map;for(let f of s){let p=a.get(f.relativePath);p?p.push(f):a.set(f.relativePath,[f])}let l=[];for(let[f,p]of a){let d=Pe();x("typescript.references-map.file",()=>{let h=this.definitionNodesForFile(f);for(let m of p){o&&(d.cacheMisses+=1);let I=h.get(m.symbolId)??null;o&&(I?d.nodeHits+=1:d.nodeMisses+=1);try{let g=this.referencesForDefinitionNode(m,I,o?d:void 0);this.referencesCache.set(m.symbolId,g),e.set(m.symbolId,g)}catch{d.preciseSearchFailures+=1,l.push(m)}}},()=>({relativePath:f,definitions:p.length,...Le(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);if(f.incompleteFiles.size===0)for(let p of l){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}}return e}referenceFragmentsForFiles(t){let n=ye(this.db).filter(s=>H(s.relativePath)),e=t.filter(s=>this.sourceFiles.sourceFile(s)!==null),o=this.referencesForDefinitionsBySymbolScan(n,e),i=e.filter(s=>!o.incompleteFiles.has(s));return me(n,o.references,i)}referencesForDefinitionsBySymbolScan(t,n){let e=A(),o=Pe(),i=new Map,s=new Set,c=new Set(t.map(l=>l.symbolId)),a=new Map(t.map(l=>[l.symbolId,l]));for(let l of t)i.set(l.symbolId,[]);return x("typescript.references-map.inverted-scan",()=>{let l=e?u.now():0,f=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let y of t){let S=f.get(y.symbolId)??[];if(S.length>0){let T=i.get(y.symbolId)??[];T.push(...S),i.set(y.symbolId,T)}e&&(o.packageReferenceCount+=S.length)}e&&(o.packageRefsMs+=u.now()-l);let p=new Map,d=new Map,h=this.hierarchyTargetsForDefinitions(t),m=new Set(t.map(y=>y.leaf).filter(Boolean)),I=e?u.now():0;for(let y of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(y))continue;let S=this.sourceFiles.sourceFile(y);if(!S)continue;e&&(o.scanFiles+=1),this.addReferencesFromSourceFileScan(S,y,c,a,h,m,p,d,i,e?o:void 0)||s.add(y)}e&&(o.scanMs+=u.now()-I);let g=e?u.now():0;this.addHierarchyMemberReferences(t,i,e?o:void 0),e&&(o.hierarchyMs+=u.now()-g);for(let[y,S]of i){let T=L(S);i.set(y,T),e&&(o.referenceCount+=T.length)}},()=>({definitions:t.length,...Le(o)})),{references:i,incompleteFiles:s}}addReferencesFromSourceFileScan(t,n,e,o,i,s,c,a,l,f){let p=this.compilerCheckerForSourceFile(t),d=t.compilerNode,h=Xe(t),m=!0,I=g=>{if(this.tsMorph.ts.isIdentifier(g)){if(f&&(f.identifiers+=1),!s.has(g.text)&&!h.has(g.text)){this.tsMorph.ts.forEachChild(g,I);return}let y=this.compilerReferenceSymbol(p,g,f,()=>{m=!1});if(y){let S;c.has(y)?S=c.get(y)??null:(S=this.referenceDefinitionFromCompilerSymbol(y),c.set(y,S)),f&&(S?f.targetHits+=1:f.targetMisses+=1);let T=k(a,y,()=>this.compilerSymbolKeys(y)),R=null,D=null,v=S&&e.has(S.symbolId)?o.get(S.symbolId):void 0;if(v&&(R=W(d,g),!Re(v,n,R))){let N=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:N.line,column:N.character};let C=l.get(v.symbolId)??[];C.push(D),l.set(v.symbolId,C),f&&(f.requestedHits+=1)}for(let N of T)for(let C of i.get(N)?.values()??[]){if(R??=W(d,g),Re(C,n,R))continue;if(!D){let F=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:F.line,column:F.character}}let M=l.get(C.symbolId)??[];M.push(D),l.set(C.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(g,I)};return I(d),m}hierarchyTargetsForDefinitions(t){let n=new Map;for(let e of t){let o=this.nodeForDefinition(e),i=o?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let c=this.compilerCheckerForSourceFile(o.getSourceFile()),a=c.getSymbolAtLocation(i.name);if(a)for(let l of this.hierarchyMemberSymbols(c,s,a))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(e.symbolId,e),n.set(f,p)}}return n}hierarchyMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(!i.has(c)){i.add(c),o.add(a);for(let f of l){let p=f.getProperty(e.name);p&&s(f,p,this.hierarchyAncestorTypesForType(t,f))}}};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}addHierarchyMemberReferences(t,n,e){let o=new Map;for(let i of t){let s=this.nodeForDefinition(i),c=s?.compilerNode;if(!c||!this.isHierarchyMethod(c))continue;let a=c.parent;if(!this.isHierarchyContainer(a))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(c.name);if(!f)continue;let p=c.getSourceFile(),d=p.getLineAndCharacterOfPosition(c.name.getStart(p)),h={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},m=n.get(i.symbolId)??[];for(let g of this.hierarchyMemberSymbols(l,a,f))if(g!==f)for(let y of this.compilerSymbolLocations(g))m.push(y),e&&(e.hierarchyReferences+=1);n.set(i.symbolId,m);let I=this.hierarchyRootMemberSymbols(l,a,f);for(let g of I){let y=o.get(g)??new Map;y.set(i.symbolId,h),o.set(g,y)}e&&(e.hierarchyDefinitions+=1)}for(let i of o.values())if(!(i.size<2)){e&&(e.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let c=n.get(s.symbolId)??[];for(let a of i.values())a.definition.symbolId!==s.symbolId&&(c.push(a.location),e&&(e.hierarchyReferences+=1));n.set(s.symbolId,c)}}}hierarchyRootMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(i.has(c))return;i.add(c);let f=!1;for(let p of l){let d=p.getProperty(e.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(t,p)))}if(!f)for(let p of this.compilerSymbolKeys(a))o.add(p)};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}compilerSymbolKeys(t){return(t.declarations??[]).map(n=>{let e=n.getSourceFile();return`${e.fileName}\0${n.getStart(e)}\0${t.name}`})}compilerSymbolLocations(t){let n=[];for(let e of t.declarations??[]){let o=e.getSourceFile(),i=w(this.db.config.projectRoot,o.fileName);if(!i)continue;let s=e.name,c=o.getLineAndCharacterOfPosition((s??e).getStart(o));n.push({file:i,line:c.line,column:c.character})}return n}baseTypes(t,n){try{return t.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(t,n){let e=new Set(this.hierarchyAncestorTypesForType(t,t.getTypeAtLocation(n)));for(let o of n.heritageClauses??[])for(let i of o.types)e.add(t.getTypeAtLocation(i));return[...e]}hierarchyAncestorTypesForType(t,n){let e=new Set(this.baseTypes(t,n));for(let o of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(o))for(let i of o.heritageClauses??[])for(let s of i.types)e.add(t.getTypeAtLocation(s));return[...e]}isHierarchyMethod(t){return this.tsMorph.ts.isMethodDeclaration(t)||this.tsMorph.ts.isMethodSignature(t)}isHierarchyContainer(t){return this.tsMorph.ts.isClassDeclaration(t)||this.tsMorph.ts.isClassExpression(t)||this.tsMorph.ts.isInterfaceDeclaration(t)}compilerReferenceSymbol(t,n,e,o){e&&(e.symbolLookups+=1);let i=ne(()=>t.getSymbolAtLocation(n),o);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return e&&(e.aliasResolutions+=1),t.getAliasedSymbol(i)}catch{return o?.(),i}}}calleesFor(t){if(this.calleesCache.has(t.symbolId))return this.calleesCache.get(t.symbolId)??[];let n=k(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath));if(n.incompleteSymbolIds.has(t.symbolId))throw new Error(`TypeScript callee evidence is incomplete for ${t.symbol}.`);let e=n.callees.get(t.symbolId)??[];return this.calleesCache.set(t.symbolId,e),e}calleesForDefinitions(t){let n=new Map,e=new Map;for(let o of t){if(this.calleesCache.has(o.symbolId)){n.set(o.symbolId,this.calleesCache.get(o.symbolId)??[]);continue}let i=e.get(o.relativePath);i?i.push(o):e.set(o.relativePath,[o])}for(let[o,i]of e){let s=this.fileCalleesCache.get(o),c=new Set(i.map(l=>l.symbolId)),a=s??this.calleeMapForFile(o,c);for(let l of i){if(a.incompleteSymbolIds.has(l.symbolId))continue;let f=a.callees.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(t,n,e){let o=e?u.now():0,i=this.packageImportReferencesForDefinition(t);if(e&&(e.packageRefsMs+=u.now()-o,e.packageReferenceCount+=i.length),!n)return i;let s=e?u.now():0,c=Me(n,t,i,this.db.config.projectRoot);return e&&(e.semanticRefsMs+=u.now()-s,e.referenceCount+=c.length),c}signatureFor(t){return k(this.signatureCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let e=n.getType().getCallSignatures()[0];if(!e)return null;let o=e.getParameters().map(s=>{let c=s.getDeclarations()[0],a=c?s.getTypeAtLocation(c).getText(c):s.getValueDeclaration()?.getType().getText()??"unknown";return we(a)}),i=e.getReturnType().getText(n);return`(${o.join(",")})=>${we(i)}`})}importUsageForSourceFile(t,n,e){let o=[],i=new Map;for(let s of n.getImportDeclarations()){e.declarations+=1;let c=_(this.db,t,s.getModuleSpecifierValue()),a=s.getImportClause()?.isTypeOnly()??!1;for(let l of ie(s)){e.entries+=1;let f=a?null:l.identifier?.getSymbol()?.compilerSymbol??null;!a&&l.identifier&&(f?e.bindingSymbols+=1:e.missingBindingSymbols+=1);let p={sourcePath:c,entry:l,typeOnlyDeclaration:a,bindingSymbol:f,references:[]};if(o.push(p),a||!l.localName||!f)continue;let d=i.get(l.localName);d?d.push(p):i.set(l.localName,[p])}}return i.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let c=i.get(s.getText());if(!c||Ge(s))return;e.scannedIdentifiers+=1;let a=s.getSymbol()?.compilerSymbol;if(e.symbolLookups+=1,!!a){for(let l of c)if(l.bindingSymbol===a){l.references.push({location:$(s,this.db.config.projectRoot),node:s}),e.matchedReferences+=1;break}}}),o.map(s=>s.typeOnlyDeclaration?qe(t,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(e.fallbackEntries+=1,this.valueImportUsageForEntry(t,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(t,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(t,n,e){let o;try{o=e.identifier?e.identifier.findReferences():[]}catch{let s=e.identifier?q(e.identifier,t,this.db.config.projectRoot):[];return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:e.isTypeOnly,isUsed:e.isTypeOnly||s.length>0,isTypeUsed:e.isTypeOnly,isValueUsed:!e.isTypeOnly&&s.length>0,references:s}}let i=[];for(let s of o)for(let c of Fe(s,t,e.identifier,this.db.config.projectRoot))i.push(c);return this.valueImportUsageFromLocations(t,n,e,i)}valueImportUsageFromLocations(t,n,e,o){let i=o.some(a=>!Y(a.node)),s=o.some(a=>Y(a.node)),c=e.isTypeOnly;return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||s,isValueUsed:i,references:o.map(a=>a.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferencesForFiles(t){let n=new Map,e=new Set;for(let i of t){let s=this.sourceFiles.sourceFile(i);if(s)for(let c of s.getImportDeclarations()){let a=te(this.workspacePackages,c.getModuleSpecifierValue());a&&e.add(a)}}if(e.size===0)return n;let o=this.packageExportsForNames(e);for(let i of t)this.addPackageImportReferencesForDocument(n,o,i);for(let[i,s]of n)n.set(i,L(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,n=this.packageExports();for(let e of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,n,e);for(let[e,o]of t)t.set(e,L(o));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,n,e){if(this.db.isIgnored(e))return;let o=this.sourceFiles.sourceFileMatch(e);if(o)for(let i of o.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,n,e,i)}addPackageImportReferencesForDeclaration(t,n,e,o){let i=te(this.workspacePackages,o.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let c of ie(o)){if(c.kind!=="named"||!c.identifier)continue;let a=s.get(c.importedName);if(!a||a.size===0)continue;let l=q(c.identifier,e,this.db.config.projectRoot);l.length>0&&tt(t,a,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(t=>t.name))),this.packageExportIndex)}packageExportsForNames(t){let n=new Map;for(let e of this.workspacePackages){if(!t.has(e.name))continue;let o=new Map;for(let i of Ne(e))this.collectPackageExports(e,i,o,new Set);o.size>0&&n.set(e.name,o)}return n}collectPackageExports(t,n,e,o){if(o.has(n))return;o.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let c=s.getModuleSpecifierValue(),a=c?_(this.db,n,c):n;if(!a||!a.startsWith(`${t.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(t,a,e,o);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,h=this.indexedDefinitionByLeaf(a,p);if(!h)continue;let m=e.get(d);m||(m=new Set,e.set(d,m)),m.add(h.symbolId)}}}indexedDefinitionByLeaf(t,n){return k(this.indexedDefinitionLeafCache,t,()=>Te(this.db,t)).get(n)??null}nodeForDefinition(t){return k(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return k(this.fileDefinitionNodeCache,t,()=>{let n=this.sourceFiles.sourceFile(t);return n?xe(this.tsMorph,this.db,n,t):new Map})}referenceDefinitionFromCompilerSymbol(t){return this.definitionFromCompilerSymbol(t,void 0,!0)}definitionFromCompilerSymbol(t,n,e=!1){let o=t.name,i=n?u.now():0,s=t.declarations??[];n&&(n.declarationsMs+=u.now()-i,n.declarationChecks+=s.length);for(let c of s){let a=n?u.now():0,l=c.getSourceFile(),f=w(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(c.getStart(l)).line;if(n&&(n.declarationLocationMs+=u.now()-a),!f||this.db.isIgnored(f))continue;let d=n?u.now():0,h=this.compilerDeclarationName(c),m=e?X(this.db,f,p,o)??(h&&h!==o?X(this.db,f,p,h):null):ke(this.db,f,p,o);if(n&&(n.indexedLookupMs+=u.now()-d),m)return{symbolId:m.symbolId,symbol:m.symbol,file:m.relativePath,line:m.startLine}}return null}compilerDeclarationName(t){let n=t.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(t,n){let e=A(),o=0,i=0,s=0,c=0,a=0,l=0,f=0,p=0,d=e?Ze():void 0;return x("typescript.callee-map.file",()=>{let h=e?u.now():0,m=this.sourceFiles.sourceFile(t);if(e&&(a=Math.round(u.now()-h)),!m)return{callees:new Map,incompleteSymbolIds:new Set};let I=e?u.now():0,g=P(this.db,t).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(e&&(l=Math.round(u.now()-I)),o=g.length,g.length===0)return{callees:new Map,incompleteSymbolIds:new Set};let y=new Map,S=new Set,T=e?u.now():0,R=this.compilerCheckerForSourceFile(m),D=m.compilerNode;e&&(f=Math.round(u.now()-T));let v=new Map,N=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){e&&(i+=1);let F=this.semanticCalleeForCallNode(R,D,g,M,v,n,S,d);F&&(e&&(s+=1),Je(y,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,N)},C=e?u.now():0;N(D),e&&(p=Math.round(u.now()-C));for(let[M,F]of y)y.set(M,nt(F));return c=y.size,{callees:y,incompleteSymbolIds:S}},()=>({relativePath:t,definitions:o,callNodes:i,resolvedCallees:s,outputRows:c,requestedDefinitions:n?.size??o,sourceFileLookupMs:a,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?et(d):{}}))}semanticCalleeForCallNode(t,n,e,o,i,s,c,a){let l=a?u.now():0,f=Qe(e,W(n,o));if(a&&(a.callerLookupMs+=u.now()-l),!f)return null;if(s&&!s.has(f.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let p=o.expression,d=this.compilerSymbolForExpression(t,p,a);d.incomplete&&c?.add(f.symbolId);let h=d.symbol,m=null;if(h)if(a&&(a.targetSymbolHits+=1),i.has(h))a&&(a.compilerSymbolCacheHits+=1),m=i.get(h)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let I=a?u.now():0;m=this.definitionFromCompilerSymbol(h,a),a&&(a.targetLookupMs+=u.now()-I),i.set(h,m)}else a&&(a.targetMisses+=1);return m?{callerId:f.symbolId,target:{symbol:m.symbol,file:m.file,line:m.line,callsiteLine:W(n,o)}}:null}compilerSymbolForExpression(t,n,e){let o=!1,i=e?u.now():0,s=ne(()=>t.getSymbolAtLocation(n),()=>{o=!0});if(e&&(e.expressionSymbolMs+=u.now()-i),s)return{symbol:s,incomplete:!1};e&&(e.typeFallbacks+=1);let c=!1,a=e?u.now():0,l=ne(()=>t.getTypeAtLocation(n).getSymbol(),()=>{c=!0});return e&&(e.typeSymbolMs+=u.now()-a),{symbol:l,incomplete:!l&&(o||c)}}compilerCheckerForSourceFile(t){let n=t.getProject(),e=this.compilerCheckerCache.get(n);return e||(e=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,e)),e}};function ie(r){let t=[],n=r.getDefaultImport();n&&t.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let e=r.getNamespaceImport();e&&t.push({identifier:e,importedName:"*",localName:e.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let o of r.getNamedImports()){let i=o.getNameNode(),c=o.getAliasNode()??(i.getKindName()==="Identifier"?i:null);t.push({identifier:c,importedName:i.getText(),localName:c?.getText()??i.getText(),kind:"named",isTypeOnly:o.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function qe(r,t,n){return{importer:r,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ye(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Ge(r){for(let t=r;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function Je(r,t,n){let e=r.get(t);e||(e=[],r.set(t,e)),e.push(n)}function Xe(r){let t=new Set;for(let n of r.getImportDeclarations())for(let e of ie(n))e.localName&&t.add(e.localName);return t}function Qe(r,t){let n=null;for(let e of r)t<e.startLine||t>e.endLine||(!n||e.startLine>=n.startLine)&&(n=e);return n}function W(r,t){return r.getLineAndCharacterOfPosition(t.getStart(r)).line}function Re(r,t,n){return t===r.relativePath&&n>=r.startLine&&n<=r.endLine}function ve(r){return r.symbol.includes("#")?ue(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function Ze(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function et(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function Pe(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function Le(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs),hierarchyMs:Math.round(r.hierarchyMs)}}function tt(r,t,n){for(let e of t){let o=r.get(e)??[];o.push(...n),r.set(e,o)}}function nt(r){let t=new Set,n=[];for(let e of r){let o=`${e.symbol}|${e.file}|${e.line}|${e.callsiteLine??""}`;t.has(o)||(t.add(o),n.push(e))}return n}function we(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,Ee as b,Yt as c,Ve as d};
|
|
3
|
+
//# sourceMappingURL=chunk-FAJQ7LWY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as F,f as w}from"./chunk-QW7EP6WI.js";import{u as S,v as D,x as b,y as E}from"./chunk-RDBI2RXU.js";import{h as m}from"./chunk-WE5RZHZ7.js";import{createHash as V}from"crypto";import{dirname as B,join as A}from"path";var T=4,z=3,L=2,$="typescript-index";function ne(t){let e=A(t,$),r=D(e);return{...r,requestDir:r.legacyRequestDir}}function ie(t){let e=JSON.parse(t),r=e.protocolVersion,n=r===L,i=r===z;if(!n&&!i&&r!==T||typeof e.id!="string"||!e.id||typeof e.baseGeneration!="string"||!e.baseGeneration||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||!U(e.request)||!n&&(e.mailboxVersion!==S||typeof e.operationKey!="string"||!/^[a-f0-9]{64}$/.test(e.operationKey)||e.id!==E(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||e.deadlineAtMs<e.enqueuedAtMs))throw new Error("TypeScript index service received an invalid mailbox request.");if(!n){let s=e,p=b(i?"typescript-index-v3":"typescript-index-v4",{baseGeneration:s.baseGeneration,request:s.request});if(s.operationKey!==p)throw new Error("TypeScript index service received a mismatched mailbox operation identity.");return{...s,protocolVersion:T}}let o=b("typescript-index-v2",{id:e.id,baseGeneration:e.baseGeneration,request:e.request});return{protocolVersion:T,mailboxVersion:S,id:e.id,operationKey:o,clientId:"legacy-v2",enqueuedAtMs:e.deadlineAtMs,deadlineAtMs:e.deadlineAtMs,baseGeneration:e.baseGeneration,request:e.request}}function oe(t){try{let e=w(F(m(A(B(t),"meta.json"),"reindex metadata")));return e?V("sha256").update(e).digest("hex"):null}catch{return null}}function U(t){if(!t||typeof t!="object")return!1;let e=t,r=C(e.modifiedFiles)?e.modifiedFiles:null,n=C(e.affectedFiles)?e.affectedFiles:null;return e.kind==="emit-documents"&&typeof e.tsconfigPath=="string"&&!!e.tsconfigPath&&typeof e.projectArgument=="string"&&!!e.projectArgument&&typeof e.projectIdentity=="string"&&!!e.projectIdentity&&typeof e.producerIdentity=="string"&&!!e.producerIdentity&&r!==null&&r.length>0&&new Set(r).size===r.length&&n!==null&&n.length>0&&new Set(n).size===n.length}function C(t){return Array.isArray(t)&&t.every(e=>typeof e=="string"&&e.length>0)}import{createRequire as G}from"module";import{dirname as R,isAbsolute as Y,relative as _,resolve as d,sep as v}from"path";var l=G(import.meta.url),H=1,M="0.4.0";function X(){try{let t=j();if(!t.available)return t;let{packageRoot:e}=t,r=l.resolve("typescript",{paths:[e]}),n=l(r),{FileIndexer:i}=l(d(e,"dist/src/FileIndexer.js")),{Input:o}=l(d(e,"dist/src/Input.js")),{Packages:s}=l(d(e,"dist/src/Packages.js")),p=l(d(e,"dist/src/scip.js"));if(!i||!o||!s||!p.scip?.Document||!p.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let c={packageVersion:t.packageVersion,typescript:n,Document:p.scip.Document,Index:p.scip.Index,FileIndexer:i,Input:o,Packages:s};return{available:!0,runtime:c,producerIdentity:k(c)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function ue(){let t=j();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function j(){try{let t=l.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(m(t,"scip-typescript package manifest"));if(e.version!==M)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${M}`};let r=R(t),n=l.resolve("typescript/package.json",{paths:[r]}),i=JSON.parse(m(n,"TypeScript package manifest"));return typeof i.version!="string"||!i.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:i.version,producerIdentity:q(e.version,i.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function le(t){let e=t.runtime===void 0?X():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:k(t.runtime)};return e.available?{available:!0,emitter:new x(t,e.runtime)}:e}var x=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=d(e.workspaceRoot),this.tsconfigPath=d(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??J(this.workspaceRoot,R(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=k(r);let n=N(r.typescript,this.tsconfigPath);this.config=n,this.host=new I(r.typescript,n.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now(),r=this.config??N(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(r.fileNames.map(g)),this.program=this.runtime.typescript.createProgram(r.fileNames,r.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1;let n=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(g(i.fileName))&&n.push(this.emitSourceFile(i));return this.result(n,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),n=f(e.modifiedFiles),i=f(e.affectedFiles);this.validateIncrementalPaths(n,i);let o=this.program,s=new Map;for(let c of n){let u=y(this.workspaceRoot,c),a=o.getSourceFile(u);if(!a)throw new Error(`modified TypeScript source is unavailable: ${c}`);s.set(c,a),this.stats.symbolEntriesPruned+=O(this.symbolTable,a),this.stats.symbolEntriesPruned+=O(this.constructorTable,a),this.host.invalidate(u)}this.program=this.runtime.typescript.createProgram(this.config.fileNames,this.config.options,this.host.compilerHost,o),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1;for(let[c,u]of s)this.program.getSourceFile(y(this.workspaceRoot,c))===u?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;let p=i.map(c=>{let u=y(this.workspaceRoot,c),a=this.program.getSourceFile(u);if(!a)throw new Error(`affected TypeScript source is unavailable: ${c}`);return this.emitSourceFile(a)});return this.result(p,r)}fragment(e){return this.fragments.get(h(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=this.initialize(),n=f(e.modifiedFiles),i=f(e.affectedFiles);this.validateIncrementalPaths(n,i);let o=new Set(i);return{...r,fragments:r.fragments.filter(s=>o.has(s.relativePath))}}validateIncrementalPaths(e,r){if(e.length===0)throw new Error("incremental TypeScript document update requires a modified file");if(r.length===0)throw new Error("incremental TypeScript document update requires an affected file");for(let n of e){let i=y(this.workspaceRoot,n);if(!this.program?.getSourceFile(i))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${n}`)}for(let n of r){let i=y(this.workspaceRoot,n);if(!this.includedFiles.has(g(i)))throw new Error(`affected TypeScript file is outside the configured project: ${n}`)}}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=h(_(this.workspaceRoot,e.fileName)),n=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),n,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,n.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:n.symbols.length,referenceFragments:[]};let o=n.serializeBinary();return this.fragments.set(r,o),{relativePath:r,bytes:o,occurrences:n.occurrences.length,symbols:n.symbols.length,referenceFragments:K(r,n)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function K(t,e){let r=new Map;for(let n of e.occurrences){if(!n.symbol||(n.symbol_roles&1)!==0||n.range.length<3)continue;let i=n.range[0],o=n.range[1];if(!Number.isInteger(i)||!Number.isInteger(o))continue;let s={targetSymbol:n.symbol,location:{file:t,line:i,column:o}};r.set(`${n.symbol}\0${i}\0${o}`,s)}return[...r.values()].sort((n,i)=>n.targetSymbol.localeCompare(i.targetSymbol)||n.location.line-i.location.line||n.location.column-i.location.column)}var I=class{compilerHost;sourceFiles=new Map;constructor(e,r,n){let i=e.createCompilerHost(r),o=i.getSourceFile.bind(i);this.compilerHost={...i,getCurrentDirectory:()=>n,getSourceFile:(s,p,c,u)=>{let a=g(s);if(this.sourceFiles.has(a))return this.sourceFiles.get(a);let P=o(s,p,c,u);return this.sourceFiles.set(a,P),P}}}invalidate(e){this.sourceFiles.delete(g(e))}};function N(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let n=t.parseJsonConfigFileContent(r.config,t.sys,R(e)),i=n.errors.filter(o=>o.code!==18003);if(i.length>0)throw new Error(t.formatDiagnostics(i,t.createCompilerHost({})));return n}function k(t){return q(t.packageVersion,t.typescript.version)}function q(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${H}`}function J(t,e){return h(_(t,e))||"."}function y(t,e){if(Y(e))throw new Error(`expected a project-relative path: ${e}`);let r=d(t,e),n=t.endsWith(v)?t:`${t}${v}`;if(r!==t&&!r.startsWith(n))throw new Error(`path escapes the project root: ${e}`);return r}function f(t){return[...new Set(t.map(h))].sort()}function h(t){return t.split(v).join("/").replace(/^\.\//,"")}function g(t){return d(t)}function O(t,e){let r=0;for(let n of t.keys())if(W(n)){try{if(n.getSourceFile()!==e)continue}catch{continue}t.delete(n),r+=1}return r}function W(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}export{ue as a,le as b,T as c,ne as d,ie as e,oe as f};
|
|
2
|
+
//# sourceMappingURL=chunk-FDGD5AB5.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import{a as _,g as C,j as T,o as $,p as w}from"./chunk-O6QTXQPJ.js";import{C as O,a as x}from"./chunk-ADTBPVUZ.js";import{e as y,f as R,j as S,k as h,p as D,r as E,t as M,u as k,v as N}from"./chunk-BMYOV5GP.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||A(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!A(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function A(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
+
FROM global_symbols gs
|
|
3
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
+
JOIN documents d ON der.document_id = d.id
|
|
5
|
+
WHERE ${n.where}
|
|
6
|
+
${e.pathExclusionsFor("d")}
|
|
7
|
+
${B(n.orderBy)}
|
|
8
|
+
${J(n.limit)}`,...n.params??[])}function Ge(e,n){return e.all(`SELECT
|
|
9
|
+
gs.id,
|
|
10
|
+
gs.symbol,
|
|
11
|
+
c.document_id,
|
|
12
|
+
MIN(c.start_line) AS start_line,
|
|
13
|
+
0 AS start_char,
|
|
14
|
+
MAX(c.end_line) AS end_line,
|
|
15
|
+
0 AS end_char,
|
|
16
|
+
d.relative_path,
|
|
17
|
+
gs.display_name,
|
|
18
|
+
gs.documentation
|
|
19
|
+
FROM global_symbols gs
|
|
20
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
21
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
+
JOIN documents d ON c.document_id = d.id
|
|
23
|
+
WHERE m.role = 1
|
|
24
|
+
AND ${n.where}
|
|
25
|
+
${e.pathExclusionsFor("d")}
|
|
26
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
27
|
+
${B(n.orderBy)}
|
|
28
|
+
${J(n.limit)}`,...n.params??[])}function B(e){return e?`ORDER BY ${e}`:""}function J(e){return typeof e=="number"?`LIMIT ${e}`:""}function W(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function z(e){if(!e)return null;let n=j(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(j(i)??i).replace(/\n/g," ")}function j(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function g(e){return{forFile(n,t){return H(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,H(e,r,t));return i}}}function H(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=k(e,n)),t.lines&&(i.lines=N(e,n)),t.ast&&(i.ast=O(e,n)),t.imports&&(i.imports=w(e,n)),t.reexports&&(i.reexports=$(e,n)),r){let s=C(e,n),o=s.facts;t.facts&&(i.facts=o),s.unavailable&&(i.sourceFactsUnavailable=s.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}return i}function ae(e,n={}){if(m(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function I(e,n,t={}){let i=new Map;for(let s of n)e.length>0&&!ae(s,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return t.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}function pn(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}var le=y("file-definitions",{clearGroups:["definition-catalog"]}),ce=R("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),de=y("file-function-like-definitions",{clearGroups:["definition-catalog"]}),U=new WeakMap;function F(e,n,t={}){return t.includeClassMemberFallbacks?L(e,n,void 0,{includeClassMemberFallbacks:!0}):le.get(e,n,()=>{let i=X(e,n);if(i)return i;let r=L(e,n),s=h(e),o=g(e).forFile(n,{text:!0}).text;return s&&o&&Y.write(e,n,S(e,n,o),{projectFingerprint:s,definitions:r.map(a=>({...a}))}),r})}function ue(e,n){return de.get(e,n,()=>{let t=X(e,n);return t?t.filter(i=>i.isFunctionLike):L(e,n,i=>i.isFunctionLike)})}var Y=E({kind:"file-definitions",invalidation:M("file-definitions"),serialize:fe,deserialize:me});function X(e,n){let t=h(e);if(!t)return null;let i=g(e).forFile(n,{text:!0}).text;if(!i)return null;let r=Y.read(e,n,S(e,n,i));return r?pe(r,t,n):null}function fe(e){return JSON.stringify(e)}function me(e){try{let n=JSON.parse(e);return!D(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function pe(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let s=ge(r,t);if(!s)return null;i.push(s)}return i}function ge(e,n){return!D(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function L(e,n,t,i={}){let r=I(be(e,n),ye(e,n),{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(Z);return t&&(r=r.filter(t)),V(e,n,r)}function be(e,n){return e.all(`SELECT
|
|
29
|
+
gs.id,
|
|
30
|
+
gs.symbol,
|
|
31
|
+
der.document_id,
|
|
32
|
+
der.start_line,
|
|
33
|
+
der.start_char,
|
|
34
|
+
der.end_line,
|
|
35
|
+
der.end_char,
|
|
36
|
+
d.relative_path,
|
|
37
|
+
gs.display_name,
|
|
38
|
+
gs.kind,
|
|
39
|
+
gs.documentation,
|
|
40
|
+
gs.enclosing_symbol
|
|
41
|
+
FROM global_symbols gs
|
|
42
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
43
|
+
JOIN documents d ON der.document_id = d.id
|
|
44
|
+
WHERE d.relative_path = ?
|
|
45
|
+
${e.symbolNoiseFor("gs")}
|
|
46
|
+
ORDER BY der.start_line, der.end_line`,n)}function ye(e,n){return e.all(`SELECT
|
|
47
|
+
gs.id,
|
|
48
|
+
gs.symbol,
|
|
49
|
+
c.document_id,
|
|
50
|
+
MIN(c.start_line) AS start_line,
|
|
51
|
+
0 AS start_char,
|
|
52
|
+
MAX(c.end_line) AS end_line,
|
|
53
|
+
0 AS end_char,
|
|
54
|
+
d.relative_path,
|
|
55
|
+
gs.display_name,
|
|
56
|
+
gs.kind,
|
|
57
|
+
gs.documentation,
|
|
58
|
+
gs.enclosing_symbol
|
|
59
|
+
FROM global_symbols gs
|
|
60
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
61
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
62
|
+
JOIN documents d ON c.document_id = d.id
|
|
63
|
+
WHERE d.relative_path = ?
|
|
64
|
+
AND m.role = 1
|
|
65
|
+
${e.symbolNoiseFor("gs")}
|
|
66
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
67
|
+
ORDER BY start_line, end_line`,n)}function Z(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:P(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:Q(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function gn(e,n={}){return Se(e,n.scope)}function Se(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>F(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function bn(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>ue(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function yn(e,n){let t=ce.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),s=i.get(r);if(s)return[...s];let o=G(he(e,n.scope,n.sqlPrefilter)),a=G(xe(e,n.scope,n.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=I(o.get(d)??[],a.get(d)??[],{sort:!0}).filter(ee=>n.symbolMatches(ee.symbol));f.length!==0&&l.push(...V(e,d,f.map(Z)))}return i.set(r,l),[...l]}function he(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
68
|
+
gs.id,
|
|
69
|
+
gs.symbol,
|
|
70
|
+
der.document_id,
|
|
71
|
+
der.start_line,
|
|
72
|
+
der.start_char,
|
|
73
|
+
der.end_line,
|
|
74
|
+
der.end_char,
|
|
75
|
+
d.relative_path,
|
|
76
|
+
gs.display_name,
|
|
77
|
+
gs.kind,
|
|
78
|
+
gs.documentation,
|
|
79
|
+
gs.enclosing_symbol
|
|
80
|
+
FROM global_symbols gs
|
|
81
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
82
|
+
JOIN documents d ON der.document_id = d.id
|
|
83
|
+
WHERE 1 = 1
|
|
84
|
+
${e.pathExclusionsFor("d")}
|
|
85
|
+
${i}
|
|
86
|
+
${r}
|
|
87
|
+
${e.symbolNoiseFor("gs")}
|
|
88
|
+
ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function xe(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
89
|
+
gs.id,
|
|
90
|
+
gs.symbol,
|
|
91
|
+
c.document_id,
|
|
92
|
+
MIN(c.start_line) AS start_line,
|
|
93
|
+
0 AS start_char,
|
|
94
|
+
MAX(c.end_line) AS end_line,
|
|
95
|
+
0 AS end_char,
|
|
96
|
+
d.relative_path,
|
|
97
|
+
gs.display_name,
|
|
98
|
+
gs.kind,
|
|
99
|
+
gs.documentation,
|
|
100
|
+
gs.enclosing_symbol
|
|
101
|
+
FROM global_symbols gs
|
|
102
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
103
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
104
|
+
JOIN documents d ON c.document_id = d.id
|
|
105
|
+
WHERE m.role = 1
|
|
106
|
+
AND NOT EXISTS (
|
|
107
|
+
SELECT 1
|
|
108
|
+
FROM defn_enclosing_ranges existing_der
|
|
109
|
+
WHERE existing_der.symbol_id = gs.id
|
|
110
|
+
)
|
|
111
|
+
${e.pathExclusionsFor("d")}
|
|
112
|
+
${i}
|
|
113
|
+
${r}
|
|
114
|
+
${e.symbolNoiseFor("gs")}
|
|
115
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
|
+
ORDER BY d.relative_path, start_line, end_line`,...s)}function De(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function q(e,n){return n==="callable"?De(e):_e(e)}function _e(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function G(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Sn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>F(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(z(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Ie(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function hn(e,n){let t=U.get(e);return t||(t=Ie(e),U.set(e,t)),t.get(n)??null}function xn(e,n){let t=F(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function V(e,n,t){let i=g(e).forFile(n,{text:!0}).text,r=T(e,n);return r?ke(t,r,i):i?Le(t,i):t}function Le(e,n){let t=n.split(/\r?\n/),i=Fe(e,t),r=Re(e,i),s=Ee(r,t);return Me(e,s)}function Fe(e,n){let t=e.some(r=>b(r.symbol))?Ae(n):null,i=new Map;for(let r of e)i.set(r.symbolId,we(n,t,r));return i}function Re(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ee(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ve(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function ke(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!$e(r)||!r.leaf)return K(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return K(r,t);let o=t?Ne(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ne(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${_(i)}\\b`);for(let o of n){let a=Ce(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ce(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return Te(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function Te(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function $e(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function K(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=_(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function we(e,n,t){if(!b(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function Ae(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function ve(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Pe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Pe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function b(e){return e.includes("().")}function Dn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{g as a,u as b,m as c,v as d,P as e,p as f,Qe as g,Q as h,je as i,Be as j,Je as k,We as l,ze as m,Ue as n,Ge as o,W as p,z as q,I as r,pn as s,F as t,gn as u,Se as v,bn as w,yn as x,Sn as y,Ie as z,hn as A,xn as B,Dn as C};
|
|
117
|
+
//# sourceMappingURL=chunk-FETNQCFO.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{a as f,g as u}from"./chunk-WE5RZHZ7.js";import C from"ignore";import{existsSync as p,readdirSync as S}from"fs";import{dirname as g,isAbsolute as h,join as l,relative as x,resolve as D}from"path";function E(t){let e=C();return w(t,e)||e.add(T),{isIgnored:r=>d(e,t,r),filter:r=>r.filter(n=>!d(e,t,n))}}function w(t,e){let i=new Set,r=(s,a)=>{if(!(i.has(s)||!p(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});e.add(a?A(c,a):c),i.add(s)}catch{}},n=g(t),o=0;for(;n!==g(n)&&o<5&&(r(l(n,".gitignore"),""),!p(l(n,".git")));)n=g(n),o++;return b(t,"",e,r),i.size>0}function b(t,e,i,r){let n=e?l(t,e):t;r(l(n,".gitignore"),e);let o;try{o=S(n,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=e?`${e}/${s.name}`:s.name;d(i,t,`${a}/`)||b(t,a,i,r)}}function A(t,e){let i=e.replaceAll("\\","/").replace(/\/+$/,"");return t.split(/\r?\n/).map(r=>F(r,i)).join(`
|
|
2
|
+
`)}function F(t,e){let i=t.trimStart();if(!i||i.startsWith("#"))return t;let r=t.slice(0,t.length-i.length),n=i.startsWith("!"),o=n?i.slice(1):i;if(!o||o.startsWith("#"))return t;let s=o.startsWith("/"),a=s?o.slice(1):o,v=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${e}/${a}`:`${e}/**/${a}`;return`${r}${n?"!":""}${v}`}var T=`
|
|
3
|
+
# Dependencies
|
|
4
|
+
node_modules/
|
|
5
|
+
vendor/
|
|
6
|
+
.bundle/
|
|
7
|
+
|
|
8
|
+
# Build output
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
out/
|
|
12
|
+
target/
|
|
13
|
+
bin/
|
|
14
|
+
obj/
|
|
15
|
+
|
|
16
|
+
# Python
|
|
17
|
+
__pycache__/
|
|
18
|
+
*.pyc
|
|
19
|
+
*.pyo
|
|
20
|
+
.venv/
|
|
21
|
+
venv/
|
|
22
|
+
.env/
|
|
23
|
+
env/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
|
|
26
|
+
# Rust
|
|
27
|
+
target/
|
|
28
|
+
|
|
29
|
+
# Java / Kotlin / Scala
|
|
30
|
+
*.class
|
|
31
|
+
.gradle/
|
|
32
|
+
.mvn/
|
|
33
|
+
|
|
34
|
+
# C# / .NET
|
|
35
|
+
bin/
|
|
36
|
+
obj/
|
|
37
|
+
packages/
|
|
38
|
+
|
|
39
|
+
# Go
|
|
40
|
+
vendor/
|
|
41
|
+
|
|
42
|
+
# Dart
|
|
43
|
+
.dart_tool/
|
|
44
|
+
build/
|
|
45
|
+
|
|
46
|
+
# PHP
|
|
47
|
+
vendor/
|
|
48
|
+
|
|
49
|
+
# IDE / OS
|
|
50
|
+
.idea/
|
|
51
|
+
.vscode/
|
|
52
|
+
*.swp
|
|
53
|
+
*.swo
|
|
54
|
+
.DS_Store
|
|
55
|
+
Thumbs.db
|
|
56
|
+
|
|
57
|
+
# Type definitions (often noise in queries)
|
|
58
|
+
*.d.ts
|
|
59
|
+
`;function d(t,e,i){let r=_(e,i);if(!r)return!1;try{return t.ignores(r)}catch{return!1}}function _(t,e){if(!e||e===".")return null;if(!h(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let i=h(e)?e:D(t,e),r=x(t,i).replaceAll("\\","/");return!r||r==="."||r.startsWith("..")?null:r}var y=[],m=[];function L(t){t.groups.length>0&&y.push(t)}function k(t){m.push(t)}function O(t){let e=[];for(let i of m)try{i.close(t)}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Multiple database-owned resources failed to close.")}function P(t,e){let i=new Set(e.groups);for(let r of y)r.groups.some(n=>i.has(n))&&(e.file!==void 0&&r.clearFile?r.clearFile(t,e.file):r.clearAll(t))}export{L as a,k as b,O as c,P as d,E as e};
|
|
60
|
+
//# sourceMappingURL=chunk-FM5BPL4V.js.map
|