scip-query 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-4IYG2SKW.js +2 -0
- package/dist/call-graph-WQNXMNNN.js +2 -0
- package/dist/{chunk-AQDWTCDC.js → chunk-25GWKRUZ.js} +2 -2
- package/dist/chunk-2BTJALUS.js +454 -0
- package/dist/chunk-2KVU55CW.js +11 -0
- package/dist/{chunk-BBWPOMGU.js → chunk-2OXVP5U5.js} +2 -2
- package/dist/{chunk-D5W4UZY5.js → chunk-2RE5OCHZ.js} +2 -2
- package/dist/{chunk-2I3RSUWX.js → chunk-2XCGSDIT.js} +2 -2
- package/dist/{chunk-V7LQZTTZ.js → chunk-2YC7YNKT.js} +2 -2
- package/dist/chunk-3QXC54FQ.js +3 -0
- package/dist/{chunk-32A42O5B.js → chunk-3TJY6M3B.js} +2 -2
- package/dist/chunk-42W3LFUK.js +13 -0
- package/dist/chunk-44T4DUAA.js +2 -0
- package/dist/chunk-4GAQ6FI4.js +43 -0
- package/dist/{chunk-4S4DF62J.js → chunk-4HE7MVWD.js} +2 -2
- package/dist/{chunk-TGWNNMPF.js → chunk-4TQU4TX2.js} +2 -2
- package/dist/{chunk-SKUMCCC5.js → chunk-56NQAEPJ.js} +2 -2
- package/dist/chunk-57N6LN2A.js +3 -0
- package/dist/{chunk-LPGDO2XA.js → chunk-5H5WTJSD.js} +2 -2
- package/dist/{chunk-EA4SH4U5.js → chunk-5YRQIE2B.js} +2 -2
- package/dist/{chunk-O2RM7E7L.js → chunk-5ZMBRQFC.js} +4 -4
- package/dist/{chunk-ICHBVITH.js → chunk-6HRZQLOI.js} +2 -2
- package/dist/{chunk-WULAPQUD.js → chunk-6NC3YSPY.js} +2 -2
- package/dist/{chunk-IDPLC3FI.js → chunk-6VEFRPTD.js} +2 -2
- package/dist/{chunk-IOKWFRFQ.js → chunk-7C26EKLZ.js} +2 -2
- package/dist/{chunk-S3RTPPLQ.js → chunk-7IQXARSQ.js} +2 -2
- package/dist/chunk-7JYHQAH2.js +22 -0
- package/dist/chunk-7KSO2OAP.js +2 -0
- package/dist/{chunk-2ZBMOQGG.js → chunk-7U2YQSDE.js} +2 -2
- package/dist/{chunk-EKZRF57O.js → chunk-7XA3OM44.js} +2 -2
- package/dist/{chunk-4EXFZP6H.js → chunk-7XZGZBSQ.js} +2 -2
- package/dist/chunk-7YQOCABQ.js +2 -0
- package/dist/chunk-A77SCPW2.js +3 -0
- package/dist/chunk-AK3PYTIK.js +5 -0
- package/dist/chunk-AMIMMNA4.js +11 -0
- package/dist/{chunk-MOBF2GH6.js → chunk-AQ2PORIO.js} +2 -2
- package/dist/{chunk-YUFWLWIC.js → chunk-ARVO6TTW.js} +2 -2
- package/dist/chunk-AUY5BL74.js +2 -0
- package/dist/{chunk-RGCJ4646.js → chunk-AYPDH2LU.js} +2 -2
- package/dist/{chunk-73Z33VFI.js → chunk-AZS7YPCB.js} +2 -2
- package/dist/{chunk-SYUNTKO2.js → chunk-BDGTPN27.js} +2 -2
- package/dist/{chunk-BATIVRU2.js → chunk-BDHFVH2M.js} +2 -2
- package/dist/chunk-BECZLYNU.js +8 -0
- package/dist/chunk-BJT7LSPK.js +3 -0
- package/dist/{chunk-6SWA6B24.js → chunk-BTVKZGWT.js} +2 -2
- package/dist/{chunk-QD7IFBCR.js → chunk-BUTEIZKP.js} +2 -2
- package/dist/{chunk-UZFCZ7SJ.js → chunk-BVFYEEBH.js} +2 -2
- package/dist/{chunk-ICUQONOG.js → chunk-BWVQP3LB.js} +2 -2
- package/dist/chunk-BYDAFMSR.js +57 -0
- package/dist/{chunk-BHE44MHT.js → chunk-C76O5MDS.js} +2 -2
- package/dist/chunk-C7IJMOFP.js +134 -0
- package/dist/{chunk-CN2WGM7D.js → chunk-CBBHFNLX.js} +2 -2
- package/dist/{chunk-COTMS5KM.js → chunk-CKRWA452.js} +2 -2
- package/dist/{chunk-ANWGXPPN.js → chunk-CLG6DWVS.js} +2 -2
- package/dist/chunk-D2MVJSP4.js +21 -0
- package/dist/chunk-D35XIZGN.js +2 -0
- package/dist/{chunk-U7DR7MJD.js → chunk-DEAB5TGT.js} +2 -2
- package/dist/{chunk-6GJAP4OE.js → chunk-DJAO2OZJ.js} +2 -2
- package/dist/chunk-DKM723YF.js +79 -0
- package/dist/{chunk-4IIMPWMR.js → chunk-DPWKKNKI.js} +2 -2
- package/dist/chunk-E44IVWIJ.js +367 -0
- package/dist/chunk-EDMB6SSO.js +7 -0
- package/dist/{chunk-KWARB5FZ.js → chunk-EELG7D3Q.js} +2 -2
- package/dist/chunk-EELPBR7E.js +3 -0
- package/dist/chunk-EETGXQY7.js +3 -0
- package/dist/chunk-ENWQWA2R.js +2 -0
- package/dist/{chunk-HUZNZ3H2.js → chunk-ERCYGVAM.js} +2 -2
- package/dist/{chunk-WSG3DK5H.js → chunk-EWWY2ZFL.js} +2 -2
- package/dist/chunk-F24G5NBE.js +3 -0
- package/dist/{chunk-XRXCANFQ.js → chunk-F24QUEQP.js} +2 -2
- package/dist/{chunk-KFK7GF5C.js → chunk-FBCVASUG.js} +2 -2
- package/dist/{chunk-35IW3P4H.js → chunk-FELGD32K.js} +2 -2
- package/dist/{chunk-UNORWZIJ.js → chunk-FFJQZG6J.js} +5 -5
- package/dist/{chunk-5SE323LF.js → chunk-FGNCOQUX.js} +2 -2
- package/dist/chunk-FKGQOTKD.js +2 -0
- package/dist/chunk-GDRJB3SB.js +3 -0
- package/dist/chunk-GH5YSGZL.js +5 -0
- package/dist/{chunk-X7PJJYKX.js → chunk-GIQ6CSL4.js} +2 -2
- package/dist/{chunk-2RP27XLR.js → chunk-GPGRZJ3R.js} +2 -2
- package/dist/{chunk-IYV2YBHM.js → chunk-GQIDEID3.js} +2 -2
- package/dist/chunk-GRX7JOXQ.js +2 -0
- package/dist/{chunk-H46QMB7E.js → chunk-GVOMSPGL.js} +2 -2
- package/dist/{chunk-KTRGJLY7.js → chunk-GY7CCCEZ.js} +2 -2
- package/dist/{chunk-VNKYRJKN.js → chunk-H7CG6LOE.js} +2 -2
- package/dist/chunk-HCVJR2V4.js +3 -0
- package/dist/chunk-HG722PO7.js +3 -0
- package/dist/{chunk-LHTT5C3Z.js → chunk-HISEUIL2.js} +2 -2
- package/dist/{chunk-K5MZYZV7.js → chunk-HXOU4XNH.js} +2 -2
- package/dist/chunk-I6UTXNHU.js +6 -0
- package/dist/{chunk-I7PFL5P3.js → chunk-IJMD6BRI.js} +2 -2
- package/dist/{chunk-XXJ7WL3F.js → chunk-IKVNEGTW.js} +2 -2
- package/dist/chunk-IMKZEXZG.js +2 -0
- package/dist/chunk-ISIQLPJ2.js +61 -0
- package/dist/{chunk-DEUGHURX.js → chunk-ISWFRGJ6.js} +2 -2
- package/dist/chunk-IW5XQG5G.js +2 -0
- package/dist/chunk-IXESDH3J.js +2 -0
- package/dist/{chunk-FGB567HK.js → chunk-JAT6C3VX.js} +2 -2
- package/dist/{chunk-7TWP3MCP.js → chunk-JFQBRL3J.js} +2 -2
- package/dist/{chunk-Q7HB7BFJ.js → chunk-JHH5SCZ3.js} +2 -2
- package/dist/{chunk-ZHSARYVS.js → chunk-JJ62MTQH.js} +2 -2
- package/dist/chunk-JT6XX7QY.js +8 -0
- package/dist/{chunk-5H7IWVXJ.js → chunk-JUN5DOAK.js} +2 -2
- package/dist/{chunk-DOPCR5BY.js → chunk-K3XFWJI2.js} +2 -2
- package/dist/{chunk-Y4XQ7LES.js → chunk-KFOYCQAJ.js} +1 -1
- package/dist/{chunk-N5C65OFK.js → chunk-KFVSJX25.js} +2 -2
- package/dist/chunk-KK7GPALL.js +28 -0
- package/dist/{chunk-DHKBIOXF.js → chunk-KQHJEU6V.js} +2 -2
- package/dist/{chunk-WB6LGCFB.js → chunk-KZYID5KV.js} +2 -2
- package/dist/{chunk-KW6B5OL4.js → chunk-LO5JSW2C.js} +2 -2
- package/dist/{chunk-ZW44MCJM.js → chunk-LRI5OMPE.js} +2 -2
- package/dist/{chunk-HG5YI7PV.js → chunk-LXQUF2RP.js} +2 -2
- package/dist/{chunk-TM5XEDDR.js → chunk-MHIEP7EG.js} +2 -2
- package/dist/{chunk-FHV7NMFU.js → chunk-MSR2QRUE.js} +2 -2
- package/dist/chunk-N7FP5H5U.js +57 -0
- package/dist/{chunk-3653GTR7.js → chunk-NEIQPFBI.js} +2 -2
- package/dist/chunk-NK3JMP22.js +2 -0
- package/dist/{chunk-7IOAZRVL.js → chunk-NRBNAECH.js} +2 -2
- package/dist/{chunk-HGKEAP7F.js → chunk-NVSZNESQ.js} +2 -2
- package/dist/{chunk-R2MOKIVO.js → chunk-OJNK5ALA.js} +2 -2
- package/dist/{chunk-RFWAUHVW.js → chunk-OPSAW5DT.js} +2 -2
- package/dist/chunk-OTSPRVNW.js +2 -0
- package/dist/chunk-OXYAWIEA.js +2 -0
- package/dist/chunk-OZETODHH.js +2 -0
- package/dist/chunk-PBUH2P5S.js +3 -0
- package/dist/{chunk-QBANU5BQ.js → chunk-PIFTZEEM.js} +2 -2
- package/dist/{chunk-CKDOY6JA.js → chunk-PLJUQFQN.js} +2 -2
- package/dist/{chunk-JVZNWJBH.js → chunk-PLYUVM4F.js} +2 -2
- package/dist/chunk-PXXYQK55.js +2 -0
- package/dist/{chunk-WZQFY5S7.js → chunk-Q55NF3ZG.js} +2 -2
- package/dist/{chunk-OVPS2ILI.js → chunk-Q5TA4OY4.js} +2 -2
- package/dist/{chunk-OUB4J26T.js → chunk-Q6T2CAJL.js} +2 -2
- package/dist/chunk-Q7GBK5T7.js +81 -0
- package/dist/chunk-QKT4UI2Y.js +2 -0
- package/dist/{chunk-PIZY2GX6.js → chunk-QLBSG7U5.js} +2 -2
- package/dist/chunk-QWKHW6VZ.js +2 -0
- package/dist/{chunk-E7BJXRNV.js → chunk-R6M456QG.js} +2 -2
- package/dist/{chunk-MJNV7OCG.js → chunk-RDULNRSJ.js} +2 -2
- package/dist/{chunk-SSSJO4RG.js → chunk-RHHCLWQ6.js} +2 -2
- package/dist/chunk-RNKPYYYE.js +4 -0
- package/dist/{chunk-IXJ26KJJ.js → chunk-RPL3ARU7.js} +2 -2
- package/dist/{chunk-3EX7DNBC.js → chunk-RYOYJMGF.js} +2 -2
- package/dist/chunk-SB25YMEQ.js +2 -0
- package/dist/chunk-SV2LEFVM.js +2 -0
- package/dist/{chunk-ZBNL3QCY.js → chunk-SVHTMVA4.js} +3 -3
- package/dist/{chunk-6IEVHGWG.js → chunk-SWK4XPUS.js} +2 -2
- package/dist/chunk-T6QD2ZQB.js +43 -0
- package/dist/{chunk-VETXXOYU.js → chunk-TAYD3AE7.js} +2 -2
- package/dist/chunk-TD7VKJ2Y.js +117 -0
- package/dist/{chunk-UQ7XPRWU.js → chunk-TH6IC56G.js} +2 -2
- package/dist/{chunk-XVDMJMES.js → chunk-TKDNDQA7.js} +2 -2
- package/dist/{chunk-CSDDOUA4.js → chunk-TNG2FYS5.js} +2 -2
- package/dist/chunk-TQZV7KV4.js +2 -0
- package/dist/{chunk-AJVMVE7X.js → chunk-TUQIPUDS.js} +2 -2
- package/dist/chunk-TUSPIVZ3.js +4 -0
- package/dist/{chunk-ORBKAUCH.js → chunk-U2N2KE7A.js} +2 -2
- package/dist/{chunk-3PII3JI5.js → chunk-UAQ4T73O.js} +2 -2
- package/dist/{chunk-OFY4HTMI.js → chunk-UDY7MIAW.js} +2 -2
- package/dist/{chunk-WKPZCQLI.js → chunk-URSGGIZX.js} +2 -2
- package/dist/{chunk-UL4VJUMD.js → chunk-UT7TADJX.js} +2 -2
- package/dist/chunk-V4NG5OMS.js +554 -0
- package/dist/{chunk-2H4IAJHO.js → chunk-VMWUV6WB.js} +2 -2
- package/dist/{chunk-46JLFIGA.js → chunk-VTCIYFEK.js} +2 -2
- package/dist/chunk-VU6LIWHT.js +2 -0
- package/dist/chunk-VUSKPCUB.js +2 -0
- package/dist/{chunk-URMZLV2N.js → chunk-VXJJTQYE.js} +2 -2
- package/dist/{chunk-IPAL6DP2.js → chunk-VZ7NXSHV.js} +2 -2
- package/dist/{chunk-FUG6RPYY.js → chunk-WHADK6OS.js} +2 -2
- package/dist/chunk-WN3TCGJ4.js +2 -0
- package/dist/{chunk-B7ECWJAZ.js → chunk-WOOAY3PA.js} +2 -2
- package/dist/chunk-WRQXLNYE.js +9 -0
- package/dist/chunk-WSLEJSFR.js +2 -0
- package/dist/chunk-WYZIHUPZ.js +16 -0
- package/dist/{chunk-ZYREOING.js → chunk-XE33FV5W.js} +2 -2
- package/dist/chunk-XFMVKFSF.js +2 -0
- package/dist/{chunk-BBEDPVPB.js → chunk-XGGBK66W.js} +2 -2
- package/dist/{chunk-OFUBXBYX.js → chunk-XJX6LGHL.js} +2 -2
- package/dist/{chunk-Z3GCK3PD.js → chunk-XN22RGSR.js} +2 -2
- package/dist/{chunk-HWLCBKFE.js → chunk-XSWYJCAK.js} +2 -2
- package/dist/{chunk-IGKKTHJR.js → chunk-XU75YQN4.js} +2 -2
- package/dist/{chunk-E4EJBGDZ.js → chunk-Y2VM4CJC.js} +2 -2
- package/dist/{chunk-U7LRSQG6.js → chunk-Y334QQU5.js} +2 -2
- package/dist/{chunk-APLKXICZ.js → chunk-YAGYMBEX.js} +2 -2
- package/dist/{chunk-XITQLISP.js → chunk-YIHNPKWD.js} +2 -2
- package/dist/chunk-YXPUP5G2.js +11 -0
- package/dist/{chunk-6BJ7SOY7.js → chunk-Z2AWCTN6.js} +2 -2
- package/dist/{chunk-PHSPBQM6.js → chunk-Z2PZVKPR.js} +2 -2
- package/dist/{chunk-QXR5QPSF.js → chunk-ZAZGGSM3.js} +2 -2
- package/dist/{chunk-5236NQV3.js → chunk-ZGW4HLPD.js} +2 -2
- package/dist/chunk-ZOXKSQQB.js +2 -0
- package/dist/{chunk-BD6CV7PN.js → chunk-ZPASRBLF.js} +2 -2
- package/dist/{chunk-DMUGTKMD.js → chunk-ZYM4HOFA.js} +2 -2
- package/dist/{chunk-4ILHWBYF.js → chunk-ZZ3Z7D56.js} +2 -2
- package/dist/cli-main.js +4 -4
- package/dist/{code-CczEvHui.d.ts → code-B17qEMbt.d.ts} +1 -1
- package/dist/code-EQJFDT6I.js +2 -0
- package/dist/code-result-json-7UWIWBOO.js +2 -0
- package/dist/command-descriptors-ORNTVNYV.js +342 -0
- package/dist/{config-types-Cm-VSEBb.d.ts → config-types-B9B60MiR.d.ts} +10 -0
- package/dist/dataflow-6VL54GX5.js +2 -0
- package/dist/{db-LKJXAlNS.d.ts → db-BwIVAYNB.d.ts} +1 -1
- package/dist/dependence-slice-DT2NUHD2.js +2 -0
- package/dist/deps-DB7H5IKC.js +2 -0
- package/dist/direct-navigation-O3LUAYWQ.js +3 -0
- package/dist/entry-map-6K62RV3D.js +2 -0
- package/dist/files-MSLD7MO6.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-IVBXAKFA.js +2 -0
- package/dist/imports-FRAVZ3Y2.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/members-KJOJDYGO.js +2 -0
- package/dist/methods-2AYABBT3.js +2 -0
- package/dist/output-continuation-command-JHMPH6NC.js +3 -0
- package/dist/{output-pagination-VAWOGX4R.js → output-pagination-3OFL2MJV.js} +2 -2
- package/dist/project-reindex-HYO4WD7Z.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 +13 -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-ARMA6XUJ.js +2 -0
- package/dist/refs-pagination-VUGIWN6U.js +2 -0
- package/dist/reindex-worker.js +125 -66
- package/dist/reindex.d.ts +5 -3
- package/dist/reindex.js +135 -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-YOB5YFAM.js +2 -0
- package/dist/surface-VY5EFWTW.js +2 -0
- package/dist/symbol-resolution-DGQN4XIV.js +2 -0
- package/dist/system-2KQ3QD2P.js +2 -0
- package/dist/trace-HTIPTXAE.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-5FV3VQI7.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-5IZTXSOL.js +0 -117
- 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-AA7K3XLM.js +0 -21
- package/dist/chunk-AUP6YI5M.js +0 -2
- package/dist/chunk-CA5RE6H7.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-FEQIQ26E.js +0 -2
- 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-WK4FD4PG.js +0 -2
- package/dist/chunk-X434XZAI.js +0 -2
- 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,7 @@
|
|
|
1
|
+
import{a as U,b as j}from"./chunk-JHH5SCZ3.js";import{a as I}from"./chunk-K3XFWJI2.js";import{b as K}from"./chunk-57N6LN2A.js";import{b as z,e as N,i as b}from"./chunk-H5EXS3HM.js";import{d as X}from"./chunk-SB25YMEQ.js";import{d as A,e as w,f as F,h as G}from"./chunk-AK3PYTIK.js";var V=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as ee,statSync as Te}from"fs";import{dirname as ie,join as ae}from"path";import{appendFileSync as ge,existsSync as fe,mkdirSync as me,renameSync as pe,rmSync as ye,statSync as Re,truncateSync as be}from"fs";import{basename as xe,dirname as Be}from"path";var L=".previous",he=".rotation.lock",ve=2e3,J=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"},M=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"},q=Object.freeze({monotonicNow:X,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=K(e,{kind:"rotating-jsonl",detail:{target:xe(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){me(e,{recursive:!0})},exists:fe,readBytes(e){return F(e,{maxBytes:A,inputKind:"rotating JSONL segment"})},size(e){return Re(e).size},truncate:be,remove(e){ye(e,{force:!0})},rename:pe,append:ge});function Y(e,t,n){let r=n.runtime??q,a=JSON.stringify(t);if(a===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let s=Buffer.from(`${a}
|
|
2
|
+
`),i=Math.max(1,Math.floor(n.maxSegmentBytes),s.length);return Z(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(Be(e));let c=Ae(e,A,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??L}`,u=!1,g=!1;return r.exists(e)&&r.size(e)+s.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,s),n.onPhase?.("record-appended"),{lineBytes:s.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:u,prunedPrevious:g}})}function H(e,t={}){let n=t.runtime??q,r=Le(t.maxSegmentBytes);return Z(e,t.lockTimeoutMs,n,()=>{let a=[],s=0,i=`${e}${t.previousSuffix??L}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=Se(Q(c,r,n));a.push(...o.lines),s+=o.partialTailBytes}return{lines:a,ignoredPartialTailBytes:s}})}function Z(e,t,n,r){let a=`${e}${he}`,s=Math.max(0,t??ve),i=n.monotonicNow()+s,c;for(;;){let m=n.tryAcquireLock(a,e);if(m.kind==="acquired"){c=m.lock;break}let R=i-n.monotonicNow();if(R<=0)throw new J(a,s);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 M(a);return g}function Ae(e,t,n){if(!n.exists(e))return 0;let r=Q(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let a=r.lastIndexOf(10),s=a<0?0:a+1;return n.truncate(e,s),r.length-s}function Le(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 Q(e,t,n){let r=n.size(e);if(r>t)throw new w("rotating JSONL segment",e,"too-large",r,t);let a=n.readBytes(e),s=n.size(e);if(s!==r||a.byteLength!==r)throw new w("rotating JSONL segment",e,"changed-during-read",s,t);return a}function Se(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
3
|
+
`).filter(a=>a.length>0),partialTailBytes:e.length-n}}var Oe="reindex-activity.jsonl",S=L,ke=1024*1024,Pe=1440*60*1e3,te=e=>G(e,"reindex activity segment");function T(e){return ae(ie(e),Oe)}function se(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:C(e.indexPath))+C(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let a=r.producedOutputBytes??r.outputBytes;a!==null&&(n+=a)}return n}function Ee(e){let t=se(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function st(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=se(t);return D(T(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:Ee(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:Ce(t)})}function ot(e,t){return D(T(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function ut(e,t,n=new Date){return D(T(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function _e(e,t,n=ke,r){Y(e,t,{maxSegmentBytes:n,previousSuffix:S,...r?{runtime:r}:{}})}function we(e,t=new Date,n=Pe,r=te){let a=t.getTime(),s=a-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(s).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=T(e),o=[];if(r===te){if(!ee(c)&&!ee(`${c}${S}`))return i;try{let u=H(c,{previousSuffix:S});o=u.lines,i.ignoredPartialTailBytes=u.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let u=0;for(let g of[`${c}${S}`,c])try{o.push(...Ue(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=Ne(u);if(!g){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:l}=g,m=Date.parse(l.recordedAt);if(m<s||m>a){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=Ie(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 oe(l.byLanguage)){let y=(i.byLanguage??={})[x]??=Fe();y.runs+=1,y[p.result]+=1,y.producedOutputBytes+=p.producedOutputBytes,y.durationMs+=p.durationMs}ne(l)&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=l.recordedAt),ne(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=Ge(i),i}function D(e,t){try{return _e(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Ne(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!z(n.recordedAt)||!n.trigger||!Me(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:a,...s}=r,i=De(a);return{record:{...s,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function Ie(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function dt(e,t,n=new Date){return t.enabled?Je(we(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function Je(e,t,n){let r=e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,a=e.fullRebuilds??e.rebuilt,s={rebuilt:a,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...s,detail:`reindex activity evidence is ${e.confidence}`}:a>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:re(e.oldestRebuildAt,t.windowMs,n),...s,detail:`${a}/${t.maxRebuilds} expensive full rebuild slots consumed`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:re(e.oldestWriteAt,t.windowMs,n),...s,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed`}:{state:"allowed",...s}:{state:"allowed",...s}}function ne(e){if(e.result!=="rebuilt")return!1;let t=oe(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 Me(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 C(e){try{return Te(e).size}catch{return 0}}function Ce(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(u=>u.language===n),a=r.find(u=>u.id===n),s=e.reused||(a?a.reused:r.length>0&&r.every(u=>u.reused)),i=C(ae(ie(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:a?.outputBytes??i,o=s?0:a?.durationMs??r.filter(u=>!u.reused).reduce((u,g)=>u+g.durationMs,0);t[n]={result:s?"reused":"rebuilt",strategy:s?"reused":a?.strategy??"full",...a?.strategy==="full"&&(a.fallbackReason??a.missReason)?{fallbackReason:a.fallbackReason??a.missReason}:{},outputBytes:c,producedOutputBytes:s?0:a?.producedOutputBytes??c,durationMs:o}}return t}function De(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[a,s]of Object.entries(e)){if(!$e(a)||!We(s)){n+=1;continue}t[a]=s}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function We(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")&&N(t.outputBytes)&&N(t.producedOutputBytes)&&b(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function $e(e){return I.includes(e)}function oe(e){return e?I.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function Fe(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function Ge(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function Ue(e){return e.endsWith(`
|
|
4
|
+
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
5
|
+
`)+1))),e.split(`
|
|
6
|
+
`).filter(t=>t.length>0)}function ct(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function gt(e){if(!(!e||Buffer.byteLength(e)>65536))try{return je(JSON.parse(e))}catch{return}}function je(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(t.version!==1||t.baseGeneration!==null&&typeof t.baseGeneration!="string"||typeof t.complete!="boolean"||!Array.isArray(t.entries)||t.entries.length>1024||t.incompleteReason!==void 0&&typeof t.incompleteReason!="string")return;let n=[],r=new Set;for(let a of t.entries){if(!a||typeof a!="object"||Array.isArray(a))return;let s=a;if(typeof s.path!="string"||!ze(s.path)||s.kind!=="add"&&s.kind!=="change"&&s.kind!=="delete"||r.has(s.path))return;r.add(s.path),n.push({path:s.path,kind:s.kind})}if(!(t.complete&&t.incompleteReason!==void 0)&&!(!t.complete&&(!t.incompleteReason||t.incompleteReason.trim()==="")))return{version:1,baseGeneration:t.baseGeneration,complete:t.complete,...t.incompleteReason===void 0?{}:{incompleteReason:t.incompleteReason},entries:n}}function ze(e){return!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:\//.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}import{spawn as Xe}from"child_process";import{platform as ue}from"os";import{performance as de}from"perf_hooks";var bt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},v=class extends Error{constructor(n,r,a,s={}){super(a,s.cause===void 0?void 0:{cause:s.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=s.timedOut??!1,this.reaped=s.reaped??!1,this.stdout=s.stdout??"",this.stderr=s.stderr??"",this.stdoutTruncated=s.stdoutTruncated??!1,this.stderrTruncated=s.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function h(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function le(e,t,n,r){let a=Math.max(0,r-n);a>0&&e.push(t.subarray(0,a))}function ce(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function xt(e){h(e.timeoutMs,"timeoutMs"),h(e.maxStdoutBytes,"maxStdoutBytes"),h(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;h(t,"terminationGraceMs");let n=e.terminationForceMs??t;return h(n,"terminationForceMs"),new Promise((r,a)=>{let s=de.now(),i=ue()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=ue()!=="win32"&&!i,o;try{o=Xe(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);a(new v("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,W=o.pid===void 0?null:U(o.pid,c),O=()=>{clearTimeout($),e.signal?.removeEventListener("abort",P)},k=d=>{if(y||!p)return;y=!0,O();let f=Buffer.concat(u).toString("utf8"),E=Buffer.concat(g).toString("utf8"),_=d.reaped||!d.detail?"":` Process-tree cleanup failed: ${d.detail}`;a(new v(p.kind,e.label,`${p.message}${_}`,{timedOut:p.timedOut,reaped:d.reaped,stdout:f,stderr:E,stdoutTruncated:R,stderrTruncated:x}))},B=d=>{if(!(p||y)){if(p=d,!W){k({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}j(W,{gracefulMs:t,forceMs:n}).then(k,f=>{k({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},$=setTimeout(()=>{B({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);$.unref();let P=()=>{B({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",P,{once:!0}),e.signal?.aborted&&P(),o.stdout.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?ce(u,f,e.maxStdoutBytes):le(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"?ce(g,f,e.maxStderrBytes):le(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){O(),y=!0,a(new v("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,O();let E=Buffer.concat(u).toString("utf8"),_=Buffer.concat(g).toString("utf8");r({status:d,signal:f,stdout:E,stderr:_,timedOut:!1,durationMs:de.now()-s,stdoutTruncated:R,stderrTruncated:x})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{bt as a,v as b,xt as c,V as d,L as e,Y as f,Oe as g,st as h,ot as i,ut as j,we as k,dt as l,ct as m,gt as n};
|
|
7
|
+
//# sourceMappingURL=chunk-EDMB6SSO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-PLYUVM4F.js";import{a as p}from"./chunk-Z2AWCTN6.js";import{a as g,c as y}from"./chunk-BWVQP3LB.js";import{d as b}from"./chunk-TD7VKJ2Y.js";function x(i,n={}){let{limit:f=20,scope:l,minFanIn:c=2,minFanOut:m=2,scanLimit:o}=n,a=new h(i),r=v(a.productionCallableDefinitions({scope:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o),s=n.semantic!==!1,d=y(i,r,{limit:500,semantic:s,semanticEvidence:p});return r.map(e=>S(i,e,s,d.get(e.symbolId)??[])).filter(e=>e.fanIn>=c&&e.fanOut>=m).sort((e,t)=>t.score-e.score||t.fanIn-e.fanIn).slice(0,f)}function B(i,n={}){return x(i,n)}function S(i,n,f,l){let c=[...new Set(l.map(e=>e.file))].sort(),m=[...new Set(l.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),o=new Map;for(let e of g(i,n,{limit:500,semantic:f,semanticEvidence:p})){if(e.file===n.relativePath)continue;let t=`${e.symbol}|${e.file}`;o.has(t)||o.set(t,{symbol:e.symbol,shortName:b(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let a=[...o.values()].sort((e,t)=>e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)),r=c.length,s=a.length,d=r*s,u=a.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:b(n.symbol),fanIn:r,fanOut:s,callerFiles:c,candidateCallerFiles:m,externalCallees:a.map(({symbol:e,shortName:t,file:C})=>({symbol:e,shortName:t,file:C})),externalCalleeEvidence:a,candidateExternalCallees:u,inputBasis:"mixed-static-call-or-reference-evidence",score:d,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${r} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${d} (fan-in * fan-out)`,`${m.length} incoming file(s) and ${u.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{x as a,B as b};
|
|
2
|
+
//# sourceMappingURL=chunk-EELG7D3Q.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{M as f,N as S,Q as R,Z as M}from"./chunk-C7IJMOFP.js";import{b as B}from"./chunk-YXPUP5G2.js";import{b as N,c as _,d as w,f as k,g as A,h as z}from"./chunk-DRENNWRG.js";import{c as O}from"./chunk-IW5XQG5G.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
|
+
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-EELPBR7E.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as O,b as H,c as ce,e as le,f as U,j as fe}from"./chunk-TQZV7KV4.js";import{R as v,S as de,d as ie,e as se,f as K,m as ae}from"./chunk-C7IJMOFP.js";import{a as A}from"./chunk-YXPUP5G2.js";import{d as w,e as pe}from"./chunk-DRENNWRG.js";import{c as re}from"./chunk-IW5XQG5G.js";import{a as j,e as x}from"./chunk-HGFDYOVB.js";import{h as ne,ia as oe,na as $}from"./chunk-AK3PYTIK.js";import{existsSync as E}from"fs";import b from"path";var _=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(i,t){let e=t?b.dirname(b.join(i,t)):i,o=b.resolve(i);for(;e.startsWith(o);){for(let a of _){let s=b.join(e,a);if(E(s))return s}let r=b.dirname(e);if(r===e)break;e=r}for(let r of _){let a=b.join(i,r);if(E(a))return a}return null}function ue(i){let t=i.config.projectRoot,n=new Set(Le(t,i.config.semantic?.typescript?.tsconfigs)),e=A(i,{includeIgnored:!1,extensions:O});for(let o of e){let r=z(t,o);r&&n.add(b.resolve(r))}if(n.size===0){let o=z(t);o&&n.add(b.resolve(o))}return[...n].filter(o=>!me(t,o)).sort((o,r)=>o.localeCompare(r))}function Le(i,t=[]){let n=new Set;for(let e of t){let o=b.isAbsolute(e)?e:b.join(i,e);E(o)&&n.add(b.resolve(o))}for(let e of we(i))for(let o of _){let r=b.join(e,o);E(r)&&n.add(b.resolve(r))}if(n.size===0){let e=z(i);e&&n.add(b.resolve(e))}return[...n].filter(e=>!me(i,e)).sort((e,o)=>e.localeCompare(o))}function we(i){let t=b.join(i,"package.json");if(!E(t))return[];let n;try{n=JSON.parse(ne(t,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(o=>se(i,o))}function me(i,t){let n=b.relative(i,t).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function I(i,t,n){if(i.has(t))return i.get(t);let e=n();return i.set(t,e),e}import he from"path";import{realpathSync as ye}from"fs";function Ee(i,t){return i.getReferences().map(n=>{let e=n.getNode();return B(e,t)})}function je(i){let t=i;return typeof t.findReferences=="function"?t.findReferences():[]}function Se(i,t,n,e){let o=[];for(let r of je(i))for(let a of Ee(r,e))a.file===t.relativePath&&a.line>=t.startLine&&a.line<=t.endLine||o.push(a);for(let r of n)o.push(r);return P(o)}function be(i,t,n,e){let o=[],r=n?.getStart();for(let a of i.getReferences()){let s=a.getNode();L(e,s.getSourceFile().getFilePath())===t&&(r!==void 0&&s.getStart()===r||o.push({location:B(s,e),node:s}))}return o}function B(i,t){let n=i.getSourceFile(),e=n.getLineAndColumnAtPos(i.getStart());return{file:L(t,n.getFilePath())??n.getBaseName(),line:e.line-1,column:e.column-1}}function Me(i,t,n){let e=i.getSourceFile(),o=q(e,i),r=i.getText(),a=new RegExp(`\\b${ae(r)}\\b`,"g"),s=e.getFullText().split(`
|
|
2
|
+
`),c=[];for(let l=0;l<s.length;l++){if(l===o)continue;let f=s[l]??"";a.lastIndex=0;let p;for(;(p=a.exec(f))!==null;)c.push({file:t,line:l,column:p.index})}return P(c.filter(l=>L(n,he.join(n,l.file))===t))}function V(i){for(let t=i;t;t=t.getParent()){let n=t.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(i,t){return i.getLineAndColumnAtPos(t.getStart()).line-1}function P(i){let t=new Set,n=[];for(let e of i){let o=`${e.file}:${e.line}:${e.column}`;t.has(o)||(t.add(o),n.push(e))}return n}function L(i,t){let n=i||process.cwd(),e=ge(n,t);if(e)return e;try{return ge(ye(n),ye(t))}catch{return null}}function ge(i,t){let n=he.relative(i,t).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Ie(i,t,n,e){let o=Ae(t,e);return o.size===0?new Map:Oe(i,n,o)}function Ae(i,t){let n=new Map;for(let e of v(i,t)){let o=w(e.symbol)??e.leaf;if(!o)continue;let r=n.get(o);r||(r=[],n.set(o,r)),r.push(e)}return n}function Oe(i,t,n){let e=new Map,o=new Map;return t.forEachDescendant(r=>{for(let a of He(i,r)){let s=n.get(a);if(!s)continue;let c=q(t,r);for(let l of s){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=o.get(l.symbolId);p!==void 0&&p<=f||(o.set(l.symbolId,f),e.set(l.symbolId,r))}}}),e}function He(i,t){let n=[],e=o=>{o&&!n.includes(o)&&n.push(o)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let o=t.getNameNode();e(o?.getText())}if("getName"in t&&typeof t.getName=="function"){let o=t.getName();e(o)}return i.Node.isIdentifier(t)&&e(t.getText()),n}var Ue=re("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function Fe(i,t,n,e){let o=J(i,t),r=Y(o.get(e)??[],n);if(r)return r;let a=[];for(let s of o.values())for(let c of s)((c.leaf||w(c.symbol)||"").includes(e)||c.symbol.includes(e))&&a.push(c);return Y(a,n)}function G(i,t,n,e){return Y(J(i,t).get(e)??[],n)}function xe(i,t){let n=new Map;for(let[e,o]of J(i,t)){let r=o[0];r&&n.set(e,r)}return n}function J(i,t){return Ue.get(i,t,()=>{let n=new Map;for(let e of v(i,t)){let o=e.leaf||w(e.symbol);if(!o)continue;let r=n.get(o);r||(r=[],n.set(o,r)),r.push({...e,leaf:o})}for(let e of n.values())e.sort((o,r)=>o.startLine-r.startLine||o.endLine-r.endLine||o.symbolId-r.symbolId);return n})}function Y(i,t){let n=null,e=Number.POSITIVE_INFINITY;for(let o of i){let r=Math.abs(o.startLine-t);(r<e||r===e&&n&&o.startLine<n.startLine)&&(n=o,e=r)}return n}import Be from"path";import{realpathSync as We}from"fs";function ke(i,t){let n=new Map,e=null,o=null,r=()=>(o??=A(i,{extensions:O}),o),a=()=>(e??=x("typescript.source-file-index",()=>$e(i.config.projectRoot,t,r()),()=>({projects:t.length,indexedDocuments:r().length})),e),s=c=>H(c)?I(n,c,()=>{let l=Te(i.config.projectRoot,c);if(!l)return null;for(let{project:f,sourceFiles:p}of a()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&X(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>s(c)?.sourceFile??null,sourceFileMatch:s,indexedTypeScriptLikeDocuments:r}}function $e(i,t,n){let e=t.map(({project:o})=>{let r=new Map;for(let a of o.getSourceFiles())X(r,a);return{project:o,sourceFiles:r}});for(let o of n){let r=Te(i,o);if(r)for(let a of e){if(a.sourceFiles.has(r))break;let s=a.project.addSourceFileAtPathIfExists(r)??null;if(s){X(a.sourceFiles,s);break}}}return e}function X(i,t){let n=Q(t.getFilePath());i.set(n,t);try{i.set(Q(We(n)),t)}catch(e){if(!$(e))throw e}}function Te(i,t){try{return Q(oe(i,t,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!$(n))throw n;return null}}function Q(i){return Be.resolve(i)}function Z(i,t){for(let n of i)if(t===n.name||t.startsWith(`${n.name}/`))return n.name;return null}function De(i){let t=`${i.relativeDir}/src`;return[`${t}/index.ts`,`${t}/index.tsx`,`${t}/index.mts`,`${t}/index.cts`]}var Ke=32;function Vt(i,t){let n=x("typescript.provider.load",()=>ce());if(!n)return U("ts-morph is not installed");let e=x("typescript.provider.tsconfig-discovery",()=>ue(i));if(e.length===0)return U("no tsconfig found");try{let o=x("typescript.provider.project-bundles",()=>le(n,e),()=>({tsconfigs:e.length}));return _e(i,n,o)}catch(o){return U(o instanceof Error?o.message:String(o),e[0],e)}}function _e(i,t,n,e={}){return x("typescript.provider.construct",()=>new ee(i,t,n),()=>({tsconfigs:n.length,reusedProjects:e.reusedProjects===!0}))}var ee=class{constructor(t,n,e){this.db=t;this.tsMorph=n;this.projects=e;this.workspacePackages=ie(t.config.projectRoot),this.sourceFiles=ke(t,e)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return I(this.importUsageCache,t,()=>{let n=this.sourceFiles.sourceFile(t);if(!n)return[];let e=Ve();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,n,e),()=>({file:t,...e}))})}referencesFor(t){return I(this.referencesCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,n)})}referencesForDefinitions(t,n={}){let e=new Map,o=j(),r=[];for(let f of t){let p=this.referencesCache.get(f.symbolId);p?e.set(f.symbolId,p):r.push(f)}if(r.length===0)return e;let a=r,s=n.exact?[]:r.filter(f=>!Ce(f));if(s.length>=Ke){let f=this.referencesForDefinitionsBySymbolScan(s);for(let p of s){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}if(a=r.filter(p=>Ce(p)),a.length===0)return e}let c=new Map;for(let f of a){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Re();x("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){o&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;o&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,o?d:void 0);this.referencesCache.set(y.symbolId,u),e.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...ve(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}}return e}referenceFragmentsForFiles(t){let n=de(this.db).filter(r=>H(r.relativePath)),e=t.filter(r=>this.sourceFiles.sourceFile(r)!==null),o=this.referencesForDefinitionsBySymbolScan(n,e);return fe(n,o,e)}referencesForDefinitionsBySymbolScan(t,n){let e=j(),o=Re(),r=new Map,a=new Set(t.map(c=>c.symbolId)),s=new Map(t.map(c=>[c.symbolId,c]));for(let c of t)r.set(c.symbolId,[]);return x("typescript.references-map.inverted-scan",()=>{let c=e?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of t){let g=l.get(u.symbolId)??[];if(g.length>0){let k=r.get(u.symbolId)??[];k.push(...g),r.set(u.symbolId,k)}e&&(o.packageReferenceCount+=g.length)}e&&(o.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(t),S=new Set(t.map(u=>u.leaf).filter(Boolean)),y=e?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(e&&(o.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,a,s,d,S,f,p,r,e?o:void 0))}e&&(o.scanMs+=m.now()-y);let h=e?m.now():0;this.addHierarchyMemberReferences(t,r,e?o:void 0),e&&(o.hierarchyMs+=m.now()-h);for(let[u,g]of r){let k=P(g);r.set(u,k),e&&(o.referenceCount+=k.length)}},()=>({definitions:t.length,...ve(o)})),r}addReferencesFromSourceFileScan(t,n,e,o,r,a,s,c,l,f){let p=this.compilerCheckerForSourceFile(t),d=t.compilerNode,S=Ge(t),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!a.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;s.has(u)?g=s.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),s.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let k=I(c,u,()=>this.compilerSymbolKeys(u)),C=null,T=null,R=g&&e.has(g.symbolId)?o.get(g.symbolId):void 0;if(R&&(C=W(d,h),!Ne(R,n,C))){let N=d.getLineAndCharacterOfPosition(h.getStart(d));T={file:n,line:N.line,column:N.character};let D=l.get(R.symbolId)??[];D.push(T),l.set(R.symbolId,D),f&&(f.requestedHits+=1)}for(let N of k)for(let D of r.get(N)?.values()??[]){if(C??=W(d,h),Ne(D,n,C))continue;if(!T){let F=d.getLineAndCharacterOfPosition(h.getStart(d));T={file:n,line:F.line,column:F.character}}let M=l.get(D.symbolId)??[];M.push(T),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsForDefinitions(t){let n=new Map;for(let e of t){let o=this.nodeForDefinition(e),r=o?.compilerNode;if(!r||!this.isHierarchyMethod(r))continue;let a=r.parent;if(!this.isHierarchyContainer(a))continue;let s=this.compilerCheckerForSourceFile(o.getSourceFile()),c=s.getSymbolAtLocation(r.name);if(c)for(let l of this.hierarchyMemberSymbols(s,a,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(e.symbolId,e),n.set(f,p)}}return n}hierarchyMemberSymbols(t,n,e){let o=new Set,r=new Set,a=(s,c,l)=>{if(!r.has(s)){r.add(s),o.add(c);for(let f of l){let p=f.getProperty(e.name);p&&a(f,p,this.hierarchyAncestorTypesForType(t,f))}}};return a(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}addHierarchyMemberReferences(t,n,e){let o=new Map;for(let r of t){let a=this.nodeForDefinition(r),s=a?.compilerNode;if(!s||!this.isHierarchyMethod(s))continue;let c=s.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(a.getSourceFile()),f=l.getSymbolAtLocation(s.name);if(!f)continue;let p=s.getSourceFile(),d=p.getLineAndCharacterOfPosition(s.name.getStart(p)),S={definition:r,location:{file:r.relativePath,line:d.line,column:d.character}},y=n.get(r.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),e&&(e.hierarchyReferences+=1);n.set(r.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=o.get(u)??new Map;g.set(r.symbolId,S),o.set(u,g)}e&&(e.hierarchyDefinitions+=1)}for(let r of o.values())if(!(r.size<2)){e&&(e.hierarchyFamilies+=1);for(let{definition:a}of r.values()){let s=n.get(a.symbolId)??[];for(let c of r.values())c.definition.symbolId!==a.symbolId&&(s.push(c.location),e&&(e.hierarchyReferences+=1));n.set(a.symbolId,s)}}}hierarchyRootMemberSymbols(t,n,e){let o=new Set,r=new Set,a=(s,c,l)=>{if(r.has(s))return;r.add(s);let f=!1;for(let p of l){let d=p.getProperty(e.name);d&&(f=!0,a(p,d,this.hierarchyAncestorTypesForType(t,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))o.add(p)};return a(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}compilerSymbolKeys(t){return(t.declarations??[]).map(n=>{let e=n.getSourceFile();return`${e.fileName}\0${n.getStart(e)}\0${t.name}`})}compilerSymbolLocations(t){let n=[];for(let e of t.declarations??[]){let o=e.getSourceFile(),r=L(this.db.config.projectRoot,o.fileName);if(!r)continue;let a=e.name,s=o.getLineAndCharacterOfPosition((a??e).getStart(o));n.push({file:r,line:s.line,column:s.character})}return n}baseTypes(t,n){try{return t.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(t,n){let e=new Set(this.hierarchyAncestorTypesForType(t,t.getTypeAtLocation(n)));for(let o of n.heritageClauses??[])for(let r of o.types)e.add(t.getTypeAtLocation(r));return[...e]}hierarchyAncestorTypesForType(t,n){let e=new Set(this.baseTypes(t,n));for(let o of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(o))for(let r of o.heritageClauses??[])for(let a of r.types)e.add(t.getTypeAtLocation(a));return[...e]}isHierarchyMethod(t){return this.tsMorph.ts.isMethodDeclaration(t)||this.tsMorph.ts.isMethodSignature(t)}isHierarchyContainer(t){return this.tsMorph.ts.isClassDeclaration(t)||this.tsMorph.ts.isClassExpression(t)||this.tsMorph.ts.isInterfaceDeclaration(t)}compilerReferenceSymbol(t,n,e){e&&(e.symbolLookups+=1);let o=t.getSymbolAtLocation(n);if(o){if((o.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return o;try{return e&&(e.aliasResolutions+=1),t.getAliasedSymbol(o)}catch{return o}}}calleesFor(t){return I(this.calleesCache,t.symbolId,()=>I(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath)).get(t.symbolId)??[])}calleesForDefinitions(t){let n=new Map,e=new Map;for(let o of t){let r=e.get(o.relativePath);r?r.push(o):e.set(o.relativePath,[o])}for(let[o,r]of e){let a=this.fileCalleesCache.get(o),s=new Set(r.map(l=>l.symbolId)),c=a??this.calleeMapForFile(o,s);for(let l of r){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(t,n,e){let o=e?m.now():0,r=this.packageImportReferencesForDefinition(t);if(e&&(e.packageRefsMs+=m.now()-o,e.packageReferenceCount+=r.length),!n)return r;let a=e?m.now():0,s=Se(n,t,r,this.db.config.projectRoot);return e&&(e.semanticRefsMs+=m.now()-a,e.referenceCount+=s.length),s}signatureFor(t){return I(this.signatureCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let e=n.getType().getCallSignatures()[0];if(!e)return null;let o=e.getParameters().map(a=>{let s=a.getDeclarations()[0],c=s?a.getTypeAtLocation(s).getText(s):a.getValueDeclaration()?.getType().getText()??"unknown";return Pe(c)}),r=e.getReturnType().getText(n);return`(${o.join(",")})=>${Pe(r)}`})}importUsageForSourceFile(t,n,e){let o=[],r=new Map;for(let a of n.getImportDeclarations()){e.declarations+=1;let s=K(this.db,t,a.getModuleSpecifierValue()),c=a.getImportClause()?.isTypeOnly()??!1;for(let l of te(a)){e.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?e.bindingSymbols+=1:e.missingBindingSymbols+=1);let p={sourcePath:s,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(o.push(p),c||!l.localName||!f)continue;let d=r.get(l.localName);d?d.push(p):r.set(l.localName,[p])}}return r.size>0&&n.forEachDescendant(a=>{if(a.getKindName()!=="Identifier")return;let s=r.get(a.getText());if(!s||qe(a))return;e.scannedIdentifiers+=1;let c=a.getSymbol()?.compilerSymbol;if(e.symbolLookups+=1,!!c){for(let l of s)if(l.bindingSymbol===c){l.references.push({location:B(a,this.db.config.projectRoot),node:a}),e.matchedReferences+=1;break}}}),o.map(a=>a.typeOnlyDeclaration?ze(t,a.sourcePath,a.entry):a.entry.identifier&&!a.bindingSymbol?(e.fallbackEntries+=1,this.valueImportUsageForEntry(t,a.sourcePath,a.entry)):this.valueImportUsageFromLocations(t,a.sourcePath,a.entry,a.references))}valueImportUsageForEntry(t,n,e){let o=e.identifier?e.identifier.findReferences():[],r=[];for(let a of o)for(let s of be(a,t,e.identifier,this.db.config.projectRoot))r.push(s);return this.valueImportUsageFromLocations(t,n,e,r)}valueImportUsageFromLocations(t,n,e,o){let r=o.some(c=>!V(c.node)),a=o.some(c=>V(c.node)),s=e.isTypeOnly;return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:s,isUsed:s||o.length>0,isTypeUsed:s||a,isValueUsed:r,references:o.map(c=>c.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferencesForFiles(t){let n=new Map,e=new Set;for(let r of t){let a=this.sourceFiles.sourceFile(r);if(a)for(let s of a.getImportDeclarations()){let c=Z(this.workspacePackages,s.getModuleSpecifierValue());c&&e.add(c)}}if(e.size===0)return n;let o=this.packageExportsForNames(e);for(let r of t)this.addPackageImportReferencesForDocument(n,o,r);for(let[r,a]of n)n.set(r,P(a));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,n=this.packageExports();for(let e of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,n,e);for(let[e,o]of t)t.set(e,P(o));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,n,e){if(this.db.isIgnored(e))return;let o=this.sourceFiles.sourceFileMatch(e);if(o)for(let r of o.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,n,e,r)}addPackageImportReferencesForDeclaration(t,n,e,o){let r=Z(this.workspacePackages,o.getModuleSpecifierValue());if(!r)return;let a=n.get(r);if(a)for(let s of te(o)){if(s.kind!=="named"||!s.identifier)continue;let c=a.get(s.importedName);if(!c||c.size===0)continue;let l=Me(s.identifier,e,this.db.config.projectRoot);l.length>0&&Ze(t,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(t=>t.name))),this.packageExportIndex)}packageExportsForNames(t){let n=new Map;for(let e of this.workspacePackages){if(!t.has(e.name))continue;let o=new Map;for(let r of De(e))this.collectPackageExports(e,r,o,new Set);o.size>0&&n.set(e.name,o)}return n}collectPackageExports(t,n,e,o){if(o.has(n))return;o.add(n);let r=this.sourceFiles.sourceFile(n);if(r)for(let a of r.getExportDeclarations()){let s=a.getModuleSpecifierValue(),c=s?K(this.db,n,s):n;if(!c||!c.startsWith(`${t.relativeDir}/src/`))continue;let l=a.getNamedExports();if(l.length===0){if(a.isNamespaceExport())continue;this.collectPackageExports(t,c,e,o);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=e.get(d);y||(y=new Set,e.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(t,n){return I(this.indexedDefinitionLeafCache,t,()=>xe(this.db,t)).get(n)??null}nodeForDefinition(t){return I(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return I(this.fileDefinitionNodeCache,t,()=>{let n=this.sourceFiles.sourceFile(t);return n?Ie(this.tsMorph,this.db,n,t):new Map})}referenceDefinitionFromCompilerSymbol(t){return this.definitionFromCompilerSymbol(t,void 0,!0)}definitionFromCompilerSymbol(t,n,e=!1){let o=t.name,r=n?m.now():0,a=t.declarations??[];n&&(n.declarationsMs+=m.now()-r,n.declarationChecks+=a.length);for(let s of a){let c=n?m.now():0,l=s.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(s.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(s),y=e?G(this.db,f,p,o)??(S&&S!==o?G(this.db,f,p,S):null):Fe(this.db,f,p,o);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(t){let n=t.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(t,n){let e=j(),o=0,r=0,a=0,s=0,c=0,l=0,f=0,p=0,d=e?Xe():void 0;return x("typescript.callee-map.file",()=>{let S=e?m.now():0,y=this.sourceFiles.sourceFile(t);if(e&&(c=Math.round(m.now()-S)),!y)return new Map;let h=e?m.now():0,u=v(this.db,t).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(e&&(l=Math.round(m.now()-h)),o=u.length,u.length===0)return new Map;let g=new Map,k=e?m.now():0,C=this.compilerCheckerForSourceFile(y),T=y.compilerNode;e&&(f=Math.round(m.now()-k));let R=new Map,N=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){e&&(r+=1);let F=this.semanticCalleeForCallNode(C,T,u,M,R,n,d);F&&(e&&(a+=1),Ye(g,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,N)},D=e?m.now():0;N(T),e&&(p=Math.round(m.now()-D));for(let[M,F]of g)g.set(M,et(F));return s=g.size,g},()=>({relativePath:t,definitions:o,callNodes:r,resolvedCallees:a,outputRows:s,requestedDefinitions:n?.size??o,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?Qe(d):{}}))}semanticCalleeForCallNode(t,n,e,o,r,a,s){let c=s?m.now():0,l=Je(e,W(n,o));if(s&&(s.callerLookupMs+=m.now()-c),!l)return null;if(a&&!a.has(l.symbolId))return s&&(s.skippedUnrequestedCallers+=1),null;let f=o.expression,p=this.compilerSymbolForExpression(t,f,s),d=null;if(p)if(s&&(s.targetSymbolHits+=1),r.has(p))s&&(s.compilerSymbolCacheHits+=1),d=r.get(p)??null;else{s&&(s.compilerSymbolCacheMisses+=1);let S=s?m.now():0;d=this.definitionFromCompilerSymbol(p,s),s&&(s.targetLookupMs+=m.now()-S),r.set(p,d)}else s&&(s.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:W(n,o)}}:null}compilerSymbolForExpression(t,n,e){let o=e?m.now():0,r=t.getSymbolAtLocation(n);if(e&&(e.expressionSymbolMs+=m.now()-o),r)return r;e&&(e.typeFallbacks+=1);let a=e?m.now():0,s=t.getTypeAtLocation(n).getSymbol();return e&&(e.typeSymbolMs+=m.now()-a),s}compilerCheckerForSourceFile(t){let n=t.getProject(),e=this.compilerCheckerCache.get(n);return e||(e=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,e)),e}};function te(i){let t=[],n=i.getDefaultImport();n&&t.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let e=i.getNamespaceImport();e&&t.push({identifier:e,importedName:"*",localName:e.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let o of i.getNamedImports()){let r=o.getNameNode(),s=o.getAliasNode()??(r.getKindName()==="Identifier"?r:null);t.push({identifier:s,importedName:r.getText(),localName:s?.getText()??r.getText(),kind:"named",isTypeOnly:o.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function ze(i,t,n){return{importer:i,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ve(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function qe(i){for(let t=i;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function Ye(i,t,n){let e=i.get(t);e||(e=[],i.set(t,e)),e.push(n)}function Ge(i){let t=new Set;for(let n of i.getImportDeclarations())for(let e of te(n))e.localName&&t.add(e.localName);return t}function Je(i,t){let n=null;for(let e of i)t<e.startLine||t>e.endLine||(!n||e.startLine>=n.startLine)&&(n=e);return n}function W(i,t){return i.getLineAndCharacterOfPosition(t.getStart(i)).line}function Ne(i,t,n){return t===i.relativePath&&n>=i.startLine&&n<=i.endLine}function Ce(i){return i.symbol.includes("#")?pe(i.symbol)==="type"&&i.relativePath.endsWith(".d.ts"):!1}function Xe(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function Qe(i){return{...i,callerLookupMs:Math.round(i.callerLookupMs),expressionSymbolMs:Math.round(i.expressionSymbolMs),typeSymbolMs:Math.round(i.typeSymbolMs),targetLookupMs:Math.round(i.targetLookupMs),declarationsMs:Math.round(i.declarationsMs),declarationLocationMs:Math.round(i.declarationLocationMs),indexedLookupMs:Math.round(i.indexedLookupMs)}}function Re(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function ve(i){return{...i,scanMs:Math.round(i.scanMs),packageRefsMs:Math.round(i.packageRefsMs),semanticRefsMs:Math.round(i.semanticRefsMs),hierarchyMs:Math.round(i.hierarchyMs)}}function Ze(i,t,n){for(let e of t){let o=i.get(e)??[];o.push(...n),i.set(e,o)}}function et(i){let t=new Set,n=[];for(let e of i){let o=`${e.symbol}|${e.file}|${e.line}|${e.callsiteLine??""}`;t.has(o)||(t.add(o),n.push(e))}return n}function Pe(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ue as a,Vt as b,_e as c};
|
|
3
|
+
//# sourceMappingURL=chunk-EETGXQY7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{q as p}from"./chunk-DKM723YF.js";import{g as o,i as d,k as s,l as c}from"./chunk-JT6XX7QY.js";import{c as a}from"./chunk-H5EXS3HM.js";import{join as S}from"path";var u=3,b=2,x="typescript-semantic";function R(n){let e=S(n,x),t=d(e);return{...t,requestDir:t.legacyRequestDir}}function q(n){let e=JSON.parse(n),t=e.protocolVersion,r=t===b;if(!r&&t!==u||typeof e.id!="string"||typeof e.generation!="string"||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.profileEnvironment!==void 0&&!a(e.profileEnvironment)||!e.request||!g(e.request)||!r&&(e.mailboxVersion!==o||typeof e.operationKey!="string"||!/^[a-f0-9]{64}$/.test(e.operationKey)||e.id!==c(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||e.deadlineAtMs<e.enqueuedAtMs))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!r){let i=e,y=s("typescript-semantic-v3",{generation:i.generation,profileEnvironment:i.profileEnvironment,request:i.request});if(i.operationKey!==y)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return i}let m=s("typescript-semantic-v2",{id:e.id,generation:e.generation,request:e.request});return{protocolVersion:u,mailboxVersion:o,id:e.id,operationKey:m,clientId:"legacy-v2",enqueuedAtMs:e.deadlineAtMs,deadlineAtMs:e.deadlineAtMs,generation:e.generation,...e.profileEnvironment?{profileEnvironment:e.profileEnvironment}:{},request:e.request}}function g(n){if(!n||typeof n!="object"||!("kind"in n))return!1;let e=n;switch(e.kind){case"availability":return!0;case"import-usage":return typeof e.file=="string";case"reference-fragments":return p(e.files)!==null;case"references":return l(e.definitions)&&(e.exact===void 0||typeof e.exact=="boolean");case"callees":return l(e.definitions);case"signature":return f(e.definition);default:return!1}}function l(n){return Array.isArray(n)&&n.every(f)}function f(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.symbolId=="number"&&typeof e.documentId=="number"&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&typeof e.startLine=="number"&&typeof e.endLine=="number"}export{u as a,R as b,q as c};
|
|
2
|
+
//# sourceMappingURL=chunk-ENWQWA2R.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-5H5WTJSD.js";import{b as i}from"./chunk-7JYHQAH2.js";import{existsSync as h}from"fs";import{isAbsolute as p,join as g}from"path";function D(e,n){let t=l(e,n,{allowMultiple:!1})[0]?.relativePath;return t||d(e,n)}function P(e,n){return l(e,n,{allowMultiple:!0}).map(t=>t.relativePath)}function S(e,n){let t=l(e,n,{allowMultiple:!0});return t.length===1?t[0].relativePath:null}function I(e,n){let t=i(e,n,{allowMultiple:!0,requirePathMatch:!0});return t.length===1?t[0].relativePath:null}function d(e,n){if(!n)return null;let t=n.replace(/\\/g,"/").replace(/^\.\//,""),r=p(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,o=g(e.config.projectRoot,r);return h(o)?r:null}function l(e,n,t){let r=d(e,n);if(r)return i(e,r,t).filter(a=>a.relativePath===r);let o=n.replace(/\\/g,"/").replace(/^\.\//,""),s=p(o)||o.includes("/"),c=i(e,n,{...t,requirePathMatch:s});if(c.length===0){if(s)return[];let a=u(e,n);return!a||e.isIgnored(a.relativePath)?[]:[{relativePath:a.relativePath,score:700}]}return c}export{D as a,P as b,S as c,I as d};
|
|
2
|
+
//# sourceMappingURL=chunk-ERCYGVAM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-7KCZELVM.js";import{a as b,b as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-7KCZELVM.js";import{a as b,b as S}from"./chunk-6NC3YSPY.js";import{a as m}from"./chunk-IXESDH3J.js";import{p as y}from"./chunk-2XCGSDIT.js";import{a as f}from"./chunk-EELPBR7E.js";import{c as r}from"./chunk-DRENNWRG.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
|
|
2
|
+
//# sourceMappingURL=chunk-EWWY2ZFL.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{c as o}from"./chunk-Q5TA4OY4.js";import{_ as n}from"./chunk-2BTJALUS.js";async function i(t){if(typeof t!="string"||t.length===0)throw new Error("Output continuation requires a cursor.");await o(t,n)}var u={id:"continue",command:"continue <cursor>",hidden:!0,description:"Continue an immutable output snapshot",renderShape:"custom",handler:i};export{u as a};
|
|
3
|
+
//# sourceMappingURL=chunk-F24G5NBE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
1
|
+
import{b as i}from"./chunk-56NQAEPJ.js";import{a as o}from"./chunk-T6QD2ZQB.js";import{W as l}from"./chunk-C7IJMOFP.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
2
|
WHERE relative_path IN (${a})
|
|
3
3
|
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-F24QUEQP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-H7CG6LOE.js";import{a as D}from"./chunk-ZYM4HOFA.js";import{a as g}from"./chunk-URSGGIZX.js";import{a as F}from"./chunk-7XZGZBSQ.js";import{a as y}from"./chunk-ISWFRGJ6.js";import{e as f}from"./chunk-6VEFRPTD.js";import{j as d}from"./chunk-TD7VKJ2Y.js";import{O as h}from"./chunk-7JYHQAH2.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FBCVASUG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{C as r}from"./chunk-AK3PYTIK.js";function _(t){switch(t){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function a(t){let s=r(t);return i(s)?"test":n(s)?"worker":u(s)?"entry":f(s)?"barrel":"source"}function i(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function n(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function u(t){let s=t.split("/"),e=s[s.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:s.length<=2:!1}function f(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}export{_ as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FELGD32K.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as V,b as C}from"./chunk-
|
|
1
|
+
import{a as V,b as C}from"./chunk-BJT7LSPK.js";import{a as I}from"./chunk-NRBNAECH.js";import{a as v,b,g as m,ma as k}from"./chunk-AK3PYTIK.js";import Re from"better-sqlite3";import{existsSync as tn}from"fs";import{dirname as on,join as sn,resolve as Se}from"path";import H from"better-sqlite3";import{execFileSync as W}from"child_process";import{existsSync as B,readdirSync as G}from"fs";import{extname as R,join as U}from"path";function De(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>K({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function K(e){let n=new Set((e.extensions??V).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!B(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=I(e.projectRoot),t=J(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new H(e.dbPath);try{let i=Y(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let f of l){if(i.has(f))continue;let p=k(e.projectRoot,f,{inputKind:"auxiliary source file"}),$=s.run(q(f),f,p);d+=Number($.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function J(e,n){let r=X(e,n);if(r)return r;let t=[],o=i=>{let s=i?U(e,i):e,a;try{a=G(s,{withFileTypes:!0})}catch{return}for(let u of a){if(C.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(R(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function X(e,n){try{return W("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
3
|
-
`).filter(t=>t&&n.has(R(t).toLowerCase())).sort()}catch{return null}}function Y(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function q(e){return R(e).toLowerCase()===".vue"?"vue":R(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as _e}from"fs";function je(e,n){let r=performance.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}function z(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:z(),skippedReferenceSamples:[]}}function
|
|
3
|
+
`).filter(t=>t&&n.has(R(t).toLowerCase())).sort()}catch{return null}}function Y(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function q(e){return R(e).toLowerCase()===".vue"?"vue":R(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as _e}from"fs";function je(e,n){let r=performance.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}async function $e(e,n){let r=performance.now(),t=await e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}function z(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:z(),skippedReferenceSamples:[]}}function F(e,n){e.skippedReferences+=n.skippedReferences;for(let r of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[r]+=n.skippedReferenceReasons[r];for(let t of n.skippedReferenceSamples.filter(o=>o.reason===r))e.skippedReferenceSamples.filter(i=>i.reason===r&&i.sourceFile===t.sourceFile).length<2&&e.skippedReferenceSamples.push(t)}}import{createRequire as Q}from"module";import{existsSync as Z}from"fs";import{dirname as T,extname as ee,join as L,relative as ne,resolve as Ke}from"path";import{pathToFileURL as te}from"url";function E(e,n){let{vueCore:r,ts:t,volarTs:o}=re(e),{parsed:i,vueOptions:s}=oe(r,t,n),a=T(n),u=r.createVueLanguagePlugin(t,i.options,s,p=>p),c=ie(r,t,u),l=se(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,p=>p,l),f=t.createLanguageService(d);return{ts:t,language:c,languageService:f,fileNames:i.fileNames,configDir:a}}function re(e){let n=Q(te(L(e,"package.json")).href);return{vueCore:h(n,"@vue/language-core",e),ts:h(n,"typescript",e),volarTs:h(n,"@volar/typescript",e)}}function oe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,T(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function ie(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!Z(i))return;let s=m(i,{maxBytes:b,inputKind:"Vue language-service source file"});t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??le(i))});return t.current=o,o}function se(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function h(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function A(e,n,r){let t=ae(e);return o=>{if(!o.name)return null;let i=g(n,o.fileName),s=r.get(o.fileName);if(!s)return null;let a=r.positionAt(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.starts.find(d=>d.line===a.line&&d.displayName===o.name);if(c)return c.symbolId;let l=u.containingByLine.get(a.line);return l&&l.displayName===o.name?l.symbolId:ue(u.starts,a.line,2,o.name)}}function ae(e){let n=e.prepare(`
|
|
4
4
|
SELECT
|
|
5
5
|
d.relative_path AS relativePath,
|
|
6
6
|
der.start_line AS startLine,
|
|
@@ -11,6 +11,6 @@ import{a as V,b as C}from"./chunk-GFLTPNWV.js";import{a as F}from"./chunk-7IOAZR
|
|
|
11
11
|
JOIN documents d ON d.id = der.document_id
|
|
12
12
|
JOIN global_symbols gs ON gs.id = der.symbol_id
|
|
13
13
|
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
14
|
-
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function ue(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function
|
|
15
|
-
`,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function ke(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function _(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function x(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ve(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function ue(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function P(e,n){let r=ge(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=fe(t,r,n,i);return o.set(i,s),s}}}function O(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(y(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*w(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function D(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function y(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function ce(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function N(e,n){return g(e,n).startsWith("node_modules/")}function g(e,n){return ne(e,n).replaceAll("\\","/")}function le(e){switch(ee(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function M(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let r=m(n,{maxBytes:b,inputKind:"Vue source file"}),t={text:r,lineStarts:de(r)};return e.set(n,t),t}catch{return e.set(n,null),null}},positionAt:ce}}function de(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function ge(e){try{let n=JSON.parse(m(L(e,"package.json"),{maxBytes:v,inputKind:"project package manifest"}));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function fe(e,n,r,t){let o=g(r,t),i=pe(n.name,n.version,o);return e.get(i)?.id??null}function pe(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}function cn(e){let n=Se(e.projectRoot,e.tsconfig),r=new Re(e.dbPath,{readonly:!0});try{let t=be({db:r,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:P(r,e.projectRoot)});return he({vueFiles:e.vueFiles??[],tasks:e.tasks,...t})}finally{r.close()}}function be(e){let n=M();return{projectRoot:e.projectRoot,context:E(e.projectRoot,e.configPath),symbolLookup:A(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function he(e){let n=[],r=S(),t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=ye(e,o);n.push(...i.occurrences),F(r,i)}return{occurrences:n,...r}}function ye(e,n){let r=e.sourceReader.get(n.fileName);if(!r)return _(e.projectRoot,n,"missing-source-file");let t=e.context.language.scripts.get(n.fileName),o=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!o)return _(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,t),s=g(e.projectRoot,n.fileName),a=[...w(r.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Ce(a),processedStarts:new Set};return xe({...e,fileName:n.fileName,sourceInfo:r,sourceFile:s,map:i,tokenContext:u})}function xe(e){let n=[],r=S();for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start)||ve(e.sourceInfo.text,t.start))continue;let o=D(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!N(e.projectRoot,l.fileName));if(!s){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"no-definition");continue}let a=g(e.projectRoot,s.fileName),u=ke(e.sourceFile,t.text,a);if(u){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,u);continue}let c=O(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"unindexed-definition");continue}j(n,e.sourceReader,e.sourceInfo,e.sourceFile,t,a,c),e.tokenContext.processedStarts.add(t.start),Ve(n,e,t,o,a,c)}return{occurrences:n,...r}}function ve(e,n){let r=e.lastIndexOf(`
|
|
15
|
+
`,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function ke(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function _(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function x(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ve(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of Ie(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let a=n.tokenContext.tokenByStart.get(s);a&&(j(e,n.sourceReader,n.sourceInfo,n.sourceFile,a,o,i),n.tokenContext.processedStarts.add(s))}}function j(e,n,r,t,o,i,s){let a=n.positionAt(r,o.start);e.push({sourceFile:t,sourceLine:a.line,sourceStartChar:a.character,sourceEndChar:a.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Ce(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Ie(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Fe(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Fe(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=y(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}export{De as a,je as b,$e as c,cn as d};
|
|
16
|
+
//# sourceMappingURL=chunk-FFJQZG6J.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{t as u}from"./chunk-Q7GBK5T7.js";function x(e,i){let l=new Map;return e.forEach((t,f)=>{let o=new Set;for(let r of i(t)){if(o.has(r))continue;o.add(r);let n=l.get(r);n?n.push(f):l.set(r,[f])}}),{candidatesFor:(t,f)=>{let o=new Set;for(let r of i(t)){let n=l.get(r);if(n)for(let a of n)a!==f&&o.add(a)}return[...o].sort((r,n)=>r-n)}}}function R(e){let i=c(e.profile?.name),l=()=>{let t=[];i=c(e.profile?.name,e);let f=(r,n)=>{let a=e.profiles[r],s=e.profiles[n];i.candidatePairs+=1,i.comparedPairs+=1;let d=e.compare(a,s);d&&t.push(d)};if(e.filePattern){let r=e.profiles.findIndex(n=>n.file.includes(e.filePattern));if(r>=0){let n=e.profiles[r];for(let a of m(e,r)){let s=e.profiles[a];e.focusFiles&&!e.focusFiles.has(n.file)&&!e.focusFiles.has(s.file)||f(r,a)}}}else if(e.focusFiles?.size!==0){let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let n=0;n<e.profiles.length;n+=1){let a=e.profiles[n],s=e.focusFiles?.has(a.file)??!1;for(let d of p(e,n))e.focusFiles&&!s&&!e.focusFiles.has(e.profiles[d].file)||f(n,d);if(t.length>r){i.overrunApplied=!0;break}}}t.sort(e.sort??((r,n)=>n.similarity-r.similarity)),i.matchedResults=t.length;let o=t.slice(0,e.limit);return i.emittedResults=o.length,e.onProfile?.({...i}),o};return e.profile?u(`pairwise-profile:${e.profile.name}`,l,()=>({...b(e.profile?.metadata),...i})):l()}function m(e,i){if(e.candidateIndex)return P(e,i,-1);let l=[];for(let t=0;t<e.profiles.length;t+=1)t!==i&&l.push(t);return l}function p(e,i){if(e.candidateIndex)return P(e,i,i);let l=[];for(let t=i+1;t<e.profiles.length;t+=1)l.push(t);return l}function P(e,i,l){let t=e.profiles[i],f=new Set;for(let o of e.candidateIndex?.candidatesFor(t,i,e.profiles)??[])o<=l||o!==i&&(o<0||o>=e.profiles.length||f.add(o));return[...f].sort((o,r)=>o-r)}function c(e,i){return{pipeline:e,profileCount:i?.profiles.length??0,focusedProfileCount:i?.focusFiles?i.profiles.filter(l=>i.focusFiles.has(l.file)).length:0,candidatePairs:0,comparedPairs:0,matchedResults:0,emittedResults:0,candidateIndexApplied:i?.candidateIndex!==void 0,focusApplied:i?.focusFiles!==void 0,filePatternApplied:i?.filePattern!==void 0,overrunApplied:!1}}function b(e){return typeof e=="function"?e():e??{}}export{x as a,R as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FGNCOQUX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as R}from"./chunk-T6QD2ZQB.js";import{b as T,d as b,g as z,h as _,i as O}from"./chunk-TQZV7KV4.js";import{a as A,c as N}from"./chunk-C7IJMOFP.js";import{a as G}from"./chunk-YXPUP5G2.js";import{b as k}from"./chunk-DKM723YF.js";import{d as H}from"./chunk-K3XFWJI2.js";import{d as B}from"./chunk-IW5XQG5G.js";import{e as w}from"./chunk-HGFDYOVB.js";import{m as E,o as C}from"./chunk-AK3PYTIK.js";function P(e){let t=v(e.projectFiles),n=new Set(t),c=new Map(e.snapshot.files.map(r=>[r.path,r])),s=e.snapshot.files.filter(r=>{let o=E(r.path,["typescript"]);return o==="config"||o==="ambient"}).map(r=>r.path),i=v([...t,...s]),a=i.find(r=>!c.has(r)),u=new Set(e.snapshot.files.map(r=>r.path)).size!==e.snapshot.files.length,m=!a&&i.some(r=>J(c.get(r))),f=k(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:v(e.snapshot.typescriptProjects),membership:t})),y,l;return{identityFor(r,o){if(!n.has(r))return g("target-outside-project");if(u)return g("duplicate-input-path");if(a)return g("missing-input-fingerprint");if(m)return g("unreadable-input");let d=[],p,S;if(e.graph===null)d.push("dependency-graph-unavailable"),S="whole-project",p=i;else{let h=r===y&&l?l:Y(r,e.graph);if(y=r,l=h,h.find(j=>!c.has(j)))return g("missing-input-fingerprint");if(p=v([...h,...s]),p.some(j=>J(c.get(j))))return g("unreadable-input");S="dependency-closure"}let W=p.map(h=>q(c.get(h)));return{version:1,key:k(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:o,projectIdentity:f,inputs:W})),mode:S,inputFiles:p,reasons:d}}}}function Y(e,t){let n=new Set,c=[e];for(let s=0;s<c.length;s+=1){let i=c[s];if(!(i===void 0||n.has(i))){n.add(i);for(let a of[...t.get(i)??[]].sort())n.has(a)||c.push(a)}}return[...n].sort()}function q(e){return e.semanticHash===void 0?{path:e.path,size:e.size,hash:e.hash}:{path:e.path,semanticHash:e.semanticHash}}function J(e){return e.size<0||e.hash==="unreadable"}function g(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function v(e){return[...new Set(e)].sort()}var L=B("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function D(e,t,n){let c=L.get(e,()=>$(e));if(!c)return null;let s=`${n}\0${t}`,i=c.identities.get(s);if(i)return i;let a=c.builder.identityFor(t,n);return c.identities.set(s,a),a}function F(e){return G(e,{includeIgnored:!1}).filter(T).sort()}function $(e){try{if(!e.generation.metadataRaw)return null;let t=H(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=C(t.metadata.fingerprint);return n?{builder:P({projectFiles:F(e),snapshot:n,graph:R(e),engineIdentity:b()}),identities:new Map}:null}catch{return null}}var M="typescript-reference-fragment-v2",U=128,x=A({kind:"typescript-reference-fragments",invalidation:N("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:X});function Re(e,t,n,c=e,s,i=new Set(n.keys())){let a=F(e),u=P({projectFiles:a,snapshot:t,graph:s??R(e),engineIdentity:b()}),m=[],f=0;for(let[l,r]of n){let o=u.identityFor(l,M).key;if(!o){f+=1;continue}m.push({relativePath:l,contentHash:o,value:[...r]})}let y=a.filter(l=>!i.has(l)&&!n.has(l)).length;return x.writeBatch(c,m),{affectedFiles:m.length,carriedFiles:y,skippedAffectedFiles:f}}function Te(e,t,n,c){let s=t.filter(a=>T(a.relativePath));if(s.length===0)return I("no TypeScript definitions");let i=I("shadow did not run");return w("typescript.reference-fragments.shadow",()=>{try{let a=c(s[0].relativePath);if(!a.availability().available||!a.referenceFragmentsForFiles)return i=I("TypeScript reference fragment provider is unavailable"),i;let u=F(e),m=new Set(u),f=new Map;for(let o of V(u)){let d=a.referenceFragmentsForFiles(o);if(o.some(p=>!d.has(p)))return i=I("TypeScript reference fragment provider returned an incomplete batch"),i;for(let p of o)f.set(p,d.get(p)??[])}let y=z(s,f),l=O(s,K(n,m),y);if(!l.passed)return i={state:"failing",files:u.length,keyedFiles:0,writtenFiles:0,...l},i;let r=[];for(let o of u){let d=D(e,o,M);d?.key&&r.push({relativePath:o,contentHash:d.key,value:f.get(o)??[]})}return x.writeBatch(e,r),i={state:"passing",files:u.length,keyedFiles:r.length,writtenFiles:r.length,...l},i}catch(a){return i=I(a instanceof Error?a.message:String(a)),i}},()=>({...i}))}function K(e,t){return new Map([...e].map(([n,c])=>[n,c.filter(s=>t.has(s.file))]))}function be(e,t,n){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let c="fallback",s=0,i=0,a=0,u=0;return w("typescript.reference-fragments.materialize",()=>{try{let m=F(e);s=m.length;let f=_(t),y=[];for(let r of m){let o=D(e,r,M);if(!o?.key)return null;let d=x.read(e,r,o.key);d===null?(a+=1,y.push({file:r,contentHash:o.key})):(i+=1,f.add(d))}if(a===0)return c="hit",{references:f.finish(),files:s,cacheHits:i,cacheMisses:a,computedFiles:u};let l=n(t[0].relativePath);if(!l.availability().available||!l.referenceFragmentsForFiles)return null;for(let r of V(y)){let o=r.map(({file:p})=>p),d=l.referenceFragmentsForFiles(o);if(o.some(p=>!d.has(p)))return null;x.writeBatch(e,r.map(({file:p,contentHash:S})=>({relativePath:p,contentHash:S,value:d.get(p)??[]})));for(let p of o)f.add(d.get(p)??[]);u+=r.length}return c="computed",{references:f.finish(),files:s,cacheHits:i,cacheMisses:a,computedFiles:u}}catch{return null}},()=>({state:c,files:s,cacheHits:i,cacheMisses:a,computedFiles:u}))}function V(e){let t=[];for(let n=0;n<e.length;n+=U)t.push(e.slice(n,n+U));return t}function I(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function X(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Z)?null:t}catch{return null}}function Z(e){if(!e||typeof e!="object")return!1;let t=e,n=t.location;return typeof t.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}export{D as a,Re as b,Te as c,be as d};
|
|
2
|
+
//# sourceMappingURL=chunk-FKGQOTKD.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as R}from"./chunk-IXESDH3J.js";import{p as h}from"./chunk-2XCGSDIT.js";import{a as g}from"./chunk-EELPBR7E.js";import{h as p}from"./chunk-C7IJMOFP.js";import{a as m}from"./chunk-YXPUP5G2.js";import{g as d}from"./chunk-DRENNWRG.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
|
+
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
+
//# sourceMappingURL=chunk-GDRJB3SB.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{isAbsolute as nt,relative as Sn}from"path";var g=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function Se(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Gi(e){return e.replace(/\\/g,"/")}function Wi(e,t){return Se(e)===Se(t)}function j(e,t){let n=Sn(e,t);return n===""||!n.startsWith("..")&&!nt(n)}function w(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(nt(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=Se(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function te(e,t,n=[]){let r=xe(e);if(ut.has(r)||n.some(o=>ee(r,o))||t.some(o=>pt(r,o)))return"config";if(t.some(lt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=dt(r);return t.some(o=>(ft[o]??[]).includes(i))?"source":"other"}function ct(e,t,n){let r=xe(e);if(ut.has(r)||n?.some(o=>ee(r,o))||pt(r,t)||lt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=dt(r);return(ft[t]??[]).includes(i)}function Hi(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!it(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!it(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(be)?null:t}function rt(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function $i(e,t){return!e||!t?e===t:JSON.stringify(rt(e))===JSON.stringify(rt(t))}function Ui(e,t){let n=new Map((e?.files??[]).map(a=>[a.path,a])),r=new Map(t.files.map(a=>[a.path,a])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let a of[...i].sort()){let c=n.get(a),u=r.get(a),d=te(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:d,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:d,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:d,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(ot(e?.files??[])||ot(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(bn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!xn(e,t):!0,uncertainty:[...s].sort()}}function it(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ot(e){return new Set(e.map(t=>t.path)).size!==e.length}function be(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function bn(e){return e.hash==="unreadable"||e.size<0}function xn(e,t){return st(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&st(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function st(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((i,o)=>i===r[o])}var ut=new Set([".scipquery.json"]),Pn={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},jn={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},at=new Map;function pt(e,t){return Pn[t].some(n=>ee(e,n))||jn[t].some(n=>ee(e,n))}function ee(e,t){let n=xe(t).replace(/^\.\//,"");if(!n)return!1;let r=e.split("/").at(-1)??e,i=n.includes("/")?e:r;if(!n.includes("*")&&!n.includes("?"))return i===n;let o=at.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),at.set(n,o)}return o.test(i)}function xe(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function dt(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function lt(e){return e==="typescript"||e==="javascript"}var ft={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Ji(e){return typeof e=="string"&&e.length>0}function Vi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ki(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Cn=/^[a-f0-9]{64}$/u;function Yi(e){return typeof e=="string"&&Cn.test(e)}function Xi(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Qi(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var ht=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var Pe=2,v=3;var je=new Set(ht);function oo(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${vn(s)}`}}if(!R(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==Pe&&n!==v)return{kind:"unsupported",version:n,direction:n<Pe?"older":"future"};let r=kn(t,n);if(r)return{kind:"malformed",reason:r};let i=t,o={metadata:i,capabilities:Fn(i)};return n===Pe?{kind:"legacy",...o,metadata:i}:{kind:"supported",...o,metadata:i}}function so(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function ao(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===v?t.sqliteLayoutVersion:void 0})}function Fn(e){let t=e.fingerprint!==void 0,n=R(e.fingerprint),r=e.indexedLanguages!==void 0,i=e.status==="complete",o=e.version===v?e:null;return{usableForQuery:r,usableForEvidenceCache:t,publishableGeneration:i&&n&&r,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!o?.languageFingerprints,typescriptProjectShardReuse:!!o?.typescriptProjectShards}}function kn(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!gt(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!wn(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!Rn(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===v&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===v&&e.languageFingerprints!==void 0&&!En(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===v&&e.typescriptProjectShards!==void 0&&!In(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function co(e){return e.version===v&&e.sqliteLayoutVersion===1}function wn(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&je.has(t))?!1:new Set(e).size===e.length}function Rn(e){return Array.isArray(e)&&e.every(t=>R(t)&&typeof t.language=="string"&&je.has(t.language)&&typeof t.reason=="string")}function En(e){return R(e)&&Object.entries(e).every(([t,n])=>je.has(t)&&R(n))}function In(e){return R(e)&&Object.values(e).every(t=>R(t)&&Array.isArray(t.files)&&t.files.every(be))}function vn(e){return e instanceof Error?e.message:String(e)}import{closeSync as Ce,fstatSync as ne,openSync as Fe,readFileSync as Tn,readSync as mt}from"fs";import{createHash as On}from"crypto";var yt=8*1024*1024,St=64*1024*1024,An=512*1024*1024,Ln=256*1024*1024,E=class extends Error{constructor(n,r,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${n} ${JSON.stringify(r)} ${a}`);this.inputKind=n;this.inputPath=r;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function re(e,t){T(t.maxBytes);let n=String(e),r=Fe(e,"r");try{let i=ne(r);xt(i,t,n);let o=Tn(r),s=ne(r);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new E(t.inputKind,n,"changed-during-read",s.size,t.maxBytes);return o}finally{Ce(r)}}function ke(e,t,n="utf8"){return re(e,t).toString(n)}function z(e,t){return ke(e,{maxBytes:yt,inputKind:t})}function Dn(e,t){return ke(e,{maxBytes:St,inputKind:t})}function we(e,t){T(t.maxBytes);let n=[],r=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=mt(e,r,0,r.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new E(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);n.push(Buffer.from(r.subarray(0,o)))}return Buffer.concat(n,i)}function _n(e,t,n="utf8"){return we(e,t).toString(n)}function bt(e,t){let n=Fe(e,"r");try{return we(n,t)}finally{Ce(n)}}function Bn(e,t,n="utf8"){return bt(e,t).toString(n)}function ie(e,t,n){T(t.maxBytes);let r=String(e),i=Fe(e,"r");try{let o=ne(i);xt(o,t,r);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=mt(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;n(s.subarray(0,u)),a+=u}let c=ne(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new E(t.inputKind,r,"changed-during-read",c.size,t.maxBytes);return a}finally{Ce(i)}}function Mn(e,t){let n=On("sha256");return ie(e,t,r=>n.update(r)),n.digest("hex")}function xt(e,t,n){if(!e.isFile())throw new E(t.inputKind,n,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new E(t.inputKind,n,"too-large",Number(e.size),t.maxBytes)}function T(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{spawnSync as Gn}from"child_process";import{createHash as Wn}from"crypto";import{existsSync as zn,lstatSync as Hn,realpathSync as $n}from"fs";import{dirname as Un,isAbsolute as qn,join as Jn,relative as Co,resolve as ae,sep as Fo}from"path";var Pt=Symbol.for("scip-query.project-file-listing-context.v1"),jt=globalThis,Re=jt[Pt],O=Re&&typeof Re=="object"?Re:{};jt[Pt]=O;function Ct(e,t){let n=O.active?O.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function Ft(){return O.sequence??0}function kt(e,t,n){let r=O.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Nn(n(),(O.sequence??0)+1);if(O.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function*wt(e){let t=0;for(;t<e.taggedOutput.length;){let n=e.taggedOutput.indexOf("\0",t);if(n<0)return;yield e.taggedOutput.slice(t+2,n),t=n+1}}function Nn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var H={run(e,t){let n=Et(e,t);return n.kind==="success"?n.output:void 0},runResult:Et},Vn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],It=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],oe=/^[0-9a-f]{40,64}$/;function wo(e,t,n=H){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let r=n.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(r.kind!=="success"||!oe.test(r.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return r.output}function Ro(e,t=H){return Kn(e,t)?.context}function Kn(e,t=H){let n=t.runResult(e,Vn);if(n.kind==="success"){let i=Yn(n.output);if(i){let o=Xn(i,t);if(o)return Rt(o)}}let r=Qn(e,t);return r?Rt(r):void 0}function Rt(e){return{context:e,projectFileInventorySequence:Ft()}}function vt(e){let t=e.split("\0").filter(Boolean),n=t.find(i=>i.startsWith("# branch.oid "))?.slice(13),r=n==="(initial)"?void 0:n;if(!(r!==void 0&&!oe.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function Yn(e){let t=e.split(`
|
|
2
|
+
`).map(c=>c.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!oe.test(o)||!oe.test(s))return;let a=I(n);return{root:a,gitDir:I(se(a,r)),commonDir:I(se(a,i)),headCommit:o,treeOid:s}}function Xn(e,t){let n=t.run(e.root,It);if(n===void 0)return;let r=vt(n);return r?.headCommit!==e.headCommit?void 0:{...Tt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Ie("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function Qn(e,t){let n=Zn(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=I(se(i,o)),a=Ee(t.run(i,["rev-parse","--verify","HEAD"])),c=Ee(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,It);if(u===void 0)return;let d=vt(u);if(!(!d||d.headCommit!==a))return{...r,commonDir:s,repositoryId:Ie("repository",s),headCommit:a,treeOid:c,clean:d.clean}}function Zn(e,t=H){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=I(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=I(se(i,o));return{kind:"worktree",identity:Tt(i,s)}}function Tt(e,t){return{projectRoot:e,gitDir:t,worktreeId:Ie("worktree",`${e}\0${t}`)}}function Eo(e,t,n=H){return Ee(n.run(e,t))}function se(e,t){return qn(t)?t:ae(e,t)}function I(e){try{return $n(e)}catch{return ae(e)}}function Ie(e,t){return Wn("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function Ee(e){return e?.trim()||void 0}function Et(e,t){let n=Gn("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(n.status===0)return{kind:"success",output:n.stdout.trimEnd()};let i=(typeof n.stderr=="string"?n.stderr.trim():"")||n.error?.message||`git exited with status ${n.status??"unknown"}`,o=n.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&zn(ae(e)))&&!er(e)?{kind:"not-repository"}:{kind:"error",message:i}}function er(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ae(e);for(;;){try{return Hn(Jn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Un(t);if(n===t)return!1;t=n}}import{createRequire as rr}from"module";import{existsSync as ir,lstatSync as Do,readdirSync as or,statSync as sr}from"fs";import f from"path";import{AsyncLocalStorage as tr}from"async_hooks";var nr=new tr;function A(e,t){let n=ce(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function L(e,t){let n=ce(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Ot(e,t){return ce(e)?.fingerprints.get(t)}function D(e){return ce(e)?.paths}function ce(e){let t=nr.getStore();if(t)return t.projectRoot===I(e)?t:void 0}var ar=rr(import.meta.url),At=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),cr=18003;function Te(e,t=[]){let n=f.resolve(e),r=t.flatMap(c=>dr(n,c));if(r.length>0)return Lt(n,_t(r));let i=pr(n),o=_t(i),s=lr(n,o)?[n,...o]:o,a=s.length>0?s:[n];return Lt(n,a)}function Bt(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Mt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var ur=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function Go(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function Nt(e){return ur.test(e)}function Gt(e,t,n=[]){let r;try{r=ar("@ts-morph/common/dist/typescript.js")}catch{return null}let i=f.resolve(e),o=t==="workspace"?Te(i,n):["."],s=new Set;for(let a of o){let c=a==="."?i:f.join(i,a),u=f.join(c,"tsconfig.json"),d=mr(r,i);if(!d.fileExists(u))return null;let p=r.readConfigFile(u,d.readFile);if(p.error)return null;let l=r.parseJsonConfigFileContent(p.config,d,c);if(l.errors.some(m=>m.code!==cr))return null;for(let m of l.fileNames){let h=f.resolve(m);j(i,h)&&s.add(f.relative(i,h).split(f.sep).join("/"))}}return s}function Lt(e,t){return[...new Set(t.map(n=>$(e,n)))].sort((n,r)=>n.localeCompare(r))}function pr(e){let t=D(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>At.has(s)))return[];let o=f.join(e,...i.split("/"));return Dt(e,o)?[f.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=or(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=f.join(i,s.name);if(s.isDirectory()){!At.has(s.name)&&!s.name.startsWith(".")&&r.push(a);continue}s.isFile()&&Dt(e,a)&&n.push(f.dirname(a))}}return n}function dr(e,t){let n=t.trim();if(!n)return[];let r=f.resolve(e,n);if(!j(e,r))return[];let i=D(e);if(i){let o=$(e,r);if(i.includes(o)&&ve(f.basename(r)))return[f.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[r]:[]}try{let o=sr(r);if(o.isDirectory())return[r];if(o.isFile()&&ve(f.basename(r)))return[f.dirname(r)]}catch{return[]}return[]}function Dt(e,t){if(!ve(f.basename(t)))return!1;let n=Wt(e,t);return n?f.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function ve(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function _t(e){let t=[...new Set(e.map(n=>f.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&Sr(n,r)))}function lr(e,t){if(t.length===0||t.some(r=>f.resolve(r)===e))return!1;let n=f.join(e,"tsconfig.json");return gr(e,n)&&fr(e,n)}function fr(e,t){let r=Wt(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!f.extname(i))):!1}function Wt(e,t){try{let n=JSON.parse(hr(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function gr(e,t){let n=$(e,t),r=L(e,n);return r?r==="present":ir(t)}function hr(e,t){let n=$(e,t);if(D(e)){let i=A(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return z(t,"TypeScript project config")}function mr(e,t){let n=D(t);if(!n)return e.sys;let r=f.resolve(t),i=new Set(n),o=yr(r,n),s=e,a=c=>{let u=f.resolve(c);return j(r,u)?$(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):A(r,u)?.content.toString("utf8")},readDirectory(c,u,d,p,l){let m=f.resolve(c);return j(r,m)?s.matchFiles(m,u,d,p,e.sys.useCaseSensitiveFileNames,r,l,h=>o.get(f.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(c,u,d,p,l)}}}function yr(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),r.get(a).add(u),a=f.join(a,u),i(a)}n.get(a).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function $(e,t){let n=f.relative(e,t);return n?n.split(f.sep).join("/"):"."}function Sr(e,t){let n=f.relative(e,t);return!!n&&!n.startsWith("..")&&!f.isAbsolute(n)}import{createHash as Le}from"crypto";import{execFileSync as zt}from"child_process";import{createRequire as br}from"module";var xr=br(import.meta.url),Pr=/\.(?:[cm]?[jt]sx?)$/iu,jr=/\.[jt]sx$/iu,Ht=/(?:^|\/)package\.json$/iu,U,Oe=new Map;function $t(e,t){if(!De(e))return;let n=Cr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=jr.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Le("sha256").update(`typescript-semantic-v1\0${i}\0`),a=!1,c=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){a&&(c=!0);continue}c&&s.update("line-break\0");let d=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(d)}\0`).update(d).update("\0"),a=!0,c=!1}return s.digest("hex")}catch{return}}function De(e){return Pr.test(e)}function _e(e,t){if(Ht.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return Le("sha256").update("typescript-package-json-v1\0").update(Ae(i)).digest("hex")}catch{return}}function Be(e){return Ht.test(e)}function Uo(e,t,n){if(!Be(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(Oe.has(r))return Oe.get(r);let i;try{let o=zt("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let a=zt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Le("sha256").update(a).digest("hex")===n){i=_e(t,a);break}}}catch{i=void 0}return Oe.set(r,i),i}function Cr(){if(U!==void 0)return U;try{U=xr("typescript")}catch{U=null}return U}function Ae(e){return Array.isArray(e)?`[${e.map(Ae).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${Ae(n)}`).join(",")}}`:JSON.stringify(e)}import{createHash as Yt,randomUUID as Or}from"crypto";import{chmodSync as Xt,existsSync as _,linkSync as Ar,lstatSync as fe,readdirSync as Ge,realpathSync as C,unlinkSync as Lr,writeSync as Dr}from"fs";import{homedir as _r}from"os";import{basename as Br,dirname as ge,isAbsolute as Vt,join as y,resolve as he}from"path";import{closeSync as Fr,existsSync as kr,fsyncSync as wr,mkdirSync as Rr,openSync as Er}from"fs";import{dirname as Ut}from"path";function ue(e,t,n,r){let i=0;for(;i<t.length;){let o=n.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${r} write did not make valid forward progress`);i+=o}}function Me(e,t){if(t!=="win32")return!1;let n=e.code;return n==="EACCES"||n==="EBADF"||n==="EINVAL"||n==="EISDIR"||n==="EPERM"}var q=Object.freeze({platform:process.platform,pathExists:e=>kr(e),makeDirectory:e=>Rr(e,{recursive:!0}),openFile:(e,t,n)=>Er(e,t,n),syncFile:e=>wr(e),closeFile:e=>Fr(e)});function qt(e,t=q){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Ut(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=de(i,pe(Ut(o),t));return i}function pe(e,t=q){let n;try{n=t.openFile(e,"r")}catch(r){if(Me(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(Me(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function de(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as Ir}from"module";var vr=Ir(import.meta.url),Jt=Tr().version;function Tr(){for(let e of["../package.json","../../package.json"])try{return vr(e)}catch{}return{version:"0.0.0"}}var Qt=1,V=".scip-query-cache-owner.json",Mr=16*1024,Zt=Object.freeze({...q,randomToken:()=>Or(),linkFile:(e,t)=>Ar(e,t),removeFile:e=>Lr(e),writeFile:(e,t,n,r)=>Dr(e,t,n,r)});function le(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function F(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Nr(e,t){let n=C(e);return Wr(n,We(n,t))}function We(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?he(r):t?.dbPath?Hr(n,t.dbPath):Gr(n)}function en(){let e=process.env.XDG_CACHE_HOME;return y(e||y(_r(),".cache"),"scip-query")}function Gr(e){let t=he(e);try{t=C(t)}catch{}let n=Yt("sha256").update(t).digest("hex").slice(0,12);return y(en(),"projects",n)}function us(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(en(),"repositories",e);return rn(t),C(t)}function ps(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function ds(e,t){let n=Nr(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function Wr(e,t,n=Zt){return zr(e,t,n).cacheDir}function zr(e,t,n=Zt){let r=C(e),i=_(t)?"synced":rn(t,n),o=C(t),s=y(o,V);if(_(s))return Ne(r,o),ze(s),J(o),{kind:"existing",cacheDir:o};Kt(o),Vr(o),Kt(o);let c=`${JSON.stringify({schemaVersion:Qt,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Jt},null,2)}
|
|
3
|
+
`;try{let u=Kr(s,c,n),d=de(i,u);return{kind:"published",cacheDir:o,achievedDurability:d==="synced"?"directory-durable":"file-flushed",directorySync:d}}catch(u){if(Xr(u))return Ne(r,o),{kind:"existing",cacheDir:o};throw u}}function Ne(e,t){let n=C(e),r=C(t);return Ur(r,n,r)}function ls(e,t){return _(y(t,V))?(Ne(e,t),tn(t),!0):!1}function Hr(e,t){let n;try{n=w(t)}catch(s){throw s instanceof g?le(t,s.reason):s}let r=he(e,...n.split("/"));if(r===e||!j(e,r))throw le(t,"outside-project");let i=$r(r),o=C(i);if(!j(e,o)&&o!==e)throw le(t,"symlink-escape");return r}function $r(e){let t=e;for(;!_(t);){let n=ge(t);if(n===t)throw le(e,"no-existing-ancestor");t=n}return t}function Ur(e,t,n){let r=y(e,V);if(!_(r)||fe(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=fe(r);if(!i.isFile()||i.size>Mr)throw F(e,"invalid ownership record file");let o=z(r,"cache ownership record"),s=qr(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw F(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw F(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Yt("sha256").update(o).digest("hex"),physicalCacheDir:e}}function qr(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==Qt||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Vt(n.canonicalProjectRoot)||!Vt(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw F(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Kt(e){let t=Ge(e).filter(n=>n!==V&&!Jr(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Jr(e){return e.startsWith(`${V}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function Vr(e){for(let t of Ge(e)){let n=y(e,t);try{let r=fe(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())J(n);else if(r.isFile())ze(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(nn(r))continue;throw r}}J(e)}function tn(e,t=!1){try{let n=fe(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){ze(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");J(e);for(let r of Ge(e))tn(y(e,r),!0)}catch(n){if(t&&nn(n))return;throw n}}function nn(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rn(e,t=q){let n=qt(e,t);return J(e),n}function Kr(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,ue(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=pe(ge(e),n);return n.removeFile(r),o=!1,de(s,pe(ge(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function J(e){process.platform!=="win32"&&Xt(e,448)}function ze(e){process.platform!=="win32"&&Xt(e,384)}function Yr(e){if(_(e))return C(e);let t=C(ge(e));return y(t,Br(e))}function fs(e){return Yr(he(e))}function Xr(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as fi}from"child_process";import{isUtf8 as dn}from"buffer";import{createHash as Ve}from"crypto";import{closeSync as gn,fstatSync as K,lstatSync as Ye,openSync as hn,readdirSync as gi,readFileSync as hi,readSync as ln,readlinkSync as mi,realpathSync as X}from"fs";import{isAbsolute as yi,join as Xe,relative as Si,resolve as bi,sep as xi}from"path";import{closeSync as on,existsSync as $e,openSync as Qr,realpathSync as Zr,renameSync as ei,unlinkSync as sn,writeSync as ti}from"fs";import{dirname as ni,join as ri}from"path";var ii="fingerprint-stat-cache.json",an=1,oi=8*1024*1024,He=new Map;function Ue(e,t,n,r){let i=cn(e),o=i.files.get(t);if(!(!o||!un(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function qe(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=cn(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},a=o.files.get(t);a&&di(a,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Je(e){let t=He.get(pn(e));if(!(!t?.dirty||!t.cachePath))try{let n=ni(t.cachePath);if(!$e(n))return;li(t.cachePath,ci(t)),t.dirty=!1}catch{}}function cn(e){let t=pn(e),n=He.get(t);if(n)return n;let r=si(t),i=ai(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return He.set(t,o),o}function si(e){try{let t=We(e);return $e(t)?ri(t,ii):null}catch{return null}}function ai(e){let t=new Map;if(!e||!$e(e))return t;try{let n=JSON.parse(re(e,{inputKind:"fingerprint stat cache",maxBytes:oi}).toString("utf8"));if(!ui(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function ci(e){return{version:an,files:Object.fromEntries(e.files)}}function ui(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==an||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(pi)}function pi(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function un(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function di(e,t){return un(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function li(e,t){let n=`${e}.${process.pid}.tmp`;try{sn(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
|
|
4
|
+
`,"utf8"),i=Qr(n,"wx",384);try{ue(i,r,{writeFile:(o,s,a,c)=>ti(o,s,a,c)},"fingerprint stat cache")}catch(o){throw on(i),sn(n),o}on(i),ei(n,e)}function pn(e){return Zr(e)}var Q=64*1024*1024,Pi=1024*1024,ji=1024,B=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Ci(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function Qe(e,t,n={}){let r=w(t),i=Ct(e,()=>X(e)),o=bi(i,...r.split("/"));if(!j(i,o)||o===i)throw new g(t,"outside-project");let s=X(o);if(!j(i,s)||s===i)throw new g(t,"outside-project");let a=Ye(s);if(!a.isFile())throw new g(t,"not-a-file");let c={projectRoot:i,relativePath:r,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=n.maxBytes??Q;if(T(u),c.size>u)throw new B(n.inputKind??"project file",c.relativePath,c.size,u);return c}function Fi(e,t,n={}){let r=w(t),i=L(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let c=A(e,r);if(!c)throw new g(r,"changed-during-read");let u=n.maxBytes??Q;if(T(u),c.size>u)throw new B(n.inputKind??"project file",r,c.size,u);return Buffer.from(c.content)}let o=Qe(e,t,n),s=n.maxBytes??Q,a=hn(o.absolutePath,"r");try{let c=K(a);if(Y(c,o,t),c.size>s)throw new B(n.inputKind??"project file",o.relativePath,c.size,s);let u=hi(a),d=K(a);if(Y(d,o,t),u.byteLength!==c.size)throw new g(t,"changed-during-read");return u}finally{gn(a)}}function Ls(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=ki(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function ki(e,t,n,r={}){if(n.length===0||n.some(c=>c.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=w(t),o=L(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let c=A(e,i);if(!c)throw new g(i,"changed-during-read");let u=r.maxBytes??Q;if(T(u),c.size>u)throw new B(r.inputKind??"project file",i,c.size,u);let d=!c.content.includes(0)&&dn(c.content),p=n.map(fn),l=d?Ri(c.content,n,p):[];return{byteLength:c.size,isUtf8Text:d,matchedLiteralIndexes:l,bytes:l.length>0?Buffer.from(c.content):null,...r.computeSha256?{sha256:c.sha256}:{}}}let s=Qe(e,t,r),a=hn(s.absolutePath,"r");try{let c=K(a);Y(c,s,t);let u=r.computeSha256?Ve("sha256"):null,d=r.scratchBuffer??Buffer.allocUnsafe(Pi);if(d.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let p=0,l=n.map(()=>!1),m=!1,h=!0,b=Buffer.alloc(0),Z=n.map(()=>Buffer.alloc(0)),M=n.map(fn);for(;p<c.size;){let x=ln(a,d,0,Math.min(d.byteLength,c.size-p),p);if(x<=0)throw new g(t,"changed-during-read");let P=d.subarray(0,x);if(u?.update(P),m||=P.includes(0),h){let S=b.byteLength>0?Buffer.concat([b,P]):P,W=wi(S);h=dn(S.subarray(0,W)),b=Buffer.from(S.subarray(W))}for(let S=0;S<n.length;S+=1){if(l[S])continue;let W=n[S],tt=Z[S];l[S]=Ei(P,W,tt,M[S]),Z[S]=Ii(P,W,tt)}p+=x}h&&=b.byteLength===0,Y(K(a),s,t);let N=!m&&h,G=N?l.flatMap((x,P)=>x?[P]:[]):[],k=null;if(G.length>0){k=Buffer.allocUnsafe(c.size);let x=0;for(;x<k.byteLength;){let P=ln(a,k,x,k.byteLength-x,x);if(P<=0)throw new g(t,"changed-during-read");x+=P}Y(K(a),s,t)}return{byteLength:c.size,isUtf8Text:N,matchedLiteralIndexes:G,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{gn(a)}}function Ds(e,t,n={}){return Fi(e,t,n).toString("utf8")}function Y(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new g(n,"changed-during-read")}function wi(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function Ri(e,t,n){return t.flatMap((r,i)=>Ke(e,r,n[i])?[i]:[])}function Ei(e,t,n,r){if(Ke(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return Ke(Buffer.concat([n,i]),t,r)}function Ke(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>ji)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function fn(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Ii(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function Ze(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function _s(e,t){try{return Qe(e,t),!0}catch(n){if(Ze(n))return!1;throw n}}function vi(e){let t=D(e);return t?t.filter(n=>n&&!ye(n)).sort():(_i(e)??Bi(e)).filter(n=>n&&!ye(n)).sort()}function Ti(e,t={}){let n=(t.includePaths??[]).map(w),r=[...new Set([...vi(e),...n])].filter(s=>!ye(s)).filter(s=>!t.language||ct(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,a)=>s.localeCompare(a)),i=X(e),o=r.flatMap(s=>mn(e,i,s));return Je(i),o}function mn(e,t,n){let r=Ot(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(L(e,n)==="present"){let o=A(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=Xe(e,n);try{let o=Ye(i);if(o.isSymbolicLink()){let b=Ue(t,n,"symlink",me(o));if(b)return[{path:n,size:b.size,hash:b.hash}];let Z=X(i),M=Si(t,Z);if(M===".."||M.startsWith(`..${xi}`)||yi(M))throw new Error("external symlink");let N=mi(i),G=Ve("sha256").update("symlink\0").update(N).digest("hex"),k=Buffer.byteLength(N);return qe(t,n,"symlink",me(o),{hash:G,size:k}),[{path:n,size:k,hash:G}]}let s=De(n)||Be(n),a=Ue(t,n,"file",me(o));if(a&&(!s||a.semanticHash!==void 0))return[{path:n,size:a.size,hash:a.hash,...a.semanticHash===void 0?{}:{semanticHash:a.semanticHash}}];let c=Ve("sha256"),u=s,d=[],p=ie(i,{inputKind:"project fingerprint input",maxBytes:Q},b=>{c.update(b),u&&d.push(Buffer.from(b))}),l=c.digest("hex"),m=u?Buffer.concat(d,p):void 0,h=m?$t(n,m)??_e(n,m):void 0;return qe(t,n,"file",me(o),{hash:l,size:p,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:p,hash:l,...h===void 0?{}:{semanticHash:h}}]}catch(o){return Ze(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function me(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function yn(e,t,n){let r=et(t,n),i=[...r.typescriptProjects.filter(c=>Li(e,c)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Gt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?Te(e,r.typescriptProjects):["."]:[],a=Bt(s);return{...r,files:Ti(e,{includePath:c=>{if(c===".scipquery.json")return!1;let u=te(c,t,i);return u==="other"||u==="config"&&Mt(c)&&!a.has(c)?!1:u!=="source"||!Ai(c)||!o?!0:o.has(c)},includePaths:i})}}function Bs(e,t){let n=new Set(t.files.map(o=>o.path)),r=yn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...et(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Ms(e,t,n,r,i,o){let s=p=>({mode:"full",fingerprint:yn(e,t,n),reason:p});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let a=et(t,n);if(!Oi(r,a))return s("project-input-configuration-changed");if(new Set(r.files.map(p=>p.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...a,files:[...r.files].sort((p,l)=>p.path.localeCompare(l.path))},changedPaths:[]};let c=[...a.typescriptProjects,...a.clojureConfigPath?[a.clojureConfigPath]:[]],u=new Map(r.files.map(p=>[p.path,p]));for(let p of i.entries){let l=u.get(p.path);if(te(p.path,t,c)!=="source")return s("non-source-project-input-changed");if(p.kind==="add"&&l)return s("added-path-already-in-prior-project-input-snapshot");if(p.kind==="delete"&&!l)return s("deleted-path-not-in-prior-project-input-snapshot");if(p.kind==="change"&&!l)return s("changed-path-not-in-prior-project-input-snapshot");if(l&&(l.hash==="unreadable"||l.size<0))return s("changed-path-was-unreadable")}let d=X(e);for(let p of i.entries){let l=mn(e,d,p.path);if(p.kind==="delete"){if(l.length!==0)return s("deleted-source-is-still-readable");u.delete(p.path);continue}if(l.length!==1||l[0].hash==="unreadable"||l[0].size<0)return s(p.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(p.path,l[0])}return Je(d),{mode:"delta",fingerprint:{...a,files:[...u.values()].sort((p,l)=>p.path.localeCompare(l.path))},changedPaths:i.entries.map(p=>p.path).sort()}}function Oi(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ai(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Li(e,t){let n;try{n=w(t)}catch{return!1}let r=L(e,n);if(r)return r==="present";try{return Ye(Xe(e,n)).isFile()}catch(i){if(Ze(i))return!1;throw i}}function et(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Ci(t.typescriptProjects),clojureConfigPath:Di(t.clojureConfigPath)}}function Di(e){return e?.trim()||void 0}function _i(e){try{let t=kt(e,52428800,()=>fi("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...wt(t)]}catch{return null}}function Bi(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?Xe(e,r):e,o;try{o=gi(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){ye(a)||n.push(a);continue}t.push(a)}}return t}function ye(e){let t=e.split("/");return e==="meta.json"||Nt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>Mi.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Mi=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{g as a,Se as b,Gi as c,Wi as d,j as e,w as f,te as g,ct as h,Hi as i,rt as j,$i as k,Ui as l,Pn as m,R as n,gt as o,Ji as p,Vi as q,Ki as r,Yi as s,Xi as t,Qi as u,ht as v,v as w,oo as x,so as y,ao as z,Fn as A,co as B,yt as C,St as D,An as E,Ln as F,E as G,re as H,ke as I,z as J,Dn as K,_n as L,Bn as M,ie as N,Mn as O,ue as P,Me as Q,q as R,qt as S,pe as T,de as U,kt as V,wt as W,H as X,wo as Y,Ro as Z,Eo as _,se as $,I as aa,Te as ba,Bt as ca,Mt as da,Go as ea,Nt as fa,Gt as ga,Uo as ha,Jt as ia,We as ja,en as ka,Gr as la,us as ma,ps as na,ds as oa,ls as pa,fs as qa,B as ra,Ci as sa,Qe as ta,Fi as ua,Ls as va,ki as wa,Ds as xa,Ze as ya,_s as za,vi as Aa,Ti as Ba,yn as Ca,Bs as Da,Ms as Ea,et as Fa};
|
|
5
|
+
//# sourceMappingURL=chunk-GH5YSGZL.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-ERCYGVAM.js";import{c as l}from"./chunk-PLYUVM4F.js";import{d as o,g as i}from"./chunk-TD7VKJ2Y.js";function _(e,t){let r=a(e,t);return r.length===0?[]:u([...c(e,r),...f(e,r)]).filter(s=>!e.isIgnored(s.relative_path)).map(d)}function R(e,t){let r=a(e,t);return r.length===0?[]:u(c(e,r)).filter(s=>!e.isIgnored(s.relative_path)).map(s=>({...d(s),basis:"external-reference"}))}function c(e,t){let r=t.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -26,4 +26,4 @@ import{b as a}from"./chunk-HUZNZ3H2.js";import{c as l}from"./chunk-JVZNWJBH.js";
|
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
28
|
ORDER BY d1.relative_path`,...t,...t,...t)}function f(e,t){let r=new l(e);return t.flatMap(s=>r.definitionsForFile(s).filter(n=>i(n.symbol)).map(n=>({relative_path:s,symbol:n.symbol})))}function u(e){let t=new Set;return e.filter(r=>{let s=`${r.relative_path}|${r.symbol}`;return t.has(s)?!1:(t.add(s),!0)})}function d(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:o(e.symbol)}}export{_ as a,R as b};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-GIQ6CSL4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-D2MVJSP4.js";function i(r,s,e={}){let a=t(r,s,{families:["dataflow"],...e.maxDepth!==void 0?{maxDepth:e.maxDepth}:{},...e.maxEdges!==void 0?{maxEdges:e.maxEdges}:{}});return{kind:"value-flow",targets:a.targets,edges:a.edges,coverage:{status:a.coverage.status,basis:"proved-bounded-static-value-flow",analysisBasis:"partial-system-definition-use",providers:["bounded-static-value-flow","typescript-local-dependence"],supportedRelations:["compiler-identified local definitions reaching local reads through a TypeScript control-flow graph","right-hand-side local reads supplying assignments and declarations","candidate closure captures and bounded same-owner field flow with explicit evidence strength","direct argument-to-parameter forwarding at compiler-resolved calls","bounded mechanically derived static arguments","callee return value to a consumed compiler-resolved call result"],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","dynamic calls not resolved by the semantic provider"],graph:a.coverage}}}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GPGRZJ3R.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-7KCZELVM.js";import{a as p,b as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-7KCZELVM.js";import{a as p,b as h}from"./chunk-6NC3YSPY.js";import{a as t}from"./chunk-IXESDH3J.js";import{a as m}from"./chunk-EELPBR7E.js";import{c,g as d}from"./chunk-DRENNWRG.js";function C(a,v,y={}){let l=m(a,v);if(!l)return null;let o=y.semantic!==!1,b=h(a,l,{semantic:o,semanticEvidence:t}).filter(e=>d(e.symbol)).slice(0,50),g=u(p(a,l,{limit:50,additive:!0,callableOnly:!0,semantic:o,semanticEvidence:t})),s=b.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source!=="caller-map-inversion"?"reference-candidate":e.callEvidence==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="caller-map-inversion"&&e.callEvidence!=="scip-chunk"?"exact":"candidate",evidenceSource:e.callEvidence??e.source})),r=g.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source}));return{symbol:l.symbol,shortName:c(l.symbol),callers:s.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callees:r.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callerEvidence:s,calleeEvidence:r,coverage:{scope:"indexed-static-call-graph",blindSpots:["unresolved dynamic dispatch and reflection","external or unindexed callees without a resolved symbol identity","SCIP chunk co-occurrence is retained only as candidate call evidence"]}}}export{C as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GQIDEID3.js.map
|