scip-query 0.21.0 → 0.21.1
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 +12 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-XXGZGNZ6.js +2 -0
- package/dist/call-graph-VGY3R4L3.js +2 -0
- package/dist/{chunk-TGWNNMPF.js → chunk-27OUNZW5.js} +2 -2
- package/dist/{chunk-KW6B5OL4.js → chunk-2LJLEM5B.js} +2 -2
- package/dist/chunk-3KXFB2FM.js +2 -0
- package/dist/{chunk-E7BJXRNV.js → chunk-3T5U2EQ2.js} +2 -2
- package/dist/{chunk-O2RM7E7L.js → chunk-3XQLJG7V.js} +4 -4
- package/dist/chunk-3XZELASU.js +2 -0
- package/dist/{chunk-BBEDPVPB.js → chunk-3YETOKNO.js} +2 -2
- package/dist/chunk-47WX6UC4.js +2 -0
- package/dist/{chunk-HGKEAP7F.js → chunk-4HQYNZ3P.js} +2 -2
- package/dist/chunk-4IASLUOP.js +3 -0
- package/dist/{chunk-V7LQZTTZ.js → chunk-4KIPF45P.js} +2 -2
- package/dist/{chunk-Q7HB7BFJ.js → chunk-4SZJF4GK.js} +2 -2
- package/dist/chunk-4TOU7HHQ.js +2 -0
- package/dist/chunk-4ZCLDH6T.js +11 -0
- package/dist/{chunk-3653GTR7.js → chunk-527HV7JY.js} +2 -2
- package/dist/{chunk-QBANU5BQ.js → chunk-5BJPJUXF.js} +2 -2
- package/dist/{chunk-2I3RSUWX.js → chunk-5J3A6RBZ.js} +2 -2
- package/dist/{chunk-OFY4HTMI.js → chunk-5KIJMEPC.js} +2 -2
- package/dist/{chunk-AQDWTCDC.js → chunk-5QM7QT5B.js} +2 -2
- package/dist/chunk-5Z2H76VD.js +11 -0
- package/dist/{chunk-CA5RE6H7.js → chunk-63TFRBMB.js} +2 -2
- package/dist/chunk-67FK5KGV.js +3 -0
- package/dist/chunk-6DO3VBLV.js +2 -0
- package/dist/chunk-6LS3IG2I.js +13 -0
- package/dist/{chunk-H46QMB7E.js → chunk-6QN4FYQW.js} +2 -2
- package/dist/chunk-6X4KO5A7.js +11 -0
- package/dist/chunk-743MEVFJ.js +8 -0
- package/dist/{chunk-6GJAP4OE.js → chunk-7G2WIVIX.js} +2 -2
- package/dist/{chunk-LPGDO2XA.js → chunk-7MUHSZGN.js} +2 -2
- package/dist/{chunk-U7LRSQG6.js → chunk-7YZGSLW6.js} +2 -2
- package/dist/{chunk-5IZTXSOL.js → chunk-7Z4GMCHM.js} +2 -2
- package/dist/{chunk-ZHSARYVS.js → chunk-AAOEROT3.js} +2 -2
- package/dist/{chunk-6IEVHGWG.js → chunk-AFRS7WJU.js} +2 -2
- package/dist/chunk-ANCHW2R4.js +57 -0
- package/dist/{chunk-U7DR7MJD.js → chunk-AQF35NGT.js} +2 -2
- package/dist/{chunk-FUG6RPYY.js → chunk-ARGPDW2Y.js} +2 -2
- package/dist/{chunk-RGCJ4646.js → chunk-B3AREUQK.js} +2 -2
- package/dist/{chunk-4EXFZP6H.js → chunk-BCTCADNB.js} +2 -2
- package/dist/{chunk-IPAL6DP2.js → chunk-BM4OTGSY.js} +2 -2
- package/dist/chunk-BMKTDJI6.js +16 -0
- package/dist/{chunk-VNKYRJKN.js → chunk-BVR44XXB.js} +2 -2
- package/dist/{chunk-DEUGHURX.js → chunk-BYXWXLKM.js} +2 -2
- package/dist/{chunk-OFUBXBYX.js → chunk-BZCRHP46.js} +2 -2
- package/dist/{chunk-CKDOY6JA.js → chunk-C52Q3JEQ.js} +2 -2
- package/dist/{chunk-AA7K3XLM.js → chunk-C7WSQA6A.js} +2 -2
- package/dist/{chunk-ZW44MCJM.js → chunk-CNT4ND5O.js} +2 -2
- package/dist/{chunk-BBWPOMGU.js → chunk-CQVDALWQ.js} +2 -2
- package/dist/chunk-CTO3TRX7.js +2 -0
- package/dist/chunk-CXT3GZSQ.js +2 -0
- package/dist/{chunk-PIZY2GX6.js → chunk-DGM2RJ3I.js} +2 -2
- package/dist/{chunk-7IOAZRVL.js → chunk-DK6MB565.js} +2 -2
- package/dist/{chunk-X434XZAI.js → chunk-DNPETNXT.js} +2 -2
- package/dist/chunk-DUDUIT5P.js +2 -0
- package/dist/chunk-DXEJ4FLZ.js +21 -0
- package/dist/{chunk-DOPCR5BY.js → chunk-DXYMTQZ4.js} +2 -2
- package/dist/chunk-DZA7MQMU.js +6 -0
- package/dist/{chunk-BATIVRU2.js → chunk-DZNWXJN2.js} +2 -2
- package/dist/{chunk-YUFWLWIC.js → chunk-E6N6YTVM.js} +2 -2
- package/dist/chunk-E7CJ6O72.js +2 -0
- package/dist/{chunk-IYV2YBHM.js → chunk-EJHNTAEE.js} +2 -2
- package/dist/{chunk-35IW3P4H.js → chunk-EPLE5O5O.js} +2 -2
- package/dist/{chunk-HG5YI7PV.js → chunk-FCGMQETU.js} +2 -2
- package/dist/{chunk-XVDMJMES.js → chunk-FIO44MVK.js} +2 -2
- package/dist/chunk-FLSVYEPL.js +2 -0
- package/dist/chunk-FOP7HD6H.js +3 -0
- package/dist/{chunk-TM5XEDDR.js → chunk-FSPENGSU.js} +2 -2
- package/dist/{chunk-4ILHWBYF.js → chunk-FUUDUAKM.js} +2 -2
- package/dist/chunk-FYCH2EYQ.js +2 -0
- package/dist/{chunk-3PII3JI5.js → chunk-G47MFF47.js} +2 -2
- package/dist/{chunk-6BJ7SOY7.js → chunk-G6VV7ROY.js} +2 -2
- package/dist/{chunk-B7ECWJAZ.js → chunk-GBZCVYWA.js} +2 -2
- package/dist/chunk-GSHTVE56.js +3 -0
- package/dist/{chunk-5236NQV3.js → chunk-GTZFKDP3.js} +2 -2
- package/dist/{chunk-ICHBVITH.js → chunk-H2RBDP5S.js} +2 -2
- package/dist/{chunk-73Z33VFI.js → chunk-HR5JYLVV.js} +2 -2
- package/dist/{chunk-OUB4J26T.js → chunk-HW7FASEL.js} +2 -2
- package/dist/{chunk-QD7IFBCR.js → chunk-HYU4W353.js} +2 -2
- package/dist/{chunk-D5W4UZY5.js → chunk-I2LY3KN7.js} +2 -2
- package/dist/{chunk-UL4VJUMD.js → chunk-IGBQVEHE.js} +2 -2
- package/dist/{chunk-KFK7GF5C.js → chunk-IH3K5J6K.js} +2 -2
- package/dist/{chunk-4IIMPWMR.js → chunk-IHGK3SZ7.js} +2 -2
- package/dist/{chunk-CN2WGM7D.js → chunk-IM23CSG5.js} +2 -2
- package/dist/chunk-IQMGNIGY.js +2 -0
- package/dist/{chunk-2RP27XLR.js → chunk-ITF3CWS5.js} +2 -2
- package/dist/{chunk-COTMS5KM.js → chunk-IZKJQQCQ.js} +2 -2
- package/dist/{chunk-EA4SH4U5.js → chunk-J4HUBIVF.js} +2 -2
- package/dist/{chunk-5SE323LF.js → chunk-JGMD6JGB.js} +2 -2
- package/dist/{chunk-IOKWFRFQ.js → chunk-JLZWYDCZ.js} +2 -2
- package/dist/chunk-JO6FK3Q5.js +2 -0
- package/dist/chunk-JSHDCVUM.js +81 -0
- package/dist/{chunk-UQ7XPRWU.js → chunk-K2DZCH2K.js} +2 -2
- package/dist/{chunk-FGB567HK.js → chunk-K63CAPS2.js} +2 -2
- package/dist/{chunk-XITQLISP.js → chunk-KBIC6JHJ.js} +2 -2
- package/dist/{chunk-BD6CV7PN.js → chunk-KFFQURUZ.js} +2 -2
- package/dist/{chunk-Y4XQ7LES.js → chunk-KFOYCQAJ.js} +1 -1
- package/dist/{chunk-WB6LGCFB.js → chunk-KGKCJFWZ.js} +2 -2
- package/dist/chunk-KK7GPALL.js +28 -0
- package/dist/{chunk-FEQIQ26E.js → chunk-L7WRUNKJ.js} +2 -2
- package/dist/{chunk-WK4FD4PG.js → chunk-LFWB7TOJ.js} +2 -2
- package/dist/chunk-LGVTIZPV.js +61 -0
- package/dist/{chunk-FHV7NMFU.js → chunk-LIWIV26I.js} +2 -2
- package/dist/chunk-LJMWILX6.js +3 -0
- package/dist/{chunk-S3RTPPLQ.js → chunk-LXMW6ZAX.js} +2 -2
- package/dist/chunk-MFBVUQJZ.js +2 -0
- package/dist/{chunk-WKPZCQLI.js → chunk-MLTKGHD2.js} +2 -2
- package/dist/{chunk-IDPLC3FI.js → chunk-MLTSTKXD.js} +2 -2
- package/dist/chunk-MR4ZKWO6.js +57 -0
- package/dist/{chunk-RFWAUHVW.js → chunk-MRXBLYRE.js} +2 -2
- package/dist/{chunk-OVPS2ILI.js → chunk-N4EFQIRX.js} +2 -2
- package/dist/{chunk-DHKBIOXF.js → chunk-ND3BWIVN.js} +2 -2
- package/dist/{chunk-JVZNWJBH.js → chunk-NODZYYGC.js} +2 -2
- package/dist/chunk-NP4JFCLE.js +133 -0
- package/dist/chunk-NQXWWE6S.js +8 -0
- package/dist/{chunk-AJVMVE7X.js → chunk-NSDPPUDY.js} +2 -2
- package/dist/{chunk-KTRGJLY7.js → chunk-NT4NVEHU.js} +2 -2
- package/dist/chunk-O2VY47Y5.js +325 -0
- package/dist/{chunk-PHSPBQM6.js → chunk-O3EX5STE.js} +2 -2
- package/dist/chunk-O4PZFAXA.js +3 -0
- package/dist/{chunk-2H4IAJHO.js → chunk-OA2BO4DR.js} +2 -2
- package/dist/{chunk-Z3GCK3PD.js → chunk-OFZVFIDF.js} +2 -2
- package/dist/{chunk-QXR5QPSF.js → chunk-OG5UK2K7.js} +2 -2
- package/dist/{chunk-SKUMCCC5.js → chunk-OMVNRPST.js} +2 -2
- package/dist/{chunk-4S4DF62J.js → chunk-OU6SDWAM.js} +2 -2
- package/dist/{chunk-5H7IWVXJ.js → chunk-OY7PCALC.js} +2 -2
- package/dist/{chunk-BHE44MHT.js → chunk-P3UFF22M.js} +2 -2
- package/dist/chunk-PAZSBPJR.js +3 -0
- package/dist/{chunk-WULAPQUD.js → chunk-PJBYDCBQ.js} +2 -2
- package/dist/chunk-PRLU3I7G.js +79 -0
- package/dist/{chunk-UNORWZIJ.js → chunk-PU6XDQ2X.js} +2 -2
- package/dist/{chunk-MOBF2GH6.js → chunk-PWEQ6CZZ.js} +2 -2
- package/dist/{chunk-46JLFIGA.js → chunk-PX6QNUYF.js} +2 -2
- package/dist/{chunk-CSDDOUA4.js → chunk-Q4MRRB3C.js} +2 -2
- package/dist/{chunk-XXJ7WL3F.js → chunk-QGVUPYBC.js} +2 -2
- package/dist/{chunk-HUZNZ3H2.js → chunk-QH5Q6M5C.js} +2 -2
- package/dist/{chunk-R2MOKIVO.js → chunk-QLWZUFDT.js} +2 -2
- package/dist/chunk-QN2AI3D2.js +3 -0
- package/dist/{chunk-I7PFL5P3.js → chunk-QZCACNV5.js} +2 -2
- package/dist/{chunk-ORBKAUCH.js → chunk-RNKRYK6B.js} +2 -2
- package/dist/{chunk-X7PJJYKX.js → chunk-RSUH7G5T.js} +2 -2
- package/dist/{chunk-MJNV7OCG.js → chunk-RZWBTKXO.js} +2 -2
- package/dist/{chunk-WZQFY5S7.js → chunk-SBFDPHKH.js} +2 -2
- package/dist/{chunk-32A42O5B.js → chunk-SGSPCEFC.js} +2 -2
- package/dist/chunk-SIGVQT43.js +2 -0
- package/dist/{chunk-ZBNL3QCY.js → chunk-SRIZDEWX.js} +3 -3
- package/dist/chunk-SV2LEFVM.js +2 -0
- package/dist/chunk-T2PBOVDI.js +3 -0
- package/dist/{chunk-APLKXICZ.js → chunk-TP2X2C2Y.js} +2 -2
- package/dist/{chunk-7TWP3MCP.js → chunk-U2MNECDU.js} +2 -2
- package/dist/chunk-U7DOYZDH.js +2 -0
- package/dist/chunk-UAQQR55F.js +2 -0
- package/dist/{chunk-E4EJBGDZ.js → chunk-UBETC3Q2.js} +2 -2
- package/dist/chunk-UEQORB2A.js +2 -0
- package/dist/{chunk-ICUQONOG.js → chunk-UM56ZET4.js} +2 -2
- package/dist/{chunk-UZFCZ7SJ.js → chunk-UXNXOMXJ.js} +2 -2
- package/dist/{chunk-URMZLV2N.js → chunk-V6XENWOF.js} +2 -2
- package/dist/{chunk-HWLCBKFE.js → chunk-VJAD5WX5.js} +2 -2
- package/dist/chunk-VRJG7N3I.js +453 -0
- package/dist/chunk-W7HN6V4E.js +7 -0
- package/dist/chunk-WCIKJ2E3.js +3 -0
- package/dist/chunk-WEXQYJY3.js +5 -0
- package/dist/chunk-WOPZX5GM.js +2 -0
- package/dist/chunk-WRQXLNYE.js +9 -0
- package/dist/{chunk-IGKKTHJR.js → chunk-WV6R37XV.js} +2 -2
- package/dist/{chunk-ZYREOING.js → chunk-WZ7V4BQV.js} +2 -2
- package/dist/{chunk-DMUGTKMD.js → chunk-WZRNEVYC.js} +2 -2
- package/dist/{chunk-6SWA6B24.js → chunk-X5MWO4DM.js} +2 -2
- package/dist/{chunk-EKZRF57O.js → chunk-XDOEHEET.js} +2 -2
- package/dist/chunk-XDQX6LDT.js +4 -0
- package/dist/{chunk-3EX7DNBC.js → chunk-XFRHBAIT.js} +2 -2
- package/dist/chunk-XIPGCT3D.js +5 -0
- package/dist/{chunk-IXJ26KJJ.js → chunk-XKM5D2XS.js} +2 -2
- package/dist/{chunk-XRXCANFQ.js → chunk-XNF5T4T2.js} +2 -2
- package/dist/{chunk-K5MZYZV7.js → chunk-Y2S4YNLH.js} +2 -2
- package/dist/chunk-YA72ZUKO.js +2 -0
- package/dist/chunk-YBWE6J32.js +43 -0
- package/dist/{chunk-KWARB5FZ.js → chunk-YCXQQ3YB.js} +2 -2
- package/dist/chunk-YDTK77JP.js +43 -0
- package/dist/chunk-YF25RQER.js +4 -0
- package/dist/{chunk-SSSJO4RG.js → chunk-YKHL4J3G.js} +2 -2
- package/dist/{chunk-ANWGXPPN.js → chunk-YLNCTPOI.js} +2 -2
- package/dist/{chunk-LHTT5C3Z.js → chunk-YR7VRWNX.js} +2 -2
- package/dist/{chunk-2ZBMOQGG.js → chunk-YT4IQBET.js} +2 -2
- package/dist/chunk-Z2KGMIL4.js +2 -0
- package/dist/{chunk-VETXXOYU.js → chunk-Z2QB75BS.js} +2 -2
- package/dist/chunk-Z67JOKRE.js +554 -0
- package/dist/{chunk-WSG3DK5H.js → chunk-ZGDHC5AT.js} +2 -2
- package/dist/chunk-ZMS4YCY7.js +2 -0
- package/dist/chunk-ZNW5A5VX.js +3 -0
- package/dist/{chunk-N5C65OFK.js → chunk-ZP2WUVZ5.js} +2 -2
- package/dist/{chunk-SYUNTKO2.js → chunk-ZQUNCTEZ.js} +2 -2
- package/dist/cli-main.js +4 -4
- package/dist/code-AXLJBZ6T.js +2 -0
- package/dist/{code-CczEvHui.d.ts → code-B17qEMbt.d.ts} +1 -1
- package/dist/code-result-json-CTZHAQXJ.js +2 -0
- package/dist/command-descriptors-6INSCKLW.js +342 -0
- package/dist/{config-types-Cm-VSEBb.d.ts → config-types-B9B60MiR.d.ts} +10 -0
- package/dist/dataflow-AFXY423Q.js +2 -0
- package/dist/{db-LKJXAlNS.d.ts → db-BwIVAYNB.d.ts} +1 -1
- package/dist/dependence-slice-2G4X6VSJ.js +2 -0
- package/dist/deps-LMCAV5DO.js +2 -0
- package/dist/direct-navigation-2ONV22Y2.js +3 -0
- package/dist/entry-map-ZOC3VXO5.js +2 -0
- package/dist/files-WJQJLHMH.js +2 -0
- package/dist/{graph-evidence-CbUPCSKV.d.ts → graph-evidence-Bjyky2V4.d.ts} +1 -1
- package/dist/{health-Wl5G_LRt.d.ts → health-CPp2Jf1Z.d.ts} +1 -1
- package/dist/hierarchy-ASNIHAX4.js +2 -0
- package/dist/imports-JICEKDKK.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/members-C5H2K3MS.js +2 -0
- package/dist/methods-KZOZHSD4.js +2 -0
- package/dist/output-continuation-command-NX3RH3TP.js +3 -0
- package/dist/{output-pagination-VAWOGX4R.js → output-pagination-3OFL2MJV.js} +2 -2
- package/dist/project-reindex-A2SXUH2H.js +3 -0
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +2 -2
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.d.ts +2 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +3 -3
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +2 -2
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +3 -3
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +2 -2
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -2
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +3 -3
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +2 -2
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.d.ts +2 -2
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +4 -4
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -2
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +2 -2
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +3 -3
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +2 -2
- package/dist/refs-ZOORVRQC.js +2 -0
- package/dist/refs-pagination-SRCUOYRD.js +2 -0
- package/dist/reindex-worker.js +83 -66
- package/dist/reindex.d.ts +5 -3
- package/dist/reindex.js +93 -76
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +4 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-CppzF5MK.d.ts → scip-cli-H-n59izO.d.ts} +1 -1
- package/dist/slice-NOTBWA7S.js +2 -0
- package/dist/surface-BTBCLKNA.js +2 -0
- package/dist/symbol-resolution-SVSMX4RN.js +2 -0
- package/dist/system-2EIUFP6B.js +2 -0
- package/dist/trace-BB2GHQPG.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-OA7AHSUG.js +2 -0
- package/dist/watch-server.js +3 -3
- package/docs/CLI_JSON_OUTPUT.md +2 -2
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/schemas/project-config.schema.json +11 -1
- package/package.json +6 -5
- package/skills/scip-explore/SKILL.md +73 -3
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/delegated-exploration.md +51 -0
- package/skills/scip-explore/references/external-evidence.md +72 -0
- package/skills/scip-explore/references/information-model.md +51 -0
- package/skills/scip-explore/scripts/capture-evidence.mjs +666 -0
- package/skills/scip-query/SKILL.md +22 -1
- package/dist/by-kind-CI3O6PQG.js +0 -2
- package/dist/call-graph-6QTUTXH7.js +0 -2
- package/dist/chunk-2COFMIVK.js +0 -60
- package/dist/chunk-35ELD3RM.js +0 -2
- package/dist/chunk-3FQ3KMCD.js +0 -2
- package/dist/chunk-3VLJ2DCA.js +0 -2
- package/dist/chunk-4DCKBY6T.js +0 -5
- package/dist/chunk-4N6QSEMZ.js +0 -10
- package/dist/chunk-4OE2JO6I.js +0 -2
- package/dist/chunk-4UUCUASK.js +0 -554
- package/dist/chunk-54EOGFBR.js +0 -2
- package/dist/chunk-5ZJH6DDE.js +0 -2
- package/dist/chunk-63MBA7EG.js +0 -3
- package/dist/chunk-6T7H2AFY.js +0 -3
- package/dist/chunk-7COHFNJK.js +0 -38
- package/dist/chunk-7HU2IJ2T.js +0 -3
- package/dist/chunk-7PPYXENX.js +0 -2
- package/dist/chunk-AUP6YI5M.js +0 -2
- package/dist/chunk-CT5SI2I4.js +0 -2
- package/dist/chunk-D5EKVZPI.js +0 -2
- package/dist/chunk-DMQ7ZKJG.js +0 -81
- package/dist/chunk-ELNRLMC5.js +0 -29
- package/dist/chunk-F7WQ337U.js +0 -308
- package/dist/chunk-FN6EJM6Q.js +0 -2
- package/dist/chunk-FTSQNONX.js +0 -2
- package/dist/chunk-G2F6T5BV.js +0 -2
- package/dist/chunk-G6OGPXJW.js +0 -9
- package/dist/chunk-GFLTPNWV.js +0 -3
- package/dist/chunk-GTDP2SKQ.js +0 -2
- package/dist/chunk-HEOMG7IM.js +0 -8
- package/dist/chunk-I3U2FN2T.js +0 -13
- package/dist/chunk-IUJ3ZFEE.js +0 -7
- package/dist/chunk-LXLD46LH.js +0 -21
- package/dist/chunk-MEI3PTUK.js +0 -2
- package/dist/chunk-MO226P4Q.js +0 -4
- package/dist/chunk-MYUKI5VN.js +0 -4
- package/dist/chunk-OIRWZIYL.js +0 -38
- package/dist/chunk-OIVZ7PW6.js +0 -438
- package/dist/chunk-PNISDVYC.js +0 -3
- package/dist/chunk-PQOL42AW.js +0 -2
- package/dist/chunk-PUVZNFVY.js +0 -11
- package/dist/chunk-PZEI2TVL.js +0 -4
- package/dist/chunk-Q2J2VZZT.js +0 -2
- package/dist/chunk-QDCCHMVZ.js +0 -2
- package/dist/chunk-QLQBZOJH.js +0 -3
- package/dist/chunk-S73HBCGI.js +0 -11
- package/dist/chunk-SDPA5DKN.js +0 -210
- package/dist/chunk-SEUJVWT2.js +0 -3
- package/dist/chunk-SF7X6QNW.js +0 -2
- package/dist/chunk-SWFAFA4G.js +0 -49
- package/dist/chunk-T6FRID7Y.js +0 -3
- package/dist/chunk-TNOHGHZQ.js +0 -2
- package/dist/chunk-U2GPTA5U.js +0 -3
- package/dist/chunk-URTX2BEA.js +0 -6
- package/dist/chunk-VGRUM7JI.js +0 -3
- package/dist/chunk-VWLIOEEF.js +0 -11
- package/dist/chunk-YIEFEPG6.js +0 -16
- package/dist/chunk-YRVERHJR.js +0 -49
- package/dist/chunk-ZD3Z54IW.js +0 -2
- package/dist/chunk-ZDVDSDFG.js +0 -4
- package/dist/code-EQL6ZBLH.js +0 -2
- package/dist/code-result-json-6E4J6LGZ.js +0 -2
- package/dist/command-descriptors-QH3G2OVD.js +0 -346
- package/dist/dataflow-2BLMUZBP.js +0 -2
- package/dist/dependence-slice-MGAJDZXB.js +0 -2
- package/dist/deps-GQMUYVKW.js +0 -2
- package/dist/direct-navigation-6RUJKLAV.js +0 -3
- package/dist/entry-map-V2NQP5JU.js +0 -2
- package/dist/files-VM53I4IU.js +0 -2
- package/dist/hierarchy-D553WRSZ.js +0 -2
- package/dist/imports-DOZAJWLW.js +0 -2
- package/dist/members-HE67475K.js +0 -2
- package/dist/methods-K5JK4PPH.js +0 -2
- package/dist/output-continuation-command-LKBUTNRL.js +0 -3
- package/dist/project-reindex-4ARU6QCM.js +0 -3
- package/dist/refs-NBHKL4UQ.js +0 -2
- package/dist/refs-pagination-BBVTIHMH.js +0 -2
- package/dist/slice-U6S6LBSB.js +0 -2
- package/dist/surface-C7SS5CDQ.js +0 -2
- package/dist/symbol-resolution-3FVEKDTJ.js +0 -2
- package/dist/system-6K2NOO5C.js +0 -2
- package/dist/trace-II5K2TMH.js +0 -2
- package/dist/value-flow-MKFUUE5B.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as le}from"./chunk-OG5UK2K7.js";import{a as de}from"./chunk-SGSPCEFC.js";import{a as pe}from"./chunk-RNKRYK6B.js";import{a as he}from"./chunk-6YTSKJJ3.js";import{a as ge}from"./chunk-IGBQVEHE.js";import{a as se}from"./chunk-PX6QNUYF.js";import{a as ue}from"./chunk-BVR44XXB.js";import{a as ce}from"./chunk-WZRNEVYC.js";import{a as oe}from"./chunk-MLTKGHD2.js";import{a as ae}from"./chunk-BCTCADNB.js";import{a as ne}from"./chunk-MRXBLYRE.js";import{a as me}from"./chunk-C52Q3JEQ.js";import{a as ie}from"./chunk-4HQYNZ3P.js";import{a as re}from"./chunk-NT4NVEHU.js";import{a as J}from"./chunk-KFFQURUZ.js";import{b as ee}from"./chunk-QLWZUFDT.js";import{a as Z}from"./chunk-DGM2RJ3I.js";import{b as te}from"./chunk-XDAUYDFT.js";import{a as M,b as U}from"./chunk-ZNW5A5VX.js";import{b as Y}from"./chunk-47WX6UC4.js";import{a as K}from"./chunk-BYXWXLKM.js";import{a as X}from"./chunk-JLZWYDCZ.js";import{f as Q}from"./chunk-MLTSTKXD.js";import{a as W}from"./chunk-4TOU7HHQ.js";import{f as A,h as T}from"./chunk-743MEVFJ.js";import{a as G}from"./chunk-6LS3IG2I.js";import{C as O,z as j}from"./chunk-C7WSQA6A.js";import{z as k}from"./chunk-JSHDCVUM.js";import{ua as q,va as z}from"./chunk-WEXQYJY3.js";import{readdirSync as Ye}from"fs";import{basename as Xe,join as fe}from"path";function Qe(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(s=>!i.has(s)).sort(),a=t.allowExtra?[]:[...i].filter(s=>!n.has(s)).sort();return{missing:o,extra:a}}function Je(e,r){let t=Ze(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=ot(e.config.projectRoot,r.mustEqual),n=Qe(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function ve(e,r){return r.map(t=>Je(e,t))}function Ze(e,r,t){return t.type==="markdown-list"?nt(e,r,t.marker):et(e,r,t)}function et(e,r,t){if(!k(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=j(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=O(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?tt(o,t.identifier):it(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function be(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function tt(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type==="object")return rt(n)}return null}function rt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(ye(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function it(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(ye(a.text));return[...o].sort()}return null}function ye(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function nt(e,r,t){let i=k(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=Se(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:xe(n)}}function Se(e,r){let t=G(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function xe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function ot(e,r){switch(r.type){case"top-level-dirs":return Ce(fe(e,r.path));case"file-glob":return[...new Set(W(e,r.pattern).map(t=>Xe(t)))].sort();case"registered-commands":return at(e);case"builtin-skills":return Ce(fe(e,"skills"))}}function Ce(e){let r;try{r=Ye(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function at(e){let r;try{r=q(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!z(i))throw i;return[]}let t=Se(r,"COMMAND REFERENCE");return t?xe(t):[]}function h(e){return e.scoreCount??e.count}function B(e){let r=lt(e),{breakdown:t,pressure:i}=dt(e),n=He(t,"risk"),o=He(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:h(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:h(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:h(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:st(e),validation:ut(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}function st(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ct(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ct(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:p(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ut(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[v,g]of Object.entries(r))i.has(v)?n+=g.fixChanges:(o+=g.fixChanges,a+=1);let s=i.size>0?p(n/i.size):0,l=a>0?p(o/a):0,S={};for(let[v,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let b=0;for(let R of f)b+=r[R]?.fixChanges??0;let x=p(b/f.size);S[v]={flaggedFiles:f.size,fixDensity:x,lift:l>0?p(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?p(s/l):null,byCategory:S,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function p(e){return Math.round(e*100)/100}function Ee(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function E(e,r="existing shared infrastructure discount"){let t=h(e);return Math.abs(t-e.count)<.01?"":` (${Ee(t)} score-weighted after ${r})`}function y(e,r){let t=h(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Ee(t)} score-weighted)`}function lt(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${E(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${E(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} single-consumer symbols${E(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+E({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var we={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function He(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function dt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(d,w,C)=>{w>0&&i.push({axis:d,points:w,detail:C,kind:we[d]??"hygiene"})},a=(d,w,C,je,Oe,We,Ue)=>{let H=Math.max(je,1);if(C<=H)return;let D=C/H,P=Math.min(Oe,Math.ceil(Math.log2(D)*We));if(P<=0)return;let Ke=we[d]??"hygiene";n.push({axis:d,category:w,kind:Ke,count:C,threshold:p(H),ratio:p(D),extraPenalty:P}),o(d,P,`${C} ${Ue} exceed pressure threshold ${p(H)} (${p(D)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let v=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(v*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let g=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(g*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let f=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(f)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let b=h(e.reactHookCandidates),x=b/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(x)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Fe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Fe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let _=h(e.vueComposableCandidates),qe=_/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(qe)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=h(e.wrappers);o("wrappers",Math.min(3,I),y(e.wrappers,"wrapper candidate(s)"));let F=h(e.passthroughs);o("passthroughs",Math.min(3,F),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Ge=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Ge*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(d/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:d},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",d,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",b,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",_,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var m={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as mt}from"v8";var pt=64*1024*1024;function $(){let e=globalThis.gc;if(!e)return;let r=mt();r.heap_size_limit-r.used_heap_size<pt||e()}var ht=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Le(e=new Set(["indexed-graph","source-facts"])){return ht.map(r=>{let t=r.relationRequirements.map(n=>{let o=te(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var gt=50,ft=25e3,Ct=2500,Re=2500,De=50,vt=10,bt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ae={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:xt(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:wt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:Ht(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Et(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:Rt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:Dt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Pt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:kt(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:At(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Tt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Mt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Bt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Lt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:$t(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Vt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Nt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:qt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:zt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:_t(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:It(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ft(e,t)})};function zr(e,r={}){return Te(e,r.full!==!1,(t,i)=>{let n=St(e,r.scope,t,i);return B(n)})}function Gr(e,r,t={}){return yt(e,[r],t)[0]}function yt(e,r,t={}){return Te(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ae[a](e,t.scope,o,i))})}function Te(e,r,t){let i=he(e),n=Gt(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),$()}}function jr(e){return B(Me(e))}function Me(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Le(),dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Pe(e,"git-evidence")?.gitEvidence??null,suppressions:Pe(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Pe(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function St(e,r,t,i){return Me(bt.map(n=>Ae[n](e,r,i,t)))}function xt(e,r,t){return c(e,t,"dead",()=>{let i=U(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Wt(e,i.symbols))})}function wt(e,r,t){return c(e,t,"isolated",()=>{let i=ne(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Ut(e,i))})}function Ht(e,r,t){return c(e,t,"cycles",()=>J(e,{scope:r}).filter(n=>n.kind==="real").length)}function Et(e,r,t){let i=c(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Lt(e,r,t){return c(e,t,"extract-candidates",()=>ie(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function Rt(e,r,t){return c(e,t,"duplicate-bodies",()=>{let i=Z(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i)for(let s of a.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function Dt(e,r,t){return c(e,t,"twin-drift",()=>{let i=ee(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let s of a.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Pt(e,r,t){return c(e,t,"react-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function kt(e,r,t){return c(e,t,"react-hook-candidates",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Yt)})}function At(e,r,t){return c(e,t,"react-large-component-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Kt(i)})}function Tt(e,r,t){return c(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Mt(e,r,t){return c(e,t,"vue-composable-candidates",()=>{let i=ue(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Xt)})}function Bt(e,r,t){return c(e,t,"vue-large-view-pressure",()=>{let i=le(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return L(i)})}function $t(e,r,t){return c(e,t,"wrapper-candidates",()=>{let i=de(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Qt)})}function Vt(e,r,t){return c(e,t,"passthrough-candidates",()=>{let i=me(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Jt)})}function Nt(e,r,t){return c(e,t,"stale-abstractions",()=>{let i=pe(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function _t(e,r){return c(e,r,"git-evidence",()=>{let t=K(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=Y(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,l]of i)a[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:N(o.findings.reduce((s,l)=>s+ke(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:ke(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function It(e,r){return c(e,r,"suppressions",()=>{let t=ge(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ft(e,r){return c(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=ve(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function qt(e,r,t){return c(e,t,"drift",()=>{let i=re(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function zt(e,r,t){return c(e,t,"complexity-hotspots",()=>{let i=X(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>gt).length}})}function Gt(e,r){let t=e.symbols>=ft||e.documents>=Ct,i=r?Number.POSITIVE_INFINITY:De,n=r?Number.POSITIVE_INFINITY:vt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:Re,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${Re} symbols and reported their top ${De} findings. Enable full mode for unbounded candidate counts.`]}}function jt(e,r){r.releaseCachesBetweenPhases&&(M(e),$())}function c(e,r,t,i){Ot(t);try{return i()}finally{jt(e,r)}}function Ot(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Wt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ut(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath))}function L(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Be(e,r){return{...L(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Kt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function $e(e,r){return{...V(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Yt(e){let r=e.sharedHooks.length>0,t=Ve({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Ne(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Xt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ve({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ne(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ve(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Ie.has(_e(r))).length+Math.min(e.functions.length,3)}function Ne(e,r,t){let i=[...e,...r,...t].map(_e);return i.length>0&&i.every(n=>Ie.has(n))}function _e(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Qt(e){return e.actionTier==="signal"?.25:1}function Jt(e){return e.actionTier==="signal"?.25:1}function ke(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function N(e){return Math.round(e*100)/100}var Ie=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{m as a,bt as b,zr as c,Gr as d,yt as e,jr as f};
|
|
2
|
+
//# sourceMappingURL=chunk-6DO3VBLV.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{A as Q,B as Qe,C as D,D as Z,E as Ze,F as be,G as et,H as ie,J as tt,e as qe,f as Ve,g as P,h as ze,i as We,j as He,k as q,l as Ke,m as K,n as Je,o as Xe,p as Ge,q as F,r as J,s as L,t as ge,u as Se,v as S,w as he,x as Ye,y as xe,z as Y}from"./chunk-C7WSQA6A.js";import{a as Ue,c as U,f as oe,i as H,p as ye,w as X,y as G,z as A}from"./chunk-JSHDCVUM.js";import{c as W,ua as $e,va as Be}from"./chunk-WEXQYJY3.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vt(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function ns(e){return rt(e,{maskStrings:!1})}function ss(e){return rt(e,{maskStrings:!0})}function rt(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
|
|
2
|
+
`,n),a=i===-1?s:i;t+=Ne(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=Ne(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
|
|
3
|
+
`)break;a+=1}t+=r.maskStrings?Ne(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function Ne(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
|
|
4
|
+
`?`
|
|
5
|
+
`:" ";return n}function k(e){return e.replace(/[^\r\n]/g," ")}var os=oe("stripped-lines",{clearGroups:["whole-project","source-file"]});Ue({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{ae=null,ee=""},clearFile:()=>{ae=null,ee=""}});var ae=null,ee="";function Mt(e){return ae===e||(ae=e,ee=vt(e)),ee}function w(e,r,t){let n=Mt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function V(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Ie(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}function Ce(e,r){r(e);for(let t of e.namedChildren)Ce(t,r)}function $t(e,r,t){let n=null;return Ce(e,s=>{!/(?:function|method|lambda)/u.test(s.type)&&s.type!=="arrow_function"||s.startPosition.row>r||s.endPosition.row<t||(!n||s.endIndex-s.startIndex<n.endIndex-n.startIndex)&&(n=s)}),n}function nt(e,r,t){if(e.startPosition.row>r||e.endPosition.row<t)return null;for(let n of e.namedChildren){let s=nt(n,r,t);if(s)return s}return e}function Bt(e){let r=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(r.type)&&r.namedChildren.length>0;)r=r.namedChildren[0];return r}function _e(e){if(e.type==="identifier")return e.text;let r=e.childForFieldName("name")??e.childForFieldName("pattern");return r?_e(r):e.namedChildren.find(t=>t.type==="identifier")?.text??null}function Ut(e){return(e.childForFieldName("parameters")??e.namedChildren.find(t=>/parameters/u.test(t.type)))?.namedChildren.map(_e)??[]}var qt=new Set(["identifier","type_identifier","field_identifier"]),Vt=new Set(["identifier"]),zt=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Wt=new Set(["rust","python"]),Ht=/\{([^{}]*)\}/g,Kt=/\b([A-Za-z_][\w]*)\b/g;function st(e,r){return Jt(r).has(e.type)}function ot(e,r){return Wt.has(r)&&e.type==="string_content"}function Pe(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function Jt(e){return e==="rust"?qt:e==="python"?Vt:zt}function it(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(Ht)){let s=n[1]??"";for(let o of s.matchAll(Kt))o[1]&&r(o[1],t)}}var Xt=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Gt=/^#!?\[\s*serde\s*\(/,Yt=/^#!?\[\s*schemars\s*\(/,Qt=/^#!?\[\s*validate\s*\(/,Zt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function at(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=be(n);if(!s||!Zt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function ct(e,r){let t=Gt.test(e),n=Yt.test(e),s=Qt.test(e);if(!(!t&&!n&&!s))for(let o of Xt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function lt(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(p=>p.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&o(c,a);let l=i.namedChildren.find(p=>p.type==="block");if(l)for(let p of l.descendantsOfType("type"))for(let u of p.descendantsOfType("identifier"))u.text!==a&&n(u.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var er=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Te=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function pt(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
6
|
+
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=le(e,a);continue}if(l==='"'){let h=re(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,tr(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Re(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ee(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let f={text:m,line:p};rr(o[o.length-1],f),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:ar(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function tr(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=er.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(nr(e,r),!n||Te.has(t.text)||Te.has(n)||n.startsWith(":"))return;let o=ir(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function rr(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function nr(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ce(e))te(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of ce(e))te(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ce(e))te(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of ce(e)){n&&te(r,n,"extension",s,"extension-method");let o=or(e,s.startLine);o&&o!==n&&te(r,o,"extension",s,"extension-method")}}}function ce(e){return e.children.filter(sr)}function sr(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!Te.has(r)&&!r.startsWith(":"))}function te(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function or(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function ir(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function le(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
7
|
+
`;)t+=1;return t}function re(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
8
|
+
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Re(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ee(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function ar(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var ut=6,cr=oe("source-facts",{clearGroups:["whole-project","source-file"]}),Fe=X({kind:"source-facts",invalidation:G("source-facts"),serialize:mr,deserialize:fr});function R(e,r){return lr(e,r).facts}function lr(e,r){let t=A(e,r);if(!t)return{facts:null};let n=pr(e,r,t);return n?cr.get(e,r,t,()=>ur(e,r,n,t)):{facts:null}}function pr(e,r,t){return Q(r)?Qe(e,r,t)?.language??null:Y(r)}function ur(e,r,t,n){let s=H(e,r,n),o=Fe.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=pt(n);return Fe.write(e,r,s,c),{facts:c}}let i=D(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=hr(i,t);return Fe.write(e,r,s,a),{facts:a}}function mr(e){let r={version:ut,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function fr(e){try{let r=JSON.parse(e);if(r.version!==ut||r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:Pe(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function dr(e,r,t,n){let s=R(e,r);return s?Sr(s,t,n)?.isLiteralPassthrough??!0:!0}function gr(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:R(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function Sr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function hr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=ie(l,r);p&&t.push(p);let u=Ze(l,r);u&&n.push(u),at(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&ct(l.text,s),st(l,r)&&a(l.text,l.startPosition.row),ot(l,r)&&it(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:lt(e,r),identifierLineMap:i,identifiersByLine:Pe(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var mt=new Set(["rust","typescript","tsx","javascript","python","clojure"]),xr=new Set(["rust","typescript","tsx","javascript","python"]);function yr(e,r){let t=R(e,r);return!t||!mt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function br(e,r){if(!xr.has(r))return null;let t=[];for(let n of e.descendantsOfType([...et(r)])){let s=ie(n,r);s&&t.push({name:s.name,startLine:s.startLine,endLine:s.endLine})}return t}function Nr(e,r){let t=R(e,r);return!t||!mt.has(t.language)?null:t.callSites}function Ir(e,r){return R(e,r)?.typeContainerMap??new Map}function Cr(e,r,t={}){let n=R(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as ft}from"path";var _r=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&_r.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function T(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Ge(r)),kind:"named",used:x(t,o),usedMembers:[]}}function d(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function E(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function v(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function M(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=w(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n,s){let o=Z(e,r,s)?.tree??null;if(o){let i=t(o);if(i)return i}return n()}function pe(e,r,t,n,s){let o=Z(e,r,s)?.tree??null,i=Y(r),a=i?t[i]:void 0;return o&&a?a(o):n()}function dt(e,r,t){return C(e,r,n=>Tr(e,r,n),()=>Pr(e,r,t),t)}function Pr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=ft(o).replace(/\.[^.]+$/,"");return[E(o,i,Se(e,r,o),x(s,i))]})}function Tr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=ft(i).replace(/\.[^.]+$/,"");s.push(d(i,a,Se(e,r,i),n))}return s}var Rr=new Set([":require",":require-macros",":use"]),ke=String.raw`A-Za-z0-9_$*+!?.<>=-`;function St(e,r,t){let n=Mr(t);if(!n)return[];let s=vr(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=_(i.children[0]);if(a){if(Rr.has(a)){for(let c of Lr(i.children.slice(1)))o.push(...Fr(e,c,s));continue}if(a===":import")for(let c of kr(i.children.slice(1)))o.push(c)}}return o}function Er(e){return e.type==="list"&&_(e.children[0])==="ns"}function Fr(e,r,t){let n=Ye(e,r.namespace),s=r.alias??r.namespace,o=jr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||Dr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:Or(t,a),usedMembers:[]});return i}function Lr(e){return e.flatMap(r=>ue(r,null))}function ue(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Ae(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&_(e.children[0])===null?e.children.flatMap(t=>ue(t,r)):Ar(e,r);if(e.type==="list"&&e.children.length>0){let t=_(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ue(n,Ae(r,t))):e.children.flatMap(n=>ue(n,r))}return[]}function Ar(e,r){let t=_(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:Ae(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=_(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=_(i),s+=1;continue}o===":refer"&&i&&(_(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(_).filter(wr)),s+=1)}return[n]}function kr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(E(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=_(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=_(s);o&&r.push(E(`${n}.${o}`,o,null,!0))}}return r}function Ae(e,r){return e?`${e}.${r}`:r}function _(e){return e?.type==="atom"?e.text:null}function wr(e){return!!(e&&!e.startsWith(":"))}function jr(e,r){let t=new Set,n=new RegExp(`${we()}${O(r)}\\s*/\\s*([${ke}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Dr(e,r){return new RegExp(`${we()}${O(r)}\\s*/`,"m").test(e)}function Or(e,r){return new RegExp(`${we()}${O(r)}(?![${ke}])`,"m").test(e)}function we(){return`(?<![${ke}])`}function vr(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
9
|
+
`?`
|
|
10
|
+
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=le(e,s);n+=gt(e.slice(s,i)),s=i;continue}if(o==='"'){let i=re(e,s,0).index;n+=gt(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Mr(e){let r=0;for(;r<e.length&&(r=je(e,r),!(r>=e.length));){let t=me(e,r);if(!t){r+=1;continue}if(Er(t.form))return t.form;r=t.index}return null}function me(e,r){let t=je(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return $r(e,t);if(e.startsWith("#_",t)){let s=me(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Re(e[t]);)t+=1;let n=e[t];return n?n==="("?Le(e,t,"list",")"):n==="["?Le(e,t,"vector","]"):n==="{"?Le(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:re(e,t,0).index},index:re(e,t,0).index}:Ur(e,t):null}function $r(e,r){let t=e.startsWith("#?@",r)?3:2,n=me(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Br(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Br(e){let r=[];for(let t=0;t<e.length;t+=2){let n=_(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Le(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=je(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=me(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Ur(e,r){let t=r;for(;t<e.length&&!Ee(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function je(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=le(e,t);continue}break}return t}function gt(e){return e.replace(/[^\r\n]/g," ")}function ht(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=w(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:he(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?V(c,i):[]})}return n}function xt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:he(e,r,o)})}return n}function yt(e,r,t){return pe(e,r,{csharp:n=>Vr(e,r,n),vb:n=>qr(e,r,n)},()=>{let n=Xe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[T(e,r,o,p,u,m,S(e,p,q))]})},t)}function qr(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,q),n,c?"namespace":"named"))}return s}function Vr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,q),n,a?"namespace":"named"))}return s}var zr=U("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function bt(e,r){return zr.get(e,r,()=>{let t=new Set,n=A(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function De(e,r,t){return C(e,r,n=>Hr(e,r,n),()=>Wr(e,r,t),t)}function Wr(e,r,t){return nn(t).flatMap(n=>sn(e,r,n.clause,n.specifier,n.start,n.end,t))}function Hr(e,r,t){let n=Kr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Jr(e,r,t,o,n));return s}function Kr(e,r,t){let n=g(t,new Set(["import_statement"]));if(Q(r))for(let s of bt(e,r))n.add(s);return n}function Jr(e,r,t,n,s){let o=Zr(n);if(!o)return[];let i=F(e,r,o),a=b(n,"import_clause");return a?Xr(t,a,i,s,en(n.text)):[v("*",i)]}function Xr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Gr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=Yr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Qr(i,t,n,s));return o}function Gr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function Yr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=rn(e,i);return M("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Qr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||tn(o.text)}))}return s}function Zr(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function en(e){return/^\s*import\s+type\b/.test(e)}function tn(e){return/^\s*type\b/.test(e.trim())}function rn(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function nn(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function sn(e,r,t,n,s,o,i){let a=F(e,r,n),c=w(i,s,o);return t?on(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=V(c,p.localName);return M(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?v(p.importedName,p.sourcePath):E(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[v("*",a)]}function on(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=an(n),i=[];return s&&i.push(...Nt(s,t)),o&&i.push(...Nt(o,t)),i}function Nt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function an(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Oe(e,r,t){let n=D(e,r);return n?fn(e,r,n):cn(e,r,t)}function cn(e,r,t){return[...ln(e,r,t),...pn(e,r,t),...un(e,r,t)]}function ln(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>mn(u.trim())).filter(u=>!!u),l=z(t,o.index),p=z(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:F(e,r,a),names:c,startLine:l,endLine:p})}return n}function pn(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:F(e,r,i),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return n}function un(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:F(e,r,i),names:[],startLine:a,endLine:c})}return n}function mn(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function z(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function fn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=dn(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=gn(s,o,i,a);n.push(c)}return n}function dn(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return F(e,r,s.text)}function gn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}let o=b(e,"namespace_export");if(o){let i=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:r,names:i?[i]:[],startLine:t,endLine:n}}return{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function It(e,r,t){return pe(e,r,{java:n=>Sn(e,r,n),kotlin:n=>hn(e,r,n),scala:n=>xn(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?yn(e,r,o,s):[]}),t)}function Sn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(M("*",S(e,l,P)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,P),n))}return s}function hn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(M("*",S(e,i.text,P)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,P),n))}return s}function xn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(M("*",S(e,c,P)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,P),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,P),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,P),n))}return s}function yn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[T(e,r,n,m,p,u)]})}return[T(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function _t(e,r,t){return C(e,r,n=>bn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[T(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),K))]}):[]}),t)}function bn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),K),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=Ct(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=Ct(c,"");l&&o(u,l,p)}}return s}function Ct(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function Tt(e,r,t){return C(e,r,n=>Nn(e,r,n),()=>Cn(t).flatMap(n=>Pn(e,r,n,t)),t)}function Nn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Pt(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=In(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=Pt(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function Pt(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function In(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function Cn(e){let r=e.split(`
|
|
11
|
+
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=Ie(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
12
|
+
${m}`,l+=1+m.length,p+=Ie(m),n+=m.length+1}let u=_n(c);u&&t.push({...u,start:a,end:l})}return t}function _n(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function Pn(e,r,t,n){let s=w(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=V(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as Tn}from"path";function Rt(e,r,t){return C(e,r,n=>En(e,r,n),()=>Rn(e,r,t),t)}function Rn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?ge(e,r,i):null;if(a){let c=Et(i);return[E(c,c,a,x(s,c))]}return[v(i,a)]})}function En(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?ge(e,r,u):null;if(m){let f=Et(u);s.push(d(f,f,m,n))}else s.push(v(u,m))}return s}function Et(e){return tt(Tn(e).replace(/\.[^.]+$/,""),/_/)}function Ft(e,r,t){return C(e,r,n=>Fn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?Ln(e,r,o,s):[]}),t)}function Fn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of ne(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=L(e,r,a.qualifiedName)??L(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function ne(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:fe(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:fe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=fe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...ne(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...ne(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=ne(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:fe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function fe(e,r){return e?r?`${e}::${r}`:e:r}function Ln(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let de=p.split("::").filter(Boolean).pop();return de?[T(e,r,n,p,de,de)]:[]}let[h,$]=f.split(/\s+as\s+/),B=h?.trim();if(!B)return[];let Dt=($??B.split("::").pop()??B).trim(),Ot=`${p}::${B}`.replace(/::::/g,"::");return[T(e,r,n,Ot,B.split("::").pop()??B,Dt,L(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=L(e,r,a)??L(e,r,a.split("::").slice(0,-1).join("::"));return[T(e,r,n,a,a.split("::").pop()??a,c,l)]}function Lt(e,r,t){let n=D(e,r);if(n)return An(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...wn(e,r,i))}return s}function An(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!kn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of ne(o,""))i.importedName&&n.push(ve(e,r,i.qualifiedName))}return n}function kn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function wn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[ve(e,r,l)]})}return[ve(e,r,n)]}function ve(e,r,t){return{specifier:t,sourcePath:L(e,r,t)??L(e,r,t.split("::").slice(0,-1).join("::"))}}function j({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function At(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var jn={language:"javascript",extensions:qe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:De,parseReExports:Oe},Dn=j({language:"python",extensions:Ve,imports:"ast-with-regex-fallback",parseImports:Tt}),On=j({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:It}),vn={language:"rust",extensions:ze,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ft,parseExports:Lt},Mn=j({language:"ruby",extensions:We,imports:"ast-with-regex-fallback",parseImports:Rt}),$n=j({language:"c/cpp",extensions:He,imports:"ast-with-regex-fallback",parseImports:dt}),Bn=j({language:"dotnet",extensions:q,imports:"ast-dispatch-with-regex-fallback",parseImports:yt}),Un={language:"dart",extensions:Ke,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ht,parseExports:xt},qn=j({language:"php",extensions:K,imports:"ast-with-regex-fallback",parseImports:_t}),Vn=j({language:"clojure",extensions:Je,imports:"regex-only",parseImports:St}),zn=[jn,Dn,On,vn,Mn,$n,Bn,Un,qn,Vn];function se(e){return At(zn,e)}var Me={clearGroups:["whole-project","source-file"]},Wn=U("source-imports",Me),Hn=U("source-exports",Me),Kn=U("source-reexports",Me),kt=X({kind:"source-imports",invalidation:G("source-imports"),serialize:Xn,deserialize:Gn}),wt=X({kind:"source-reexports",invalidation:G("source-reexports"),serialize:Yn,deserialize:Qn});function di(e,r){let t=W(r);return Kn.get(e,t,()=>{let n=se(t);if(!n?.parseReExports)return[];let s=A(e,t);if(!s)return[];let o=H(e,t,s),i=xe(e),a=wt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return wt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Jn(e,r){let t=W(r);return Wn.get(e,t,()=>{let n=se(t);if(!n)return[];let s=A(e,t);return s?jt(e,t,s,n):[]})}function gi(e,r){let t=W(r),n=se(t);if(!n)return[];let s;try{s=$e(e.config.projectRoot,t,{inputKind:"indexed source file"})}catch(o){if(Be(o))return[];throw o}return jt(e,t,s,n)}function jt(e,r,t,n){let s=H(e,r,t),o=xe(e),i=kt.read(e,r,s);if(i?.resolutionFingerprint===o)return i.imports;let a=n.parseImports(e,r,t);return kt.write(e,r,s,{parserVersion:2,resolutionFingerprint:o,imports:a}),a}function Si(e,r,t){let n=Jn(e,r).filter(s=>s.kind==="named"&&s.isTypeOnly!==!0&&s.localName===t&&s.sourcePath!==null);return n.length===1?n[0]:null}function hi(e,r){let t=W(r);return Hn.get(e,t,()=>{let n=se(t);if(!n?.parseExports)return[];let s=A(e,t);return s?n.parseExports(e,t,s):[]})}function Xn(e){return JSON.stringify(e)}function Gn(e){try{let r=JSON.parse(e);return!ye(r)||r.parserVersion!==2||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{parserVersion:2,resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function Yn(e){return JSON.stringify(e)}function Qn(e){try{let r=JSON.parse(e);return!ye(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,vt as b,ns as c,ss as d,Ie as e,Ce as f,$t as g,nt as h,Bt as i,_e as j,Ut as k,R as l,lr as m,dr as n,gr as o,yr as p,br as q,Nr as r,Ir as s,Cr as t,fe as u,di as v,Jn as w,gi as x,Si as y,hi as z};
|
|
13
|
+
//# sourceMappingURL=chunk-6LS3IG2I.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-OMVNRPST.js";import{a as t}from"./chunk-YDTK77JP.js";function a(e,o){let r=i(e,o);return r?t(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=i(e,o);return r?t(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6QN4FYQW.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as Y}from"./chunk-LGVTIZPV.js";import{e as j,k as w,m as H,n as Q,o as Z}from"./chunk-FOP7HD6H.js";import{F as A,G as D,H as V,J as X,o as K,q as M,u as b,v as $}from"./chunk-WEXQYJY3.js";import{spawn as Se}from"child_process";import{platform as ee}from"os";import{performance as te}from"perf_hooks";var ft={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},h=class extends Error{constructor(n,r,s,a={}){super(s,a.cause===void 0?void 0:{cause:a.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=a.timedOut??!1,this.reaped=a.reaped??!1,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.stdoutTruncated=a.stdoutTruncated??!1,this.stderrTruncated=a.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function v(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function ne(e,t,n,r){let s=Math.max(0,r-n);s>0&&e.push(t.subarray(0,s))}function re(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function mt(e){v(e.timeoutMs,"timeoutMs"),v(e.maxStdoutBytes,"maxStdoutBytes"),v(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;v(t,"terminationGraceMs");let n=e.terminationForceMs??t;return v(n,"terminationForceMs"),new Promise((r,s)=>{let a=te.now(),i=ee()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=ee()!=="win32"&&!i,o;try{o=Se(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:c?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(d){let f=d instanceof Error?d.message:String(d);s(new h("spawn",e.label,`${e.label} could not start: ${f}`,{cause:d,reaped:!0}));return}let u=[],g=[],l=0,m=0,R=!1,x=!1,p=null,y=!1,z=o.pid===void 0?null:Q(o.pid,c),P=()=>{clearTimeout(U),e.signal?.removeEventListener("abort",I)},E=d=>{if(y||!p)return;y=!0,P();let f=Buffer.concat(u).toString("utf8"),_=Buffer.concat(g).toString("utf8"),N=d.reaped||!d.detail?"":` Process-tree cleanup failed: ${d.detail}`;s(new h(p.kind,e.label,`${p.message}${N}`,{timedOut:p.timedOut,reaped:d.reaped,stdout:f,stderr:_,stdoutTruncated:R,stderrTruncated:x}))},B=d=>{if(!(p||y)){if(p=d,!z){E({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}Z(z,{gracefulMs:t,forceMs:n}).then(E,f=>{E({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},U=setTimeout(()=>{B({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);U.unref();let I=()=>{B({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",I,{once:!0}),e.signal?.aborted&&I(),o.stdout.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?re(u,f,e.maxStdoutBytes):ne(u,f,l,e.maxStdoutBytes),l+=f.length,l>e.maxStdoutBytes&&(R=!0,e.outputLimitBehavior!=="truncate-tail"&&B({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?re(g,f,e.maxStderrBytes):ne(g,f,m,e.maxStderrBytes),m+=f.length,m>e.maxStderrBytes&&(x=!0,e.outputLimitBehavior!=="truncate-tail"&&B({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",d=>{if(!y&&!p){if(o.pid===void 0){P(),y=!0,s(new h("spawn",e.label,`${e.label} could not start: ${d.message}`,{cause:d,reaped:!0}));return}B({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${d.message}`})}}),o.on("close",(d,f)=>{if(y||p)return;y=!0,P();let _=Buffer.concat(u).toString("utf8"),N=Buffer.concat(g).toString("utf8");r({status:d,signal:f,stdout:_,stderr:N,timedOut:!1,durationMs:te.now()-a,stdoutTruncated:R,stderrTruncated:x})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}import{execFileSync as ie}from"child_process";import{createRequire as Le}from"module";import{existsSync as Ae}from"fs";import{platform as S,arch as se}from"os";var L="v0.8.1",J="https://github.com/sourcegraph/scip",T=`github.com/sourcegraph/scip/cmd/scip@${L}`,ae=Le(import.meta.url),oe="SCIP_QUERY_SCIP_BIN";function we(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let t=e.env[oe];if(t&&e.fileExists(t))return{source:"env",path:t};if(e.platform==="win32"){let n=e.resolveSidecar(e.arch);if(n&&e.fileExists(n))return{source:"sidecar",path:n}}return null}function Te(e){for(let t of e==="arm64"?["arm64","x64"]:[e])try{return ae.resolve(`scip-query-scip-windows/scip-win32-${t}.exe`)}catch{}return null}function W(e=process.env){let t=we({platform:S(),arch:se(),env:e,isOnPath:w,fileExists:Ae,resolveSidecar:Te});return t?.source==="path"?H("scip")??t.path:t?.path??null}function vt(){return W()!==null}function Oe(){let e=W();if(!e)return null;try{return ie(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function ke(){let e=S(),t=se(),n,r,s;switch(e){case"darwin":n="darwin",s="tar.gz";break;case"linux":n="linux",s="tar.gz";break;default:return null}switch(t){case"arm64":r="arm64";break;case"x64":r="amd64";break;default:return null}let a=`scip-${n}-${r}.${s}`;return{url:`${J}/releases/download/${L}/${a}`,filename:a}}function ht(){let e=ke();if(console.log("\nThe `scip` CLI is required but not found on PATH.\n"),S()==="darwin"||S()==="linux")console.log("Install the reviewed version with Go:"),console.log(` go install ${T}
|
|
2
|
+
`),console.log("Or download that exact release manually:");else if(S()==="win32"){let t=Pe();console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(` npm install -g ${t}`),console.log(`Or set ${oe} to a local scip.exe path.
|
|
3
|
+
`),console.log("Upstream release page:")}else console.log("Download from:");console.log(e?` ${e.url}
|
|
4
|
+
`:` ${J}/releases/tag/${L}
|
|
5
|
+
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function Pe(){let t=ae("../../package.json").optionalDependencies?.["scip-query-scip-windows"];if(!t||!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(t))throw new Error("scip-query package metadata does not declare an exact Windows sidecar version.");return`scip-query-scip-windows@${t}`}function St(e){if(w("go")){e(`Installing immutable ${T} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(ie("go",["install",T],{stdio:"inherit",timeout:3e5,env:process.env}),w("scip")){let t=W(),n=Oe();if(t&&n&&n.includes(L))return e(`Successfully installed ${T}; resolved executable: ${t}; reported version: ${n}.`),!0;e(`go install completed, but the resolved scip executable did not report ${L} (executable: ${t??"unresolved"}; version: ${n??"unavailable"}).`)}}catch(t){let n=t instanceof Error?t.message:String(t);e(`go install failed: ${n}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${J}/releases`),!1}var ue=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as me,statSync as Ue}from"fs";import{dirname as be,join as xe}from"path";import{appendFileSync as Ee,existsSync as Ie,mkdirSync as _e,renameSync as Ne,rmSync as Me,statSync as $e,truncateSync as De}from"fs";import{basename as Je,dirname as We}from"path";var O=".previous",Ce=".rotation.lock",Fe=2e3,C=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},F=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},de=Object.freeze({monotonicNow:j,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=Y(e,{kind:"rotating-jsonl",detail:{target:Je(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){_e(e,{recursive:!0})},exists:Ie,readBytes(e){return V(e,{maxBytes:A,inputKind:"rotating JSONL segment"})},size(e){return $e(e).size},truncate:De,remove(e){Me(e,{force:!0})},rename:Ne,append:Ee});function le(e,t,n){let r=n.runtime??de,s=JSON.stringify(t);if(s===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let a=Buffer.from(`${s}
|
|
6
|
+
`),i=Math.max(1,Math.floor(n.maxSegmentBytes),a.length);return ge(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(We(e));let c=Ge(e,A,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??O}`,u=!1,g=!1;return r.exists(e)&&r.size(e)+a.length>i&&(r.exists(o)&&(r.remove(o),g=!0),n.onPhase?.("previous-pruned"),r.rename(e,o),u=!0,n.onPhase?.("current-rotated")),r.append(e,a),n.onPhase?.("record-appended"),{lineBytes:a.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:u,prunedPrevious:g}})}function ce(e,t={}){let n=t.runtime??de,r=qe(t.maxSegmentBytes);return ge(e,t.lockTimeoutMs,n,()=>{let s=[],a=0,i=`${e}${t.previousSuffix??O}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=ze(fe(c,r,n));s.push(...o.lines),a+=o.partialTailBytes}return{lines:s,ignoredPartialTailBytes:a}})}function ge(e,t,n,r){let s=`${e}${Ce}`,a=Math.max(0,t??Fe),i=n.monotonicNow()+a,c;for(;;){let m=n.tryAcquireLock(s,e);if(m.kind==="acquired"){c=m.lock;break}let R=i-n.monotonicNow();if(R<=0)throw new C(s,a);n.wait(Math.min(5,R))}let o=!1,u,g;try{g=r()}catch(m){o=!0,u=m}let l=!1;try{l=c.release()}catch(m){if(!o)throw m}if(o)throw u;if(!l)throw new F(s);return g}function Ge(e,t,n){if(!n.exists(e))return 0;let r=fe(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let s=r.lastIndexOf(10),a=s<0?0:s+1;return n.truncate(e,a),r.length-a}function qe(e){let t=e??A;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function fe(e,t,n){let r=n.size(e);if(r>t)throw new D("rotating JSONL segment",e,"too-large",r,t);let s=n.readBytes(e),a=n.size(e);if(a!==r||s.byteLength!==r)throw new D("rotating JSONL segment",e,"changed-during-read",a,t);return s}function ze(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
7
|
+
`).filter(s=>s.length>0),partialTailBytes:e.length-n}}var Ke="reindex-activity.jsonl",k=O,Ve=1024*1024,Xe=1440*60*1e3,pe=e=>X(e,"reindex activity segment");function q(e){return xe(be(e),Ke)}function Be(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:G(e.indexPath))+G(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let s=r.producedOutputBytes??r.outputBytes;s!==null&&(n+=s)}return n}function je(e){let t=Be(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function Jt(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=Be(t);return ve(q(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:je(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:nt(t)})}function Wt(e,t){return ve(q(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function Ye(e,t,n=Ve,r){le(e,t,{maxSegmentBytes:n,previousSuffix:k,...r?{runtime:r}:{}})}function He(e,t=new Date,n=Xe,r=pe){let s=t.getTime(),a=s-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(a).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{}},c=q(e),o=[];if(r===pe){if(!me(c)&&!me(`${c}${k}`))return i;try{let u=ce(c,{previousSuffix:k});o=u.lines,i.ignoredPartialTailBytes=u.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let u=0;for(let g of[`${c}${k}`,c])try{o.push(...ut(r(g))),u+=1}catch{i.readErrors+=1}u===0?i.confidence="unavailable":i.readErrors>0&&(i.confidence="partial")}for(let u of o){i.recordsRead+=1;let g=Qe(u);if(!g){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:l}=g,m=Date.parse(l.recordedAt);if(m<a||m>s){i.skippedRecords+=1;continue}if(i.invalidLanguageDetails=(i.invalidLanguageDetails??0)+g.invalidLanguageDetails,i.byTrigger[l.trigger.kind]=(i.byTrigger[l.trigger.kind]??0)+1,l.event==="suppressed"){i.suppressed+=1;continue}i.runs+=1,i[l.result]+=1,i.estimatedLogicalOutputBytes+=l.estimatedLogicalOutputBytes;let R=Ze(l);i.estimatedWriteBytes=(i.estimatedWriteBytes??0)+R,i.reflinkedBytes=(i.reflinkedBytes??0)+(l.reflinkedBytes??0),i.fallbackCopiedBytes=(i.fallbackCopiedBytes??0)+(l.fallbackCopiedBytes??0),l.result!=="failed"&&(g.hasLanguageDetails?i.attributedRuns=(i.attributedRuns??0)+1:i.unattributedRuns=(i.unattributedRuns??0)+1);for(let[x,p]of he(l.byLanguage)){let y=(i.byLanguage??={})[x]??=at();y.runs+=1,y[p.result]+=1,y.producedOutputBytes+=p.producedOutputBytes,y.durationMs+=p.durationMs}ye(l)&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=l.recordedAt),ye(l)&&(i.fullRebuilds=(i.fullRebuilds??0)+1),R>0&&i.oldestWriteAt===void 0&&(i.oldestWriteAt=l.recordedAt)}return i.ignoredPartialTailBytes>0&&i.confidence!=="unavailable"&&(i.confidence="partial"),i.languageAttribution=ot(i),i}function ve(e,t){try{return Ye(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Qe(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!K(n.recordedAt)||!n.trigger||!tt(n.trigger.kind))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(n.event!=="run"||n.result!=="rebuilt"&&n.result!=="reused"&&n.result!=="failed"||!b(n.durationMs)||!b(n.estimatedLogicalOutputBytes)||n.estimatedWriteBytes!==void 0&&!b(n.estimatedWriteBytes)||n.reflinkedBytes!==void 0&&!b(n.reflinkedBytes)||n.fallbackCopiedBytes!==void 0&&!b(n.fallbackCopiedBytes)||n.incrementalWrittenBytes!==void 0&&!b(n.incrementalWrittenBytes))return null;let r=n,{byLanguage:s,...a}=r,i=rt(s);return{record:{...a,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function Ze(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function Ct(e,t,n=new Date){return t.enabled?et(He(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function et(e,t,n){let r=e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,s=e.fullRebuilds??e.rebuilt,a={rebuilt:s,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...a,detail:`reindex activity evidence is ${e.confidence}`}:s>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:Re(e.oldestRebuildAt,t.windowMs,n),...a,detail:`${s}/${t.maxRebuilds} expensive full rebuild slots consumed`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:Re(e.oldestWriteAt,t.windowMs,n),...a,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed`}:{state:"allowed",...a}:{state:"allowed",...a}}function ye(e){if(e.result!=="rebuilt")return!1;let t=he(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function Re(e,t,n){let r=e?Date.parse(e):Number.NaN;return Number.isFinite(r)&&r+t>n?r+t:n+t}function tt(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function G(e){try{return Ue(e).size}catch{return 0}}function nt(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(u=>u.language===n),s=r.find(u=>u.id===n),a=e.reused||(s?s.reused:r.length>0&&r.every(u=>u.reused)),i=G(xe(be(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:s?.outputBytes??i,o=a?0:s?.durationMs??r.filter(u=>!u.reused).reduce((u,g)=>u+g.durationMs,0);t[n]={result:a?"reused":"rebuilt",strategy:a?"reused":s?.strategy??"full",...s?.strategy==="full"&&(s.fallbackReason??s.missReason)?{fallbackReason:s.fallbackReason??s.missReason}:{},outputBytes:c,producedOutputBytes:a?0:s?.producedOutputBytes??c,durationMs:o}}return t}function rt(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[s,a]of Object.entries(e)){if(!st(s)||!it(a)){n+=1;continue}t[s]=a}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function it(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&M(t.outputBytes)&&M(t.producedOutputBytes)&&b(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function st(e){return $.includes(e)}function he(e){return e?$.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function at(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function ot(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function ut(e){return e.endsWith(`
|
|
8
|
+
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
9
|
+
`)+1))),e.split(`
|
|
10
|
+
`).filter(t=>t.length>0)}export{ft as a,h as b,mt as c,W as d,vt as e,Oe as f,ht as g,St as h,ue as i,O as j,le as k,Ke as l,Jt as m,Wt as n,Ct as o};
|
|
11
|
+
//# sourceMappingURL=chunk-6X4KO5A7.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as p}from"./chunk-HW7FASEL.js";import{a as T}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-YBWE6J32.js";import{a as A,e as h,t as D}from"./chunk-7Z4GMCHM.js";import{v as O}from"./chunk-6LS3IG2I.js";import{a as m}from"./chunk-C7WSQA6A.js";import{C as j,d as u}from"./chunk-JSHDCVUM.js";import{c as l,ua as S,va as w,wa as _}from"./chunk-WEXQYJY3.js";import{existsSync as b,readdirSync as M}from"fs";import{join as d}from"path";var it={files:new Set,pathPrefixes:[]},at={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,ot=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],ct=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ut=4,ft=u("package-surface",{clearGroups:["whole-project"]}),lt=u("package-operational-surface",{clearGroups:["whole-project"]});function $(t){return ft.get(t,()=>pt(t.config.projectRoot))}function x(t,e){let n=$(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function I(t,e){return $(t).files.has(e)}function gt(t){return lt.get(t,()=>dt(t.config.projectRoot))}function ce(t,e){return gt(t).reasonsByFile.get(e)??[]}function pt(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of St(r))U(t,s,i,e,n);return e.size===0&&n.length===0?it:{files:e,pathPrefixes:n}}function dt(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=mt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of ht(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?at:{reasonsByFile:e}}function L(t){let e=[],n=X(t,"");return n&&e.push({manifest:n,packageRoot:""}),V(t,"",e,0),e}function V(t,e,n,r){if(r>=ut)return;let s=d(t,e);if(b(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||ct.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=X(t,a);o&&n.push({manifest:o,packageRoot:a}),V(t,a,n,r+1)}}function X(t,e){let n;try{n=S(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!w(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function St(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function mt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function ht(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;U(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function U(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(ot,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of C)bt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function bt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||b(d(t,s)))return;let i=C.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);yt(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function yt(t,e,n,r,s){let i=f(n,`${r}/index${s}`);b(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!b(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as Pt}from"fs";import{dirname as xt,join as k}from"path";var Et={rootFiles:new Set,sourcePrefixes:[]},kt=new Set([".git",".scipquery","node_modules","target"]),Rt=6,Tt=u("rust-library-surface",{clearGroups:["whole-project"]});function W(t,e,n){if(!n.endsWith(".rs")||!jt(wt(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Ot(j(t,n)[r.startLine]??""):!1}function wt(t){return Tt.get(t,()=>_t(t.config.projectRoot))}function _t(t){let e=new Set,n=new Set;for(let r of Nt(t)){let s=S(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=At(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!Dt(s)&&_(t,a)?a:null;if(!o)continue;e.add(o);let c=xt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?Et:{rootFiles:e,sourcePrefixes:[...n].sort()}}function jt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:vt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Ot(t){return/^\s*pub\s+(?!\()/.test(t)}function Nt(t){if(!E(t))return[];let e=[];return H(t,"",e,0),e}function H(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let i of Pt(s,{withFileTypes:!0})){if(!i.isDirectory()||kt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;H(t,a,n,r+1)}}function At(t){let e=!1;for(let n of t.split(`
|
|
2
|
+
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Dt(t){let e=!1;for(let n of t.split(`
|
|
3
|
+
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function vt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Ft(t){return p(t)==="barrel"}function q(t){return Mt.get(t,()=>{let n=m(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=N(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Mt=u("live-barrels",{clearGroups:["whole-project"]});function Ct(t,e){return q(t).has(l(e))}function Ne(t){let e=q(t);return m(t,{includeIgnored:!1}).filter(n=>Ft(n)&&!e.has(n)&&!$t(t,n))}function $t(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
+
FROM defn_enclosing_ranges der
|
|
5
|
+
JOIN documents d ON d.id = der.document_id
|
|
6
|
+
WHERE d.relative_path = ?
|
|
7
|
+
AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function Ae(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||ee(n)||Ct(t,n)}function It(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Xt(t,e,r)&&s.push("transitive-package-surface"),W(t,e,r)&&s.push("rust-public-library"),te(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>re(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return T(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function De(t,e,n){return It(t,e,n).length>0}var Lt=u("package-surface-reachability",{clearGroups:["whole-project"]}),Vt=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Xt(t,e,n){let r=Bt(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function ve(t,e,n){let r=Ut(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function Bt(t){return Lt.get(t,()=>Y(t,e=>x(t,e)))}function Ut(t){return Vt.get(t,()=>Y(t,e=>I(t,e)))}function Y(t,e){let n=new Map,r=[];for(let s of m(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of O(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Gt(i,a);o!==void 0&&Wt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Gt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Wt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Z=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Ht=new Set(["default","generateMetadata","generateStaticParams"]),Kt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),qt=new Set(["default","middleware","config"]),Yt=new Set(["register","onRequestError"]),Zt=new Set(["onRouterTransitionStart"]),Jt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Qt=new Set(["load","actions","entries",...Z]),zt=new Set(["default"]);function te(t,e){let n=h(t);return n===""?!1:J(e)?Z.has(n):Q(e)?Ht.has(n):z(e)?Kt.has(n):tt(e)?qt.has(n):et(e)?Yt.has(n):nt(e)?Zt.has(n):rt(e)?Jt.has(n):st(e)?Qt.has(n):ne(e)?zt.has(n):!1}function ee(t){return J(t)||Q(t)||z(t)||tt(t)||et(t)||nt(t)||rt(t)||st(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function z(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return R(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function et(t){return R(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function nt(t){return R(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function R(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function rt(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ne(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function re(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(K(r)+"/")&&t.includes(K(s)+".")}function K(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ce as b,Ft as c,Ct as d,Ne as e,Ae as f,It as g,De as h,ve as i,ee as j};
|
|
8
|
+
//# sourceMappingURL=chunk-743MEVFJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-DXEJ4FLZ.js";var v=/:\d+(?:-\d+)?$/u;function D(d,t,c={}){let p=c.direction??"backward",n=c.maxDepth??3;if(!Number.isSafeInteger(n)||n<0)throw new RangeError(`Dependence-slice depth must be a non-negative safe integer; received ${n}.`);let r=v.test(t),o=m(d,r?{locations:[t]}:{symbols:[t]},{families:["execution","runtime","dataflow","ownership"],maxDepth:n+1,maxEdges:c.maxEdges??200}),f=new Set(o.targets.flatMap(e=>e.nodeIds)),a=new Set(f),l=new Map;u(o.edges,a,l,0);for(let e=1;e<=n;e+=1){let s=[];for(let i of o.edges)if(p==="backward"?a.has(i.to.id):a.has(i.from.id)){let g=p==="backward"?i.from.id:i.to.id;if(a.has(g))continue;s.push(g),l.set(i.id,e)}if(s.length===0)break;for(let i of s)a.add(i);u(o.edges,a,l,e)}let h=o.edges.filter(e=>a.has(e.from.id)&&a.has(e.to.id)).filter(e=>l.has(e.id)||e.family==="ownership").map(e=>({...e,traversalDepth:l.get(e.id)??0,supporting:e.family!=="dataflow"&&!y(e)})).sort((e,s)=>e.traversalDepth-s.traversalDepth||e.family.localeCompare(s.family)||e.from.label.localeCompare(s.from.label)||e.to.label.localeCompare(s.to.label));return{kind:"dependence-slice",direction:p,criterion:t,targets:o.targets,nodeIds:[...a].sort(),edges:h,coverage:{status:o.coverage.status,criterionKind:r?"source-location-summary":"symbol-summary",basis:"partial-system-dependence-graph",analysisBasis:"typescript-cfg-reaching-definitions-plus-system-edges",providers:["typescript-local-dependence","bounded-static-value-flow"],graph:o.coverage,unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","unresolved dynamic dispatch"]}}}function u(d,t,c,p){let n=!0;for(;n;){n=!1;for(let r of d)r.family!=="ownership"||!t.has(r.from.id)||t.has(r.to.id)||(t.add(r.to.id),c.set(r.id,p),n=!0)}}function y(d){return d.semanticFamily==="control"&&d.sourceKind==="control-dependence"}export{D as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7G2WIVIX.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as M,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-
|
|
1
|
+
import{B as M,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-7Z4GMCHM.js";import{b as B}from"./chunk-C7WSQA6A.js";import{c as O}from"./chunk-JSHDCVUM.js";var T=O("symbol-resolution",{clearGroups:[]});function he(e,n){return G(e,n).match}function G(e,n){return T.get(e,n,()=>{let t=W(e,n.trim()).filter(i=>!e.isIgnored(i.relative_path));if(t.length>0)return L(e,t);let o=P(e,n);if(o&&!e.isIgnored(o.relative_path))return L(e,[o]);let r=H(e,n);if(r.length>0)return L(e,r);let s=U(e,n);return s.length>0?L(e,s):J(e,n)})}function H(e,n){let t=n.trim().replace(/\(\)$/u,""),o=t.lastIndexOf(":");if(o<=0||o===t.length-1||t.startsWith("local:"))return[];let r=t.slice(o+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(r))return[];let s=[`/${r}().`,`/${r}.`,`/${r}#`,`#${r}().`,`#${r}.`,`/${r}/`],i=`gs.display_name = ? OR ${s.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[r,...s],l=f(e,{where:i,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),u=l.length>0?[]:S(e,{where:i,params:a,orderBy:"d.relative_path, start_line",limit:200}),p=R(l,u).filter(m=>!e.isIgnored(m.relative_path)).filter(m=>_(m.symbol).replace(/\(\)$/u,"")===t);return[...new Map(p.map(m=>[`${m.symbol}\0${m.relative_path}`,m])).values()]}function U(e,n){let t=Q(n),o=E(t);if(!o)return[];let r=`%${o.path}%`,s=o.leaf;return X(e,r,s,t)}function X(e,n,t,o){let r=R([],[...Y(e,n,t),...Z(e,n,t)]).filter(s=>!e.isIgnored(s.relative_path)).filter(s=>C(s,o)>1);return r.sort((s,i)=>C(i,o)-C(s,o)||s.end_line-s.start_line-(i.end_line-i.start_line)||s.start_line-i.start_line||s.symbol.localeCompare(i.symbol)),r}function Y(e,n,t){return f(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function Z(e,n,t){return S(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function J(e,n){let t=Q(n),o=ae(n),r=oe(e,o),s=se(r,n,t).filter(a=>!e.isIgnored(a.relative_path));if(s.length>0)return L(e,s);let i=[];for(let a of r){if(e.isIgnored(a.relative_path))continue;let l=re(a,n,t,o);l<=0||i.push({row:a,score:l})}return i.sort((a,l)=>l.score-a.score||a.row.end_line-a.row.start_line-(l.row.end_line-l.row.start_line)||a.row.relative_path.localeCompare(l.row.relative_path)||a.row.symbol.localeCompare(l.row.symbol)),L(e,i.map(a=>a.row))}function L(e,n){let t=n.map(r=>M(e,r)),o=t[0]??null;return{match:o,candidates:o?V(t,o):[],total:t.length}}function V(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let r of e){let s=`${r.symbolId}:${r.relativePath}:${r.startLine}`;if(!t.has(s)&&(t.add(s),o.push({symbol:r.symbol,shortName:_(r.symbol),relativePath:r.relativePath,startLine:r.startLine}),o.length>=5))break}return o}function P(e,n){let t=n.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!t)return;let[,o,r,s]=t,i=B(e,o,{allowMultiple:!1,requirePathMatch:!0})[0]?.relativePath;if(!i)return;let a=Math.max(0,parseInt(r,10)-1),l=s?Math.max(a,parseInt(s,10)-1):a;return ee(e,i,a,l)??te(e,i,a,l)}function ee(e,n,t,o){return f(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[n,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function te(e,n,t,o){return S(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[n,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function be(e,n){let t=W(e,n).find(o=>!e.isIgnored(o.relative_path));return t?M(e,t):null}function W(e,n){let t=f(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:S(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return R(t,o)}function Se(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=ne(e,n.symbolId)[0];return t?M(e,t):null}function ne(e,n){let t=f(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=S(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return R(t,o)}function oe(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(a=>{let l=`%${a}%`;return[l,l,l]}),r=t.join(`
|
|
2
2
|
AND `),s=f(e,{where:r,params:o,limit:200}),i=S(e,{where:r,params:o,limit:200});return R(s,i)}function re(e,n,t,o){let r=n.trim(),s=t,i=s.replace(/\(\)$/,""),a=n.toLowerCase(),l=t.toLowerCase(),u=l.replace(/\(\)$/,""),p=e.symbol,m=_(e.symbol),y=w(e.symbol),g=e.display_name??"",$=e.symbol.toLowerCase(),d=m.toLowerCase(),h=y.toLowerCase(),x=g.toLowerCase(),b=e.relative_path.toLowerCase(),j=/[/:.]/.test(t),I=E(t),v=I?.leaf.toLowerCase(),c=0;return(p===r||p===s)&&(c+=1150),(m===r||m===s)&&(c+=1100),g===i&&(c+=1180),y===i&&(c+=1160),(`${y}()`===r||`${y}()`===s)&&(c+=955),($===a||$===l)&&(c+=1e3),(d===a||d===l)&&(c+=950),(b===a||b===l)&&(c+=925),(b.endsWith(`/${l}`)||b.endsWith(`/${a}`))&&(c+=875),x===u&&(c+=850),h===u&&(c+=825),(`${h}()`===a||`${h}()`===l)&&(c+=820),(d.endsWith(`:${l}`)||d.endsWith(`:${u}`)||d.endsWith(`:${u}()`))&&(c+=800),$.includes(l)&&(c+=120),d.includes(l)&&(c+=140),b.includes(l)&&(c+=140),x.includes(l)&&(c+=110),o.every(q=>{let D=q.toLowerCase();return $.includes(D)||d.includes(D)||b.includes(D)||x.includes(D)})&&(c+=100+o.length*15),I&&b.includes(I.path.toLowerCase())&&(c+=360,v&&(h===v||`${h}()`===v||`${h}()`==`${v}()`)&&(c+=700),k(e.symbol)&&(c+=180)),A(e.symbol)&&h===u&&(c+=60),!j&&z(e.symbol)&&(c-=160),c-=Math.min(50,Math.max(0,e.end_line-e.start_line)),c}function E(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function Q(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function ae(e){let n=Q(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function se(e,n,t){let o=n.trim(),r=e.filter(a=>{let l=_(a.symbol),u=w(a.symbol),p=(a.display_name??"").trim();return a.symbol===o||l===o||l===t||u===o||u===t||`${u}()`===o||p===o||p===t||`${p}()`===o||C(a,t)>1||a.relative_path===o});if(r.length===0)return[];let s=t.replace(/\(\)$/u,""),i=r.filter(a=>w(a.symbol)===s);if(i.length>0){i.sort((l,u)=>F(l,u,t));let a=i.filter(l=>A(l.symbol));return a.length>0?a:i}return r.sort((a,l)=>F(a,l,t)),r}function F(e,n,t){return C(n,t)-C(e,t)||e.end_line-e.start_line-(n.end_line-n.start_line)||e.relative_path.localeCompare(n.relative_path)||e.symbol.localeCompare(n.symbol)}function C(e,n){let t=E(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),r=w(e.symbol).toLowerCase(),s=t.path.toLowerCase(),i=t.leaf.toLowerCase();return o.includes(s)?r!==i?1:k(e.symbol)?N(e.symbol)===null?5:4:N(e.symbol)===null?3:2:0}function ge(e,n,t=5){let o=K(n);if(!o)return[];let r=f(e,{where:"1 = 1",orderBy:"d.relative_path, der.start_line",limit:5e3}),s=new Map;for(let i of r){if(e.isIgnored(i.relative_path))continue;let a=_(i.symbol),l=w(i.symbol),u=i.display_name??l,p=[a,l,u].filter(g=>g.trim().length>0),m=Math.min(...p.map(g=>ie(K(g),o))),y=s.get(a);(!y||m<y.distance)&&s.set(a,{shortName:a,distance:m})}return[...s.values()].sort((i,a)=>i.distance-a.distance||i.shortName.localeCompare(a.shortName)).slice(0,t).map(i=>i.shortName)}function K(e){return Q(e).toLowerCase().replace(/[^a-z0-9_]+/g,"")}function ie(e,n){if(e===n)return 0;if(e.length===0)return n.length;if(n.length===0)return e.length;let t=Array.from({length:n.length+1},(o,r)=>r);for(let o=0;o<e.length;o++){let r=[o+1];for(let s=0;s<n.length;s++){let i=e[o]===n[s]?0:1;r[s+1]=Math.min(r[s]+1,t[s+1]+1,t[s]+i)}t=r}return t[n.length]}export{he as a,G as b,be as c,Se as d,ge as e};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-7MUHSZGN.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as Z,c as q}from"./chunk-FEQIQ26E.js";import{f as _}from"./chunk-TM5XEDDR.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-JVZNWJBH.js";import{d as Q,f as V}from"./chunk-RGCJ4646.js";import{t as T}from"./chunk-5IZTXSOL.js";import{l as O}from"./chunk-I3U2FN2T.js";import{z as M}from"./chunk-DMQ7ZKJG.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
1
|
+
import{b as Z,c as q}from"./chunk-L7WRUNKJ.js";import{f as _}from"./chunk-FSPENGSU.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-NODZYYGC.js";import{d as Q,f as V}from"./chunk-B3AREUQK.js";import{t as T}from"./chunk-7Z4GMCHM.js";import{l as O}from"./chunk-6LS3IG2I.js";import{C as M}from"./chunk-JSHDCVUM.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
2
2
|
`).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-7YZGSLW6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as I,m as A,p as v,v as P,w as Q}from"./chunk-
|
|
1
|
+
import{a as I,m as A,p as v,v as P,w as Q}from"./chunk-6LS3IG2I.js";import{C as w,a as D}from"./chunk-C7WSQA6A.js";import{C as $,c as S,d as N,i as h,j as x,p as _,w as C,y as O,z as T}from"./chunk-JSHDCVUM.js";var te={"/":"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=ie(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function p(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 ie(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||j(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&&!j(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=te[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function j(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function B(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=re(r);s&&i.push(s)}return i.join(":")}function re(e){let n=e.suffix==="namespace"?se(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function se(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 W(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 g(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 je(e){return e.endsWith("().")||g(e)==="method"}function L(e){let n=g(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 Be(e){return g(e)==="namespace"}var oe=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function We(e){return oe.test(e)}var ae=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&&ae.has(i.name))return!0}return!1}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+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 He(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
2
|
FROM global_symbols gs
|
|
3
3
|
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
4
|
JOIN documents d ON der.document_id = d.id
|
|
@@ -114,4 +114,4 @@ import{a as I,m as A,p as v,v as P,w as Q}from"./chunk-I3U2FN2T.js";import{C as
|
|
|
114
114
|
${e.symbolNoiseFor("gs")}
|
|
115
115
|
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
116
|
ORDER BY d.relative_path, start_line, end_line`,...s)}function _e(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function ee(e,n){return n==="callable"?_e(e):Ie(e)}function Ie(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function X(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 hn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>E(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:B(r.symbol),signature:G(U(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Le(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 xn(e,n){let t=Y.get(e);return t||(t=Le(e),Y.set(e,t)),t.get(n)??null}function Dn(e,n){let t=E(e,n.relative_path).find(i=>i.symbolId===n.id)??(p(n.symbol)===null||!L(n.symbol)?void 0:M(e,n.relative_path,[k(n)])[0]);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 M(e,n,t,i,r){let s=m(i,"range-correction.source-text",()=>r?r.source:b(e).forFile(n,{text:!0}).text),o=m(i,"range-correction.callable-sites",()=>r?r.callables:v(e,n));return o?m(i,"range-correction.ast-correction",()=>Ne(t,o,s)):s?m(i,"range-correction.regex-fallback",()=>Fe(t,s)):t}function Fe(e,n){let t=n.split(/\r?\n/),i=Re(e,t),r=Ee(e,i),s=ke(r,t);return Me(e,s)}function Re(e,n){let t=e.some(r=>y(r.symbol))?ve(n):null,i=new Map;for(let r of e)i.set(r.symbolId,Ae(n,t,r));return i}function Ee(e,n){return e.filter(t=>y(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 ke(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:Pe(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 Ne(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(!we(r)||!r.leaf)return Z(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return Z(r,t);let o=t?Ce(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 Ce(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${I(i)}\\b`);for(let o of n){let a=Te(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Te(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return $e(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function $e(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 we(e){return y(e.symbol)?!0:g(e.symbol)==="term"&&p(e.symbol)===null}function Z(e,n){if(!n||!e.leaf||g(e.symbol)!=="term"||p(e.symbol)!==null)return e;let t=I(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 Ae(e,n,t){if(!y(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 ve(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 Pe(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=Qe(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 Qe(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 y(e){return e.includes("().")}function _n(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{b as a,u as b,p as c,B as d,W as e,g as f,je as g,L as h,Be as i,We as j,Je as k,ze as l,He as m,Ue as n,Ke as o,G as p,U as q,F as r,gn as s,E as t,bn as u,he as v,yn as w,Sn as x,hn as y,Le as z,xn as A,Dn as B,_n as C};
|
|
117
|
-
//# sourceMappingURL=chunk-
|
|
117
|
+
//# sourceMappingURL=chunk-7Z4GMCHM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-Z2QB75BS.js";import{b as f}from"./chunk-7MUHSZGN.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,h as b,p,q as g}from"./chunk-7Z4GMCHM.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
2
|
* Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
|
|
3
3
|
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
4
|
* more than one place, feed both the same input and require the same
|
|
@@ -37,4 +37,4 @@ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}'
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-AAOEROT3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-G6VV7ROY.js";import{b as l}from"./chunk-UM56ZET4.js";import{d as r,u as m}from"./chunk-7Z4GMCHM.js";function u(o,t={}){let{limit:i=30,scope:e}=t,n=e?"AND def_d.relative_path LIKE ?":"",f=e?[`%${e}%`]:[],c=o.all(`SELECT
|
|
2
2
|
gs.symbol,
|
|
3
3
|
COUNT(*) AS ref_count,
|
|
4
4
|
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
@@ -23,4 +23,4 @@ import{a as d}from"./chunk-6BJ7SOY7.js";import{b as l}from"./chunk-ICUQONOG.js";
|
|
|
23
23
|
GROUP BY gs.id
|
|
24
24
|
ORDER BY ref_count DESC
|
|
25
25
|
LIMIT ?`,...f,i).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in,basis:"scip-cross-file-mentions",countUnit:"reference-occurrences"}));return c.length>0?c:a(o,e,i)}function C(o,t={}){return u(o,t)}function a(o,t,i){return m(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>p(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,i)}function p(o,t){let e=l(o,t,{limit:500,semanticEvidence:d}).filter(n=>n.file!==t.relativePath);return{symbol:t.symbol,shortName:r(t.symbol),refCount:e.length,fileCount:new Set(e.map(n=>n.file)).size,definedIn:t.relativePath,basis:"source-backed-incoming-evidence",countUnit:"distinct-incoming-evidence-rows"}}export{u as a,C as b};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-AFRS7WJU.js.map
|