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
package/dist/chunk-AA7K3XLM.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{c as F,d as J,e as L,f as _e,g as Le,h as Fe,n as Pe,o as y,u as Ee,w as Ae,x as g,z as we}from"./chunk-DMQ7ZKJG.js";import{H as X,c as v}from"./chunk-MO226P4Q.js";import{basename as Ve}from"path";var Dt=F("indexed-document-paths",{clearGroups:["whole-project"]});function $(e,t={}){let n=Wt(t);return[...Dt.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE 1 = 1
|
|
4
|
-
${e.pathExclusionsFor("documents")}
|
|
5
|
-
${o}
|
|
6
|
-
${s}
|
|
7
|
-
ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function Wt(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function Qo(e,t,n){let r=Ie(t);if(!r)return[];let o=e.all(`SELECT relative_path
|
|
8
|
-
FROM documents
|
|
9
|
-
WHERE relative_path = ?
|
|
10
|
-
${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Re(c.relative_path,r)}));if(o.length>0)return o;let s=$(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Re(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];if(n.requirePathMatch)return[];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Re(e,t){let n=Ie(e),r=Ve(n),o=Ve(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Ie(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as je}from"path";var Ut={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function D(e){return Ut[je(e).toLowerCase()]??null}function le(e){return je(e).toLowerCase()===".vue"}import{createRequire as Mt}from"module";var d=Mt(import.meta.url),Z=null,Be=!1;function zt(){if(Be)return null;if(Z)return Z;try{return Z=d("tree-sitter"),Z}catch{return Be=!0,null}}var Oe=new Map,G=new Set;function qt(e){if(G.has(e))return null;let t=Oe.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return G.add(e),null}}catch{return G.add(e),null}return Oe.set(e,n),n}var $e=new Map;function Ht(e){let t=$e.get(e);if(t)return t;let n=qt(e);if(!n)return null;let r=zt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return G.add(e),null}return $e.set(e,o),o}function Xt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function P(e,t){let n=Ht(e);if(!n)return null;try{return Xt(n,t)}catch{return null}}import{createRequire as Jt}from"module";import{posix as ue}from"path";var Zt=L("vue-sfc-units"),Gt=Jt(import.meta.url),Kt;function Qt(){return Kt??=Gt("@vue/compiler-sfc")}function Ue(...e){return Qt().parse(...e)}function V(e,t){let n=Me(t),r=g(e,n);return Zt.get(e,n,r,()=>pe(e,n,r))}function Me(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Yt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function E(e){return!e||e.body.length===0?0:e.body.split(`
|
|
11
|
-
`).length}function pe(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Ue(n,{filename:t})}catch(i){return r.errors.push(We(i)),r}r.errors.push(...o.errors.map(We));let{descriptor:s}=o;return s.template&&(r.template=K(e,t,"template",s.template)),s.script&&r.scripts.push(De(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(De(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>K(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>K(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function De(e,t,n,r){let o=K(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Yt(o.lang)}}function K(e,t,n,r){let o=tn(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=en(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
|
|
12
|
-
`).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function en(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Me(ue.normalize(ue.join(ue.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function tn(e){return{...e}}function We(e){return e instanceof Error?e.message:String(e)}function fe(e,t,n){let o=pe(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
|
|
13
|
-
`.repeat(i.startLine)}${i.body}`).join(`
|
|
14
|
-
`),startLine:0,language:s}:null}var ze=_e("ast-trees",{clearGroups:["whole-project","source-file"]});function qe(e,t){if(le(t))return nn(e,t);let n=D(t);if(!n)return null;let r=g(e,t);return r?ze.get(e,t,r,()=>P(n,r)):null}function hs(e,t,n){if(le(t)){let s=fe(e,t,n);if(!s)return null;let i=P(s.language,`
|
|
15
|
-
`.repeat(s.startLine)+s.body);return i?{tree:i,language:s.language}:null}let r=D(t);if(!r)return null;let o=P(r,n);return o?{tree:o,language:r}:null}function nn(e,t){let n=g(e,t);return n?ze.get(e,t,n,()=>{let r=fe(e,t,n);if(!r)return null;let o=`
|
|
16
|
-
`.repeat(r.startLine)+r.body;return P(r.language,o)}):null}function W(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Qe=["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"],rn=new Set(Qe),on=[...Qe,"variable_declarator","public_field_definition"],sn=["function_item","function_signature_item"],an=["function_definition"],cn=[],He=new Set(["arrow_function","function_expression","generator_function"]);function vs(e){return e==="rust"?sn:e==="python"?an:e==="typescript"||e==="tsx"||e==="javascript"?on:cn}function Ye(e,t){let n=un(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Ge(n.functionNode),params:Xe(n.functionNode),paramsEndLine:Je(n.functionNode),isLiteralPassthrough:Ke(n.functionNode,t)};if(!ln(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Ge(e),params:Xe(e),paramsEndLine:Je(e),isLiteralPassthrough:Ke(e,t)}:null}function et(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Xe(e){let t=et(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(W(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function Je(e){let t=et(e);return t?t.endPosition.row:e.startPosition.row}function ln(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?rn.has(e):!1}function un(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Ze(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Ze(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function Ze(e){if(He.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>He.has(o.type));return r.length===1?r[0]:null}function Ge(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)W(r)||(n+=1);return n}function Ke(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!W(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!W(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}function Ns(e,t){return e.filter(n=>n.startLine<=t&&n.endLine>=t).sort((n,r)=>n.endLine-n.startLine-(r.endLine-r.startLine)||n.startLine-r.startLine)[0]??null}import{readdirSync as pn}from"fs";import{execFileSync as fn}from"child_process";import{extname as Q,join as mn}from"path";var dn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],Fs=[".vue"],tt=[".tsx",".jsx"],nt=[".vue"],gn=[...tt,...nt],hn=new Set(tt),Sn=new Set(nt),rt=new Set(dn.map(e=>e.toLowerCase())),yn=[...rt].sort().join(","),ot=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function U(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):rt,i=o?[...s].sort().join(","):yn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return xn.get(e,a,()=>{let c=new Set;if(n)for(let l of $(e,{includeIgnored:!1}))s.has(Q(l).toLowerCase())&&c.add(l);if(r)for(let l of vn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function Ps(e,t={}){let n=!1,r=!1;for(let o of U(e,{extensions:gn})){if(t.scope&&!o.includes(t.scope))continue;let s=Q(o).toLowerCase();if(n||=hn.has(s),r||=Sn.has(s),n&&r)break}return{react:n,vue:r}}var xn=F("source-files",{clearGroups:[]});function vn(e,t){return Nn(e,t)??bn(e,t)}function Nn(e,t){try{let n=fn("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"]}),r=new Set;for(let o of n.split(`
|
|
17
|
-
`)){let s=o.trim();s&&(Cn(s)||t.has(Q(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function Cn(e){return e.split("/").some(t=>ot.has(t))}function bn(e,t){let n=new Set,r=o=>{let s=o?mn(e,o):e,i;try{i=pn(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!ot.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(Q(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as Fn}from"path";function ee(e,t){let n=kn(e,t);if(!n)return null;let r=Y(n);if(!r)return null;let o=_n(n);return{calleeLeaf:r,calleeQualifier:o?Tn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function Tn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function kn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function _n(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Y(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Y(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Y(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Y(t):null}case"super":case"self":case"this":return null;default:return null}}var Ln=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function te(e){return e.length<=2||Ln.has(e)}var Pn=[".tsx",".jsx"],st=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),En=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),An=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),wn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Vn=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Rn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),In=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),jn=L("react-component-behavior-profiles"),it=Ee({kind:"react-component-behavior-profiles",invalidation:Ae("react-component-behavior-profiles"),serialize:Dn,deserialize:Wn});function ut(e,t={}){let n=U(e,{extensions:Pn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>de(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function de(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return jn.get(e,n,r,()=>Bn(e,n,r)).map($n)}function Bn(e,t,n){let r=Fe(e,t,n),o=it.read(e,t,r);if(o)return o;let s=On(e,t);return it.write(e,t,r,s),s}function On(e,t){let n=Mn(t);if(!n)return[];let r=qe(e,t);if(!r)return[];let o=we(e,t).length;return zn(r.rootNode,n).filter(i=>i.kind==="hook"||ge(i.bodyNode)).map(i=>{let a=Kn(i.bodyNode),c=nr(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function $n(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Dn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Wn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Un(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Un(e){if(!Pe(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:B,hookNames:ae,requestNames:ce,stateNames:m,effectNames:C,handlerNames:O}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!ne(o)||!ne(s)||!ne(i)||!ne(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(ae),requestNames:y(ce),stateNames:y(m),effectNames:y(C),handlerNames:y(O)};return Object.values(S).some($t=>$t===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function ne(e){return typeof e=="number"&&Number.isFinite(e)}function Mn(e){let t=Fn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:D(e)}function zn(e,t){let n=[],r=new Set,o=s=>{let i=qn(s);if(i&&(!Zn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function qn(e){if(e.type==="class_declaration"){let s=me(e);if(!s||!/^[A-Z]/.test(s))return null;let i=Hn(e);return!i||!Xn(e)&&!ge(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=me(e);return!s||!at(s)?null:{name:s,kind:ct(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=M(t);if(!r||!n||!at(r))return null;let o=Jn(n);return o?{name:r,kind:ct(r),node:e,bodyNode:o}:null}function Hn(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Xn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function at(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function ct(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Jn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=Gn(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Zn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function me(e){return M(e.childForFieldName("name")??e.namedChild(0))}function Gn(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function ge(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(ge)}function Kn(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?Qn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Yn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function Qn(e,t){let n=er(e),r=!1;if(n){let o=lt(n),s=o==="Fragment"||o==="React.Fragment";r=ar(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=tr(o);if(!s)continue;let i=lt(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else In.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(pt(o))}function Yn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(pt(e)),ft(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of cr(n))te(r)||t.tokens.add(`binding:${r}`)}function pt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function ft(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(ft)}function er(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function tr(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function nr(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=ee(o,t);s&&rr(s.calleeLeaf,n)}else if(o.type==="variable_declarator")sr(o,n);else if(o.type==="function_declaration"){let s=me(o);s&&mt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function rr(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!st.has(e)&&!wn.has(e)&&t.tokens.add(`hook:${e}`)),st.has(e)&&t.tokens.add(`react-hook:${e}`),En.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),An.has(e)&&t.tokens.add(`state-hook:${e}`),or(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function or(e){if(Vn.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function sr(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>M(a)),i=M(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=M(n);o&&mt(o,t)}function mt(e,t){let n=ir(e);!n||!Rn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function ir(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function ar(e){return/^[A-Z]/.test(e)||e.includes(".")}function lt(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function M(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function cr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}var lr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),ur=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),pr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),fr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),mr=new Set(["catch","for","function","if","return","switch","while"]);function oe(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=E(n),n.external&&(t.externalLineCount+=E(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Sr(n));let r=P(n.astLanguage,n.body);r?gr(n,r.rootNode,t):hr(n,t)}return dr(t),t.externalScriptPaths=gt(t.externalScriptPaths),t}function dr(e){e.composables=R(e,"composable"),e.stores=R(e,"store"),e.reactivity=R(e,"reactivity"),e.lifecycle=R(e,"lifecycle"),e.requests=R(e,"request"),e.macros=R(e,"macro")}function R(e,t){return gt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function gr(e,t,n){let r=new Set,o=new Set,s=i=>{let a=Ye(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=ee(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:dt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function hr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||mr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+re(e.body,n.index??0),categories:dt(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+re(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+re(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function Sr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+re(e.body,n.index??0);for(let i of yr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function yr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function dt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),lr.has(e)&&t.push("reactivity"),ur.has(e)&&t.push("lifecycle"),pr.has(e)&&t.push("request"),fr.has(e)&&t.push("macro"),t}function re(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function gt(e){return[...new Set(e)].sort()}import{createRequire as xr}from"module";function ht(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var vr=L("vue-template-facts"),Nr=xr(import.meta.url),Cr;function z(){return Cr??=Nr("@vue/compiler-dom")}var br=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Tr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),kr=new Set(["div","span","template"]),_r=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function se(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return vr.get(e,n,r,()=>Lr(n,V(e,n).template))}function Lr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=z().parse(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return yt(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function yt(e,t,n,r){for(let o of e)if(o.type===z().NodeTypes.ELEMENT)Fr(o,t,n,r),yt(o.children,t,n,r);else if(o.type===z().NodeTypes.INTERPOLATION){r("interpolation");let s=he(o.content);s&&xt(s,t,o.loc.start.line,n,r)}}function Fr(e,t,n,r){let o=Ir(e.tag),s={tag:e.tag,normalized:o,kind:Rr(e),startLine:I(t,e.loc.start.line),endLine:I(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),kr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)Pr(i,t,n,r)}function Pr(e,t,n,r){if(e.type===z().NodeTypes.ATTRIBUTE){let a=e.value?.content??null,c=St("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Ar(e),s=he(e.exp),i=St(Er(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&xt(s,t,e.loc.start.line,n,r)}function St(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:I(r,o),endLine:I(r,s)}}function Er(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Ar(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function xt(e,t,n,r,o){for(let s of wr(e)){let i={name:s,startLine:I(t,n),endLine:I(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function wr(e){let t=new Set,n=Vr(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];_r.has(s)||te(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Vr(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Rr(e){let t=e.tag;return e.tagType===z().ElementTypes.COMPONENT?"component":br.has(t)?"builtin":Tr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Ir(e){return ht(e,/[-_:]/)}function I(e,t){return e+Math.max(0,t-1)}import{createRequire as Hr}from"module";import{existsSync as w}from"fs";import{basename as Nt,dirname as h,extname as T,join as x,relative as A,resolve as f,sep as Xr}from"path";import{existsSync as ye,readdirSync as jr,statSync as Br}from"fs";import{join as j,relative as Or}from"path";function vt(e){let t=$r(e)??Mr(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of zr(e,o)){if(r.has(s))continue;r.add(s);let i=qr(e,s);i&&n.push(i)}return n}function $r(e){let t=j(e,"pnpm-workspace.yaml");if(!ye(t))return null;try{return Dr(X(t,"pnpm workspace manifest"))}catch{return null}}function Dr(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Wr(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Ur(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Wr(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Ur(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Mr(e){let t=j(e,"package.json");if(!ye(t))return null;try{let n=JSON.parse(X(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function zr(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=j(e,t);return Se(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=j(e,r||".");return Se(s)?jr(s).map(i=>j(s,i,o)).filter(Se):[]}function Se(e){try{return Br(e).isDirectory()}catch{return!1}}function qr(e,t){let n=j(t,"package.json");if(!ye(n))return null;try{let r=JSON.parse(X(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Or(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var Jr=J("indexed-paths",{clearGroups:[]}),Zr=J("indexed-path-digest",{clearGroups:[]}),Gr=F("tsconfig-alias-config",{clearGroups:["whole-project"]}),Kr=F("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Qr=Hr(import.meta.url),q;function Yr(){if(q!==void 0)return q;try{q=Qr("typescript")}catch{q=null}return q}var eo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],to=J("workspace-packages",{clearGroups:["whole-project"]}),H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Ct=[".py",".pyi"],bt=[".java",".scala",".kt",".kts"],Tt=[".rs"],kt=[".rb"],_t=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Lt=[".cs",".vb"],Ft=[".dart"],Pt=[".php"],ie=[".clj",".cljs",".cljc"],no=new Set(H),xe=new Set(Ct),Et=new Set(bt),ve=new Set(Tt),Ne=new Set(kt),At=new Set(_t),wt=new Set(Lt),Ce=new Set(Ft),Vt=new Set(Pt),Rt=new Set(ie),ro=[{extensions:H,lookup:no},{extensions:Ct,lookup:xe},{extensions:bt,lookup:Et},{extensions:Tt,lookup:ve},{extensions:kt,lookup:Ne},{extensions:_t,lookup:At},{extensions:Lt,lookup:wt},{extensions:Ft,lookup:Ce},{extensions:Pt,lookup:Vt},{extensions:ie,lookup:Rt}];function k(e,t){return t.has(T(e).toLowerCase())}function oo(e){return k(e,xe)}function so(e){return k(e,Et)}function io(e){return k(e,ve)}function ao(e){return k(e,Ne)}function co(e){return k(e,At)}function lo(e){return k(e,wt)}function hi(e){return T(e).toLowerCase()===".vb"}function uo(e){return k(e,Ce)}function po(e){return k(e,Vt)}function fo(e){return k(e,Rt)}function mo(e){let t=T(e).toLowerCase();for(let n of ro)if(n.lookup.has(t))return n.extensions;return H}function go(e){return so(e)||lo(e)||po(e)}function It(e,t,n){return oo(t)?Fo(e,t,n):io(t)?Po(e,t,n):ao(t)?Eo(e,t,n):co(t)?Ao(e,t,n):go(t)?wo(e,n.replace(/\\/g,"."),mo(t)):uo(t)?Vo(e,t,n):fo(t)?Ro(e,n):ho(e,t,n)}function ho(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return So(e,t,n)??xo(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of Te(o)){let a=v(A(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(A(e.config.projectRoot,o))}function So(e,t,n){let r=ko(e,t);if(!r)return null;let o=_(e);for(let s of yo(r,n)){let i=f(r.baseUrl,s);for(let a of Te(i)){let c=v(A(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function yo(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function xo(e,t){let n=No(vo(e),t);if(!n)return null;let r=_(e);for(let o of Co(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of Te(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function vo(e){return to.get(e,()=>vt(e.config.projectRoot))}function No(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function Co(e){let t=[],n=bo(e.pkg.exports,e.subpath);if(n){let r=To(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function bo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return jt(e[n])}function jt(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=jt(t[n]);if(r)return r}return null}function To(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function ko(e,t){let n=v(h(t));return Kr.get(e,n,()=>_o(e,n))}function _o(e,t){let n=Yr();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+Xr);){for(let i of eo){let a=x(o,i);if(!w(a))continue;let c=Gr.get(e,a,()=>Lo(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function Lo(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function Fo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of Io(o)){let i=v(A(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function Po(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),be(e,jo(s))}function Eo(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return be(e,Bo(o))}function Ao(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return be(e,o)}function wo(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>Nt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(T(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Vo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Oo(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function Ro(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of ie){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ie){let s=[...r].find(i=>Nt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function Io(e){let t=T(e);return xe.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function be(e,t){let n=_(e);for(let r of t){let o=v(A(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function jo(e){let t=T(e);return ve.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Bo(e){let t=T(e);return Ne.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Oo(e){let t=T(e);return Ce.has(t)?[e]:[`${e}.dart`,e]}function Te(e){let t=T(e),n=new Set;if(t){n.add(e);for(let r of H)n.add(e.slice(0,-t.length)+r)}else for(let r of H)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return Jr.get(e,()=>new Set($(e,{includeIgnored:!1}).map(v)))}function Si(e){return Zr.get(e,()=>Le([..._(e)].sort().join(`
|
|
18
|
-
`)))}var $o=new Set(["in","key","of"]),Do=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Wo=L("vue-component-behavior-profiles");function Bt(e,t={}){let n=U(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>ke(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function ke(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=Wo.get(e,n,r,()=>Uo(e,n,r));return zo(o)}function Uo(e,t,n){let r=V(e,t),o=se(e,t),s=oe(r),i=Xo(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,O)=>O.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,O)=>O.indexOf(m)===C).sort(),l=n?n.split(`
|
|
19
|
-
`).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ae,paths:ce}=Mo(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Ho(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ae,delegatedComposablePaths:ce}}function Mo(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=It(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
20
|
-
`).length:0)},0),paths:o}}function zo(e){let t=qo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function qo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Ho(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Do.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Xo(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Jo(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Ot(n.value))t.add(r);return[...t].sort()}function Jo(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Ot(t[1]??""):[]}function Ot(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];$o.has(r)||t.push(r)}return t}function wi(e){return{capability:(t,n)=>Zo(t,n),reactProfiles:(t={})=>ut(e,t),reactProfilesForFile:t=>de(e,t),vueProfiles:(t={})=>Bt(e,t),vueProfileForFile:t=>ke(e,t),vueTemplateFacts:t=>se(e,t),vueScriptFacts:t=>oe(V(e,t))}}function Zo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{$ as a,Qo as b,vt as c,zr as d,H as e,Ct as f,bt as g,Tt as h,kt as i,_t as j,Lt as k,Ft as l,Pt as m,ie as n,hi as o,mo as p,It as q,Fo as r,Po as s,Eo as t,Ao as u,wo as v,Vo as w,Ro as x,Si as y,D as z,le as A,fe as B,qe as C,hs as D,ee as E,Y as F,vs as G,Ye as H,Ns as I,ht as J,Fs as K,ot as L,U as M,Ps as N,wi as O};
|
|
21
|
-
//# sourceMappingURL=chunk-AA7K3XLM.js.map
|
package/dist/chunk-AUP6YI5M.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as ft,d as H,e as _,f as gt,g as ae,h as we,i as w,j as mt,l as yt,m as V,n as ve,o as se,r as O,s as U}from"./chunk-SF7X6QNW.js";import{a as G}from"./chunk-SDPA5DKN.js";import{d as rt}from"./chunk-DOPCR5BY.js";import{a as ct,c as pt,f as ie,g as oe,h as v}from"./chunk-G6OGPXJW.js";import{e as W}from"./chunk-HGFDYOVB.js";import{c as et,d as nt}from"./chunk-3VLJ2DCA.js";import{C as it,D as ot,F as at,G as st,H as Se,I as Ie,L as be,M as dt,N as lt,P as ut,a as b,b as q,c as I,f as h,g as x,h as L,j as Ze,k as re,ka as xe,l as tt,u as ne,v as k,w as z,y as he}from"./chunk-4DCKBY6T.js";import{execFileSync as gr}from"child_process";import{existsSync as mr,readdirSync as St}from"fs";import{extname as It,join as bt}from"path";var xt=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),yr=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"clojure",files:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],extensions:[".clj",".cljs",".cljc"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function Yn(e){let t=[],r=hr(e),n=xr(e);for(let i of yr){if(Sr(e,i.files)){t.push(i.language);continue}if(Ir(r,i.globs)){t.push(i.language);continue}vr(n,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&ht(t,"javascript"),t.includes("cpp")&&!n.has(".c")&&ht(t,"c"),t}function hr(e){try{return St(e)}catch{return[]}}function Sr(e,t){return t?.length?t.some(r=>mr(bt(e,r))):!1}function Ir(e,t){return t?.length?e.some(r=>t.some(n=>br(r,n))):!1}function br(e,t){if(t==="*")return!0;if(!t.includes("*"))return e===t;let[r,n]=t.split("*");return e.startsWith(r??"")&&e.endsWith(n??"")}function xr(e){let t=wr(e);if(t)return t;let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!i)continue;let o;try{o=St(i,{withFileTypes:!0})}catch{continue}for(let a of o){if(a.name.startsWith(".")&&!a.name.endsWith("proj")&&!a.name.endsWith("sln")&&a.isDirectory())continue;let s=bt(i,a.name);if(a.isDirectory()){xt.has(a.name)||n.push(s);continue}let c=It(a.name).toLowerCase();c&&r.add(c)}}return r}function wr(e){try{let t=dt(e,26214400,()=>gr("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:52428800,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"})),r=new Set;for(let n of lt(t)){if(n.split("/").some(o=>xt.has(o)))continue;let i=It(n).toLowerCase();i&&r.add(i)}return r}catch{return null}}function vr(e,t){return t?.length?t.some(r=>e.has(r)):!1}function ht(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}import{writeFileSync as Rr}from"fs";import{create as wt}from"@bufbuild/protobuf";import{deserializeSCIP as Pr,DocumentSchema as Tr,IndexSchema as Er,serializeSCIP as Dr,SymbolRole as Gr}from"@c4312/scip";function ti(e){let t;try{t=Pr(h(e,{inputKind:"SCIP sanitization input",maxBytes:I}))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let r=Re(t);return r.removedDefinitionOccurrences>0&&Rr(e,Dr(r.index)),{removedDefinitionOccurrences:r.removedDefinitionOccurrences,touchedDocuments:r.touchedDocuments}}function Re(e){let t=new Set;for(let o of e.documents){it(o.relativePath);for(let a of o.symbols)a.symbol&&t.add(a.symbol)}for(let o of e.externalSymbols)o.symbol&&t.add(o.symbol);let r=0,n=0,i=[];for(let o of e.documents){let a=o.occurrences.filter(s=>(s.symbolRoles&Gr.Definition)===0||t.has(s.symbol)?!0:(r+=1,!1));if(a.length===o.occurrences.length){i.push(o);continue}n+=1,i.push(wt(Tr,{language:o.language,relativePath:o.relativePath,occurrences:a,symbols:o.symbols,text:o.text,positionEncoding:o.positionEncoding}))}return{index:r===0?e:wt(Er,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:r,touchedDocuments:n}}import{writeFileSync as Pe}from"fs";import{create as Y}from"@bufbuild/protobuf";import{deserializeSCIP as Te,serializeSCIP as Ee,DocumentSchema as kr,IndexSchema as vt,MetadataSchema as Cr,SymbolInformationSchema as Ar}from"@c4312/scip";function Rt(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=Or(e),r=jr(e.flatMap(i=>i.documents??[])),n=Tt(e.flatMap(i=>i.externalSymbols??[]));return Y(vt,{metadata:t,documents:r,externalSymbols:n})}function di(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=e.map(i=>Te(h(i,{inputKind:"SCIP merge input",maxBytes:I}))),n=Rt(r);return Pe(t,Ee(n)),{documentCount:n.documents.length,externalSymbolCount:n.externalSymbols.length,inputCount:e.length}}function li(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=W("reindex.publish.scip-output.deserialize",()=>e.map(o=>Te(h(o,{inputKind:"SCIP merge input",maxBytes:I})))),n=W("reindex.publish.scip-output.merge",()=>Rt(r)),i=W("reindex.publish.scip-output.sanitize",()=>Re(n));return W("reindex.publish.scip-output.serialize",()=>Pe(t,Ee(i.index))),{documentCount:i.index.documents.length,externalSymbolCount:i.index.externalSymbols.length,inputCount:e.length,removedDefinitionOccurrences:i.removedDefinitionOccurrences,touchedDocuments:i.touchedDocuments}}function Lr(e,t,r){let n=e.metadata;if(!n)throw new Error("Cannot rebase a SCIP index without metadata");if(n.projectRoot!==t)throw new Error(`Cannot rebase SCIP project root: expected ${t}, got ${n.projectRoot}`);return Y(vt,{metadata:Y(Cr,{...n,projectRoot:r}),documents:e.documents,externalSymbols:e.externalSymbols})}function Pt(e,t,r){let n=Te(h(e,{inputKind:"SCIP normalization input",maxBytes:I})),i=Lr(n,t,r);Pe(e,Ee(i))}function Or(e){let t=e[0]?.metadata;if(!t)return;let r=t.projectRoot;for(let n of e.slice(1)){let i=n.metadata?.projectRoot;if(r&&i&&i!==r)throw new Error(`Cannot merge SCIP indexes with different project roots: ${r} vs ${i}`)}return t}function jr(e){let t=new Map;for(let r of e){let n=t.get(r.relativePath);if(!n){t.set(r.relativePath,r);continue}t.set(r.relativePath,Y(kr,{language:n.language||r.language,relativePath:n.relativePath||r.relativePath,occurrences:Mr([...n.occurrences,...r.occurrences]),symbols:Tt([...n.symbols,...r.symbols]),text:_r(n.text,r.text),positionEncoding:n.positionEncoding||r.positionEncoding}))}return[...t.values()]}function Mr(e){let t=new Set,r=[];for(let n of e){let i=JSON.stringify(n);t.has(i)||(t.add(i),r.push(n))}return r}function Tt(e){let t=new Map;for(let r of e){let n=t.get(r.symbol);if(!n){t.set(r.symbol,r);continue}t.set(r.symbol,Y(Ar,{symbol:n.symbol,documentation:Nr([...n.documentation,...r.documentation]),relationships:Fr([...n.relationships,...r.relationships]),kind:n.kind||r.kind,displayName:n.displayName||r.displayName,enclosingSymbol:n.enclosingSymbol||r.enclosingSymbol,signatureDocumentation:n.signatureDocumentation??r.signatureDocumentation}))}return[...t.values()]}function Fr(e){let t=new Set,r=[];for(let n of e){let i=[n.symbol,n.isReference?"1":"0",n.isImplementation?"1":"0",n.isTypeDefinition?"1":"0",n.isDefinition?"1":"0"].join("|");t.has(i)||(t.add(i),r.push(n))}return r}function _r(e,t){return e?t?e.length>=t.length?e:t:e:t}function Nr(e){return[...new Set(e)]}import Br from"better-sqlite3";var $r=25,qr=new Set(["typescript","javascript"]);function mi(e,t,r){let n=null;try{n=new Br(e,{readonly:!0,fileMustExist:!0});let i=new Set(n.prepare("SELECT relative_path FROM documents").pluck().all().map(he)),o=Wr(t,r),a=new Set([...o.values()].flatMap(u=>[...u])),s=[...a].filter(u=>!i.has(u)).sort();if(s.length===0)return{state:"complete",expectedDocumentCount:a.size,actualDocumentCount:i.size};let c=new Set(s),d=r.filter(u=>[...o.get(u)??[]].some(g=>c.has(g)));return{state:"incomplete",expectedDocumentCount:a.size,actualDocumentCount:i.size,missingDocumentCount:s.length,missingPaths:s.slice(0,$r),affectedLanguages:d}}catch(i){return{state:"unavailable",reason:i instanceof Error?i.message:String(i)}}finally{n?.close()}}function Wr(e,t){let r=new Map,n=t.filter(i=>qr.has(i));for(let i of n)r.set(i,new Set);for(let i of e.files){let o=he(i.path);for(let a of n)tt(o,[a])==="source"&&r.get(a).add(o)}return r}import{existsSync as Dt,readdirSync as Gt,rmSync as kt}from"fs";import{join as N}from"path";import{create as At,fromBinary as Lt,toBinary as Pi}from"@bufbuild/protobuf";import{deserializeSCIP as De,DocumentSchema as Ot,IndexSchema as jt,serializeSCIP as Mt}from"@c4312/scip";import{existsSync as zr,mkdirSync as Hr,renameSync as Vr,writeFileSync as Ur}from"fs";import{join as Yr}from"path";function Et(e){Hr(e.blobDir,{recursive:!0});let t=Yr(e.blobDir,`${e.blobHash}.scipdoc`);if(zr(t)){let n=h(t,{maxBytes:q,inputKind:e.inputKind});if(n.byteLength!==e.bytes.byteLength||G(n)!==e.blobHash)throw new Error(`existing ${e.inputKind} is corrupt: ${e.relativePath}`);return}let r=`${t}.${process.pid}.${Date.now()}.tmp`;Ur(r,e.bytes),Vr(r,t)}var Ge=1,J="typescript-scip-fragments";function Gi(e){if(e.length===0)throw new Error("affected TypeScript mini index requires documents");let t=new Set,r=[];for(let o of e){let a=ce(o.relativePath);if(t.has(a))throw new Error(`duplicate TypeScript fragment replacement: ${a}`);if(t.add(a),o.bytes===null)throw new Error(`affected TypeScript mini index cannot contain a deleted document: ${a}`);let s=Lt(Ot,o.bytes);if(s.relativePath!==a)throw new Error(`TypeScript fragment path mismatch: expected ${a}, got ${s.relativePath}`);r.push(s)}let n=Mt(At(jt,{documents:r,externalSymbols:[]})),i=De(n);if(i.documents.length!==r.length||i.externalSymbols.length!==0)throw new Error("affected TypeScript SCIP index failed structural verification");return n}function Jr(e){let t=N(e,J);return{rootDir:t,blobDir:N(t,"blobs"),generationDir:N(t,"generations")}}function Ft(e){let t=Kr(e);return Qr(t.baseIndex,t.completeDocuments,"assembled")}function Kr(e){let t=De(e.baseIndexBytes);tn(t.metadata,rn(e)),en(t.externalSymbols);let r=new Map;for(let s of e.fragments){let c=ce(s.relativePath);if(r.has(c))throw new Error(`duplicate TypeScript fragment replacement: ${c}`);r.set(c,s)}if(r.size===0)throw new Error("TypeScript index assembly requires at least one replacement");let n=new Set,i=[],o=[],a=[];for(let s of t.documents){let c=ce(s.relativePath);if(n.has(c))throw new Error(`duplicate TypeScript SCIP document path: ${c}`);n.add(c);let d=r.get(c);if(!d){i.push(s);continue}if(r.delete(c),d.bytes===null){a.push(c);continue}let u=Ct(c,d.bytes);i.push(u),o.push(u)}for(let s of[...r.keys()].sort()){let c=r.get(s);if(c.bytes===null)throw new Error(`TypeScript fragment deletion has no prior document: ${s}`);if(n.has(s))throw new Error(`duplicate TypeScript SCIP document path: ${s}`);n.add(s);let d=Ct(s,c.bytes);i.push(d),o.push(d)}return{baseIndex:t,completeDocuments:i,affectedDocuments:o,deletedAffectedPaths:a}}function Ct(e,t){let r=Lt(Ot,t);if(r.relativePath!==e)throw new Error(`TypeScript fragment path mismatch: expected ${e}, got ${r.relativePath}`);return r}function Qr(e,t,r){let n=Mt(At(jt,{metadata:e.metadata,documents:t,externalSymbols:[]})),i=De(n);if(i.documents.length!==t.length||i.externalSymbols.length!==0)throw new Error(`${r} TypeScript SCIP index failed structural verification`);return n}function ki(e,t){let r=Jr(e);if(!Dt(r.generationDir))return;let n=new Set(t.map(a=>Zr(a))),i=Gt(r.generationDir).filter(a=>a.endsWith(".json")),o=new Set;for(let a of i.filter(s=>n.has(s))){let s=Xr(x(N(r.generationDir,a),{maxBytes:b,inputKind:"TypeScript fragment manifest"}));for(let c of s.documents)o.add(`${c.blobHash}.scipdoc`)}for(let a of i)n.has(a)||kt(N(r.generationDir,a),{force:!0});if(Dt(r.blobDir))for(let a of Gt(r.blobDir))o.has(a)||kt(N(r.blobDir,a),{force:!0})}function Xr(e){let t=JSON.parse(e);if(t.version!==Ge||typeof t.producerIdentity!="string"||typeof t.projectIdentity!="string"||typeof t.generationIdentity!="string"||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!Array.isArray(t.documents))throw new Error("invalid TypeScript fragment generation manifest");let r=new Set;for(let n of t.documents){if(!n||typeof n.relativePath!="string"||typeof n.blobHash!="string"||!/^[a-f0-9]{64}$/.test(n.blobHash)||typeof n.byteLength!="number"||!Number.isInteger(n.byteLength)||n.byteLength<0||typeof n.documentIdentity!="string"||!n.documentIdentity)throw new Error("invalid TypeScript fragment record");if(ce(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript fragment record");r.add(n.relativePath)}return t}function Zr(e){if(!e)throw new Error("TypeScript fragment generation identity must be non-empty");return`${G(e)}.json`}function en(e){if(e.length>0)throw new Error("scip-typescript emitted external symbols; incremental document assembly is unsupported")}function tn(e,t){if(!e||typeof e!="object")throw new Error("TypeScript SCIP shard has no producer metadata");let r=e,n=r.toolInfo??r.tool_info;if(!n||typeof n!="object")throw new Error("TypeScript SCIP shard has no producer tool identity");let i=n;if(i.name!=="scip-typescript"||i.version!==t)throw new Error("TypeScript SCIP shard producer identity changed")}function rn(e){let t=e.packageVersion??e.runtime?.packageVersion;if(!t)throw new Error("scip-typescript package version is unavailable");return t}function ce(e){if(!e||e.startsWith("/")||e.startsWith("\\")||e.includes("\\"))throw new Error(`invalid TypeScript SCIP document path: ${e}`);let t=e.split("/");if(t.includes("")||t.includes(".")||t.includes(".."))throw new Error(`invalid TypeScript SCIP document path: ${e}`);return e}import{existsSync as de,readdirSync as ke,rmSync as _t}from"fs";import{join as R}from"path";var le=1;var K="typescript-scip-overlays";function Ni(e){let t=Bt(e.cacheDir,e.previousGenerationIdentity);if(!t&&!e.baseShardCurrent)throw new Error("deferred TypeScript SCIP base has no matching overlay generation");if(t&&(t.producerIdentity!==e.producerIdentity||t.projectIdentity!==e.projectIdentity))throw new Error("TypeScript overlay producer or project identity changed");let r=new Map((t?.overlays??[]).map(o=>[o.relativePath,o])),n=new Set;for(let o of e.fragments){let a=Le(o.relativePath);if(n.has(a))throw new Error(`duplicate TypeScript overlay: ${a}`);n.add(a),r.set(a,nn(e.cacheDir,o))}if(n.size===0)throw new Error("TypeScript overlay generation requires affected documents");let i={version:le,producerIdentity:e.producerIdentity,projectIdentity:e.projectIdentity,baseGenerationIdentity:t?.baseGenerationIdentity??e.previousGenerationIdentity,generationIdentity:e.nextGenerationIdentity,createdAt:(e.now??(()=>new Date))().toISOString(),overlays:[...r.values()].sort((o,a)=>o.relativePath.localeCompare(a.relativePath))};return on(e.cacheDir,i),i}function Bi(e){let t=Bt(e.cacheDir,e.generationIdentity);if(!t)throw new Error("TypeScript overlay generation is unavailable");let r=t.overlays.map(n=>{if(n.blobHash===null)return{relativePath:n.relativePath,bytes:null,occurrences:0,symbols:0,referenceFragments:[]};let i=h(R(Q(e.cacheDir),"blobs",`${n.blobHash}.scipdoc`),{maxBytes:q,inputKind:"TypeScript overlay blob"});if(i.byteLength!==n.byteLength||G(i)!==n.blobHash)throw new Error(`TypeScript overlay blob is corrupt: ${n.relativePath}`);return{relativePath:n.relativePath,bytes:i,occurrences:0,symbols:0,referenceFragments:[]}});return Ft({packageVersion:e.packageVersion,baseIndexBytes:e.baseIndexBytes,fragments:r})}function $i(e,t){let r=Q(e),n=R(r,"generations");if(!de(n))return;let i=new Set(t.map(Ae)),o=new Set;for(let s of ke(n).filter(c=>i.has(c))){let c=Ce(x(R(n,s),{maxBytes:b,inputKind:"TypeScript overlay manifest"}));for(let d of c.overlays)d.blobHash&&o.add(`${d.blobHash}.scipdoc`)}for(let s of ke(n))i.has(s)||_t(R(n,s),{force:!0});let a=R(r,"blobs");if(de(a))for(let s of ke(a))o.has(s)||_t(R(a,s),{force:!0})}function Bt(e,t){let r=R(Q(e),"generations",Ae(t));if(!de(r))return null;let n=Ce(x(r,{maxBytes:b,inputKind:"TypeScript overlay manifest"}));if(n.generationIdentity!==t)throw new Error("TypeScript overlay generation identity does not match its path");return n}function nn(e,t){let r=Le(t.relativePath);if(t.bytes===null)return{relativePath:r,blobHash:null,byteLength:0};let n=Buffer.from(t.bytes),i=G(n);return Et({blobDir:R(Q(e),"blobs"),blobHash:i,bytes:n,relativePath:r,inputKind:"TypeScript overlay blob"}),{relativePath:r,blobHash:i,byteLength:n.byteLength}}function on(e,t){let r=R(Q(e),"generations",Ae(t.generationIdentity));if(de(r)){let n=Ce(x(r,{maxBytes:b,inputKind:"TypeScript overlay manifest"}));if(Nt(n)!==Nt(t))throw new Error(`TypeScript overlay generation is immutable: ${t.generationIdentity}`);return}oe(r,t,{spacing:2,trailingNewline:!0})}function Ce(e){let t=JSON.parse(e);if(t.version!==le||typeof t.producerIdentity!="string"||!t.producerIdentity||typeof t.projectIdentity!="string"||!t.projectIdentity||typeof t.baseGenerationIdentity!="string"||!t.baseGenerationIdentity||typeof t.generationIdentity!="string"||!t.generationIdentity||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!Array.isArray(t.overlays))throw new Error("invalid TypeScript overlay manifest");let r=new Set;for(let n of t.overlays){if(!n||typeof n.relativePath!="string"||n.blobHash!==null&&(typeof n.blobHash!="string"||!/^[a-f0-9]{64}$/.test(n.blobHash))||!Number.isInteger(n.byteLength)||n.byteLength<0||n.blobHash===null&&n.byteLength!==0)throw new Error("invalid TypeScript overlay record");if(Le(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript overlay record");r.add(n.relativePath)}return t}function Q(e){return R(e,K)}function Ae(e){if(!e)throw new Error("TypeScript overlay generation identity must be non-empty");return`${G(e)}.json`}function Nt(e){return G(JSON.stringify({version:e.version,producerIdentity:e.producerIdentity,projectIdentity:e.projectIdentity,baseGenerationIdentity:e.baseGenerationIdentity,generationIdentity:e.generationIdentity,overlays:e.overlays}))}function Le(e){if(!e||e.startsWith("/")||e.includes("\\")||e.split("/").some(t=>!t||t==="."))throw new Error(`invalid TypeScript overlay path: ${e}`);if(e.split("/").includes(".."))throw new Error(`invalid TypeScript overlay path: ${e}`);return e}import{createHash as _e}from"crypto";import{closeSync as an,existsSync as f,mkdirSync as sn,openSync as cn,readSync as dn,readdirSync as Ne,renameSync as Fe,rmSync as X,statSync as B}from"fs";import{basename as zt,dirname as P,join as p,relative as $t}from"path";var ln=Object.freeze({maxGenerations:2,maxLogicalBytes:2*1024*1024*1024});function Ht(e){let t=w(e.outputDb),r=mn(e);e.onStage?.("after-recovery-retained");let n=e.preserveOutputScip?e.outputScip:e.tempOutputScip,i=qe({generationRoot:t,databasePath:e.tempOutputDb,indexPath:f(n)?n:void 0,metadataPath:f(e.tempMetaPath)?e.tempMetaPath:void 0}),o=(e.now??(()=>new Date))().toISOString(),a={version:_,currentGeneration:i.identity,artifactSet:"immutable-v1",...r?{previousGeneration:r}:{},...e.publication?{publication:e.publication}:{},publishedAt:o},s=v(p(t,"state.json"),a,{spacing:2,trailingNewline:!0});e.onStage?.("after-pointer-handoff"),e.preserveOutputScip||Me(e.tempOutputScip,e.outputScip),e.onStage?.("after-scip-handoff"),Me(e.tempOutputDb,e.outputDb),e.onStage?.("after-database-handoff"),Me(e.tempMetaPath,e.metaPath),e.onStage?.("after-metadata-handoff");let c=i.identity,d={...a,stableMirrors:$e(e.outputDb,e.outputScip)};v(p(t,"state.json"),d,{spacing:2,trailingNewline:!0});let u=Vt(e.outputDb,{now:e.now}),g=z(i.directorySync,s.directorySync);return{currentGeneration:c,...r?{previousGeneration:r}:{},retention:u,achievedDurability:g==="synced"?"directory-durable":"file-flushed",directorySync:g}}function un(e,t,r,n=()=>new Date){if(!f(e))return null;let i=V(e),o=p(w(e),"state.json");if(i?.artifactSet==="immutable-v1"&&ve(e,i.currentGeneration))return i;let a=w(e),s=!i&&f(o)?hn(r,e,t):void 0;if(s&&!se(a,s))return null;let c=qe({generationRoot:a,databasePath:e,indexPath:f(t)?t:void 0,metadataPath:f(r)?r:void 0,forcedIdentity:i?.currentGeneration??s}),d={version:_,currentGeneration:c.identity,artifactSet:"immutable-v1",stableMirrors:$e(e,t),...i?.previousGeneration?{previousGeneration:i.previousGeneration}:{},...i?.publication?{publication:i.publication}:{},publishedAt:i?.publishedAt??n().toISOString()};return v(p(a,"state.json"),d,{spacing:2,trailingNewline:!0}),d}function Zi(e,t,r=()=>new Date){if(!f(e)||!f(t))throw new Error("metadata-only generation refresh requires stable database and metadata files");let n=V(e),i=w(e),o=qe({generationRoot:i,databasePath:e,indexPath:f(p(P(e),"index.scip"))?p(P(e),"index.scip"):void 0,metadataPath:t}),a=n&&n.currentGeneration!==o.identity?Yt(e,n.currentGeneration):void 0,s={version:_,currentGeneration:o.identity,artifactSet:"immutable-v1",stableMirrors:$e(e,p(P(e),"index.scip")),...a?{previousGeneration:a}:{},...n?.publication?{publication:n.publication}:{},publishedAt:r().toISOString()};return v(p(w(e),"state.json"),s,{spacing:2,trailingNewline:!0}),Vt(e,{now:r}),s}function Vt(e,t={}){let r=pn(t.limits),i=(t.now??(()=>new Date))().toISOString(),o=H(mt(e),{waitMs:0});if(!o)return{state:"deferred",generationCount:0,logicalBytes:0,protectedGenerations:0,activeReaderLeases:0,staleReaderLeasesRemoved:0,malformedReaderLeases:0,removedGenerations:0,removedLogicalBytes:0,limits:r,at:i,reason:"another process owns local generation retention"};try{let a=V(e),s=fn(e),c=yt(e,s.map(S=>S.identity),{isProcessAlive:t.isProcessAlive??ct,readProcessIdentity:t.readProcessIdentity??et}),d=new Set(c.protectedGenerations);a?.currentGeneration&&d.add(a.currentGeneration),a?.previousGeneration?.generationIdentity&&d.add(a.previousGeneration.generationIdentity);let u=s.length,g=s.reduce((S,ye)=>S+ye.logicalBytes,0),m=0,E=0;for(let S of s){if(u<=r.maxGenerations&&g<=r.maxLogicalBytes)break;d.has(S.identity)||(t.onBeforeRemove?.(S.identity),X(S.path,{recursive:!0,force:!0}),u-=1,g-=S.logicalBytes,m+=1,E+=S.logicalBytes)}let y=u>r.maxGenerations||g>r.maxLogicalBytes,D={state:y?"protected":m>0?"collected":"within-bounds",generationCount:u,logicalBytes:g,protectedGenerations:d.size,activeReaderLeases:c.activeLeases,staleReaderLeasesRemoved:c.staleLeasesRemoved,malformedReaderLeases:c.malformedLeases,removedGenerations:m,removedLogicalBytes:E,limits:r,at:i,...y?{reason:c.malformedLeases>0?"malformed reader ownership evidence fails closed":"retention bounds cannot be met without deleting a protected generation"}:{}};return qt(e,D),D}catch(a){let s={state:"error",generationCount:0,logicalBytes:0,protectedGenerations:0,activeReaderLeases:0,staleReaderLeasesRemoved:0,malformedReaderLeases:0,removedGenerations:0,removedLogicalBytes:0,limits:r,at:i,reason:a instanceof Error?a.message:String(a)};try{qt(e,s)}catch{}return s}finally{o.release()}}function pn(e={}){let t={...ln,...e};if(!Number.isSafeInteger(t.maxGenerations)||t.maxGenerations<2)throw new Error("Local SQLite generation retention must keep at least current and previous generations.");if(!Number.isSafeInteger(t.maxLogicalBytes)||t.maxLogicalBytes<=0)throw new Error("Local SQLite generation byte retention must be a positive safe integer.");return t}function fn(e){let t=w(e);return f(t)?Ne(t,{withFileTypes:!0}).filter(r=>r.isDirectory()&&/^[a-f0-9]{64}$/.test(r.name)).map(r=>{let n=p(t,r.name),i=se(t,r.name),o=i?i.database.size+(i.index?.size??0)+(i.metadata?.size??0):Ut(n);return{identity:r.name,path:n,logicalBytes:o,modifiedAtMs:B(n).mtimeMs}}).sort((r,n)=>r.modifiedAtMs-n.modifiedAtMs||r.identity.localeCompare(n.identity)):[]}function Ut(e){let t=0;for(let r of Ne(e,{withFileTypes:!0})){let n=p(e,r.name);r.isDirectory()?t+=Ut(n):r.isFile()&&(t+=B(n).size)}return t}function qt(e,t){oe(p(w(e),"gc.json"),t,{spacing:2,trailingNewline:!0})}function Be(e,t=p(P(e),"meta.json")){let r=p(w(e),"state.json");if(!f(r))return{state:"legacy",statePath:r};let n=V(e);if(!n)return{state:"invalid",statePath:r,reason:"generation state is malformed"};try{let i=ve(e,n.currentGeneration),o=i!==null,a=i?gn(e,t,i,n):!1,s=n.previousGeneration?f(p(P(e),n.previousGeneration.databasePath)):!0;return!a||!o||!s?{state:"drifted",statePath:r,currentMatches:a,recoveryExists:s,generation:n,reason:o?a?"retained recovery database is missing":"stable database or metadata no longer matches the published generation":"published immutable generation is missing"}:{state:"current",statePath:r,currentMatches:a,recoveryExists:s,generation:n}}catch(i){return{state:"drifted",statePath:r,currentMatches:!1,recoveryExists:!1,generation:n,reason:i instanceof Error?i.message:String(i)}}}function gn(e,t,r,n){if(n.stableMirrors&&(n.stableMirrors.databaseFileIdentity!==U(e)||n.stableMirrors.indexFileIdentity!==void 0&&n.stableMirrors.indexFileIdentity!==U(p(P(e),"index.scip")))||!Wt(e,r.database))return!1;let i=p(P(e),"index.scip");if(r.index&&!Wt(i,r.index))return!1;if(!r.metadata)return!f(t);if(!f(t))return!1;let o=p(w(e),r.identity,r.metadata.file);return f(o)&&O(L(t,"reindex metadata"))===O(L(o,"immutable reindex metadata"))}function Wt(e,t){return f(e)&&B(e).isFile()&&B(e).size===t.size}function mn(e){let t=un(e.outputDb,e.outputScip,e.metaPath);return t?Yt(e.outputDb,t.currentGeneration):void 0}function $e(e,t){return{databaseFileIdentity:U(e),...f(t)?{indexFileIdentity:U(t)}:{}}}function Yt(e,t){let r=p(w(e),t),n=p(r,zt(e)),i=p(r,"meta.json");return{generationIdentity:t,databasePath:$t(P(e),n),...f(i)?{metadataPath:$t(P(e),i)}:{}}}function yn(e){if(f(e))for(let t of Ne(e,{withFileTypes:!0}))t.isDirectory()&&t.name.endsWith(".tmp")&&X(p(e,t.name),{recursive:!0,force:!0})}function hn(e,t,r=p(P(t),"index.scip")){let n=_e("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(ue(t)),f(r)&&n.update(`\0${ue(r)}`),f(e)&&n.update(`\0${O(L(e,"reindex metadata"))}`),n.digest("hex")}function qe(e){let t=Oe(e.databasePath),r=e.indexPath?Oe(e.indexPath):void 0,n=e.metadataPath?Oe(e.metadataPath):void 0,i=e.forcedIdentity??Sn(t,r,e.metadataPath),o=p(e.generationRoot,i),a=p(o,we);if(f(a)){let d=se(e.generationRoot,i);if(d&&Jt(o,d.database,t)&&bn(o,d.index,r)&&xn(o,d.metadata,e.metadataPath))return{identity:i,directorySync:k(e.generationRoot)};throw new Error(`SQLite generation ${i} already exists with different or corrupt artifacts.`)}let s=[ne(e.generationRoot)];yn(e.generationRoot);let c=`${o}.${process.pid}.${Date.now()}.tmp`;X(c,{recursive:!0,force:!0}),sn(c,{recursive:!0});try{s.push(je(e.databasePath,p(c,t.file))),r&&e.indexPath&&s.push(je(e.indexPath,p(c,r.file))),n&&e.metadataPath&&s.push(je(e.metadataPath,p(c,n.file)));let d=v(p(c,we),{version:gt,identity:i,database:t,...r?{index:r}:{},...n?{metadata:n}:{}},{spacing:2,trailingNewline:!0});d.directorySync!=="not-requested"&&s.push(d.directorySync),s.push(k(c)),Fe(c,o),s.push(k(e.generationRoot))}finally{X(c,{recursive:!0,force:!0})}return{identity:i,directorySync:z(...s)}}function Sn(e,t,r){let n=_e("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(e.sha256),t&&n.update(`\0${t.sha256}`),r&&n.update(`\0${O(L(r,"reindex metadata"))}`),n.digest("hex")}function Oe(e){return{file:zt(e),size:B(e).size,sha256:ue(e)}}function ue(e){let t=_e("sha256"),r=cn(e,"r"),n=Buffer.allocUnsafe(1024*1024);try{for(;;){let i=In(r,n);if(i===0)break;t.update(n.subarray(0,i))}}finally{an(r)}return t.digest("hex")}function In(e,t){let r=0;for(;r<t.length;){let n=dn(e,t,r,t.length-r,null);if(r+=n,n===0)break}return r}function je(e,t){return ie(e,t,{mode:292})}function Jt(e,t,r){let n=p(e,t.file);return t.file===r.file&&t.size===r.size&&t.sha256===r.sha256&&f(n)&&B(n).size===t.size&&ue(n)===t.sha256}function bn(e,t,r){return!t||!r?t===r:Jt(e,t,r)}function xn(e,t,r){if(!t||!r)return t===void 0&&r===void 0;let n=p(e,t.file);return f(n)&&O(L(n,"stored reindex metadata"))===O(L(r,"candidate reindex metadata"))}function Me(e,t){X(`${t}.tmp-replace`,{force:!0}),Fe(e,`${t}.tmp-replace`),Fe(`${t}.tmp-replace`,t)}import{createHash as nr,randomUUID as Dn}from"crypto";import{existsSync as A,lstatSync as He,mkdirSync as $,mkdtempSync as ir,readdirSync as or,realpathSync as ar,renameSync as M,rmSync as C,statSync as me}from"fs";import{dirname as Ve,join as l,resolve as j}from"path";import{setTimeout as Gn}from"timers/promises";import{pathToFileURL as Zt}from"url";import{deserializeSCIP as sr}from"@c4312/scip";import kn from"better-sqlite3";import{lstatSync as wn,readdirSync as vn}from"fs";import{join as Rn,relative as Pn,resolve as We,sep as Tn}from"path";var Z=1,ze="language-indexes",Kt=["index.db","index.scip","meta.json"],Qt=[ze,J,K];function pe(e){let t=[];for(let r of Kt)En(e,r),t.push(r);for(let r of Qt)Xt(e,r,t);return{version:Z,files:t.sort()}}function fe(e){if(!e||e.includes("\0")||e.startsWith("/")||e.includes("\\"))throw new Error(`invalid index artifact path: ${e||"<empty>"}`);let t=e.split("/");if(t.some(n=>!n||n==="."||n===".."))throw new Error(`invalid index artifact path: ${e}`);let r=t[0];if(!Kt.includes(e)&&!Qt.includes(r))throw new Error(`index artifact path is not shareable: ${e}`);return e}function T(e,t){let r=fe(t),n=We(e),i=We(n,...r.split("/"));if(i!==n&&!i.startsWith(`${n}${Tn}`))throw new Error(`index artifact escapes cache: ${t}`);return i}function Xt(e,t,r){let n=Rn(e,t),i;try{i=vn(n,{withFileTypes:!0,encoding:"utf8"})}catch{return}for(let o of i){let a=`${t}/${o.name}`;if(o.isSymbolicLink())throw new Error(`index artifact cannot be a symlink: ${a}`);o.isDirectory()?Xt(e,a,r):o.isFile()&&r.push(fe(a))}}function En(e,t){let r=T(e,t),n;try{n=wn(r)}catch{throw new Error(`required index artifact is missing: ${t}`)}if(!n.isFile()||n.isSymbolicLink())throw new Error(`required index artifact is not a regular file: ${t}`);if(Pn(We(e),r).startsWith(".."))throw new Error(`index artifact escapes cache: ${t}`)}var Ue=1,er="SCIP_QUERY_SHARED_CACHE",Cn=2,ge=JSON.stringify({cliVersion:ot,artifactCatalogVersion:Z,postIndexAugmentationSchemaVersion:Cn,sqliteGenerationStoreVersion:_,typescriptFragmentStoreVersion:Ge,typescriptOverlayStoreVersion:le}),Ye="manifest.json",cr="shared-cache.json";var Je=[ze,J,K];function An(e,t){if(!e.clean||!e.treeOid)return;let r=fr(JSON.stringify({version:Ue,repositoryId:e.repositoryId,treeOid:e.treeOid,fingerprint:t,producerIdentity:ge}));return{repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,fingerprint:t,producerIdentity:ge,generationId:r,repositoryCacheDir:Se(e.repositoryId)}}function Ao(e,t,r){if(!Wn(r))return!1;let n=An(e,r);if(!n)return!1;try{let i=_n(t);if(!i||i.repositoryId!==e.repositoryId||i.worktreeId!==e.worktreeId)return!1;let o=JSON.parse(x(l(n.repositoryCacheDir,"worktrees",`${i.worktreeId}.json`),{inputKind:"worktree cache lease",maxBytes:b}));return o.version!==1||o.repositoryId!==i.repositoryId||o.worktreeId!==i.worktreeId||j(o.projectRoot)!==j(e.projectRoot)||o.treeOid!==e.treeOid||j(o.localCacheDir)!==j(t)||o.ownershipChecksum!==Ke(o)||o.baseGenerationId!==n.generationId||o.activeGenerationId!==n.generationId?!1:F(n,!1)!==null}catch{return!1}}function Lo(e,t,r){if(process.env[er]==="0")return`${er}=0`;if(!Ie(r))return"explicit cache or database override";if(be(Ve(t))!==be(st(e))||t!==l(Ve(t),"index.db"))return"index database is outside the managed worktree cache"}function Oo(e,t,r){if(!Ie(t))return;let n=r??ut(e);return n?l(Se(n.repositoryId),"evidence.db"):void 0}function F(e,t=!0){let r=Qe(e),n;try{n=dr(x(l(r,Ye),{inputKind:"shared-generation manifest",maxBytes:b}))}catch{return null}if(n.generationId!==e.generationId||n.repositoryId!==e.repositoryId||n.treeOid!==e.treeOid||n.producerIdentity!==e.producerIdentity||JSON.stringify(n.fingerprint)!==JSON.stringify(e.fingerprint))return null;if(!t)return n;try{for(let i of n.artifacts){let o=T(r,i.path),a=me(o);if(!a.isFile()||a.size!==i.size||re(o,{inputKind:"shared-generation artifact",maxBytes:I})!==i.sha256)return null}}catch{return null}return n}function jo(e,t,r){if(!e.treeOid)return null;let n=xe(t,r),i=l(at(),"repositories",e.repositoryId),o;try{let c=He(i);if(!c.isDirectory()||c.isSymbolicLink())return null;o=ar(i)}catch{return null}let a=l(o,"generations"),s=[];try{for(let c of or(a)){if(!/^[a-f0-9]{64}$/.test(c))continue;let d=l(a,c),u;try{u=He(d)}catch{continue}if(!(!u.isDirectory()||u.isSymbolicLink()))try{let g=dr(x(l(d,Ye),{inputKind:"shared-generation baseline manifest",maxBytes:b}));g.generationId===c&&g.repositoryId===e.repositoryId&&g.treeOid===e.treeOid&&g.producerIdentity===ge&&Fn(g.fingerprint,n)&&s.push(g)}catch{continue}}}catch{return null}s.sort((c,d)=>Date.parse(d.createdAt)-Date.parse(c.createdAt)||c.generationId.localeCompare(d.generationId));for(let c of s){let d={repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,fingerprint:c.fingerprint,producerIdentity:c.producerIdentity,generationId:c.generationId,repositoryCacheDir:o},u=F(d);if(u)return{snapshot:d,manifest:u}}return null}function Mo(e){let t=H(l(e.snapshot.repositoryCacheDir,"locks",`${e.snapshot.generationId}.publish.lock`));if(!t)throw new Error(`shared generation publication is already in progress for ${e.snapshot.generationId}`);try{return Ln(e)}finally{t.release()}}function Ln(e){let t=F(e.snapshot);if(t)return tr(e.snapshot,t);if(!pr(e.sourceCacheDir,e.sourceProjectRoot,e.snapshot.fingerprint))throw new Error("source index is incomplete, incompatible, or corrupt");let r=rr(e.sourceCacheDir);if(!r)throw new Error("source index artifacts are incomplete");let n=pe(e.sourceCacheDir),i=l(e.snapshot.repositoryCacheDir,"generations"),o=[ne(i)],a=ir(l(i,`.tmp-${process.pid}-`));try{let s=[];for(let y of n.files){let D=T(e.sourceCacheDir,y),S=T(a,y);o.push(te(D,S,292)),e.onPublicationStage?.("after-artifact-flushed",y);let ye=me(S).size;s.push({path:y,size:ye,sha256:re(S,{inputKind:"staged shared-generation artifact",maxBytes:I})})}let c=sr(h(l(a,"index.scip"),{inputKind:"staged shared SCIP index",maxBytes:I})).metadata?.projectRoot;if(!c)throw new Error("shared SCIP generation has no project root metadata");let d=Xe(e.sourceProjectRoot);if(c!==d)throw new Error("shared SCIP generation root does not match its source worktree");if(rr(e.sourceCacheDir)!==r||e.sourceStillValid&&!e.sourceStillValid())throw new Error("source index changed while staging a shared generation");let u={version:Ue,artifactCatalogVersion:Z,generationId:e.snapshot.generationId,repositoryId:e.snapshot.repositoryId,treeOid:e.snapshot.treeOid,fingerprint:e.snapshot.fingerprint,producerIdentity:e.snapshot.producerIdentity,sourceProjectRoot:e.sourceProjectRoot,scipProjectRoot:c,createdAt:(e.now??(()=>new Date))().toISOString(),artifacts:s.sort((y,D)=>y.path.localeCompare(D.path))},g=v(l(a,Ye),u,{spacing:2,trailingNewline:!0});g.directorySync!=="not-requested"&&o.push(g.directorySync),e.onPublicationStage?.("after-manifest-flushed"),o.push(k(a)),e.onPublicationStage?.("after-staging-directory-synced");let m=Qe(e.snapshot);try{if(A(m)&&!F(e.snapshot)){let y=`${m}.corrupt-${process.pid}-${Date.now()}`;M(m,y),C(y,{recursive:!0,force:!0})}M(a,m)}catch(y){let D=F(e.snapshot);if(D)return tr(e.snapshot,D);throw y}e.onPublicationStage?.("after-generation-renamed"),o.push(k(i)),e.onPublicationStage?.("after-generations-directory-synced");let E=z(...o);return{kind:"published",manifest:u,achievedDurability:E==="synced"?"directory-durable":"file-flushed",directorySync:E}}finally{C(a,{recursive:!0,force:!0})}}function tr(e,t){let r=k(l(e.repositoryCacheDir,"generations"));return{kind:"existing",manifest:t,achievedDurability:r==="synced"?"directory-durable":"file-flushed",directorySync:r}}function Fo(e){let t=Qe(e.snapshot);$(e.targetCacheDir,{recursive:!0});let r=H(l(e.targetCacheDir,"cache-lifecycle.lock"),{waitMs:e.lockWaitMs??3e4});if(!r)throw new Error("timed out waiting for another cache hydration");let n,i,o=!1;try{n=ir(l(e.targetCacheDir,".shared-hydrate-")),qn(e.manifest,e.snapshot);for(let c of e.manifest.artifacts){let d=T(t,c.path),u=T(n,c.path);if(te(d,u),me(u).size!==c.size||re(u,{inputKind:"hydrated shared-generation artifact",maxBytes:I})!==c.sha256)throw new Error(`shared artifact is corrupt: ${c.path}`)}let a=Xe(e.targetProjectRoot);if(a!==e.manifest.scipProjectRoot)for(let c of e.manifest.artifacts)c.path.endsWith(".scip")&&Pt(T(n,c.path),e.manifest.scipProjectRoot,a);if(!pr(n,e.targetProjectRoot,e.snapshot.fingerprint,!1))throw new Error("staged shared generation failed completeness or integrity validation");i=Nn(e.targetCacheDir,n),o=!0,Bn(n,e.targetCacheDir,i),Ht({tempOutputScip:l(n,"index.scip"),tempOutputDb:l(n,"index.db"),tempMetaPath:l(n,"meta.json"),outputScip:l(e.targetCacheDir,"index.scip"),outputDb:l(e.targetCacheDir,"index.db"),metaPath:l(e.targetCacheDir,"meta.json"),now:e.now});let s=Be(l(e.targetCacheDir,"index.db"),l(e.targetCacheDir,"meta.json"));if(s.state==="invalid"||s.state==="drifted")throw new Error(`hydrated SQLite generation failed validation: ${s.reason}`);e.persistLease!==!1&&On(e.snapshot,e.targetCacheDir,e.action??"attached",e.now)}catch(a){throw o&&i&&$n(e.targetCacheDir,i),a}finally{n&&C(n,{recursive:!0,force:!0}),r.release()}}async function _o(e,t={}){let r=t.timeoutMs??3e4,n=t.pollMs??100,i=t.now??nt,o=i()+r,a=l(e.repositoryCacheDir,"locks"),s=l(a,`${e.generationId}.lock`),c=d=>{if(!d||typeof d!="object"||Array.isArray(d))return null;let u=d.pid;return typeof u=="number"&&Number.isSafeInteger(u)&&u>0?{pid:u}:null};for(;i()<=o;){if(F(e))return{kind:"generation-ready"};let d=pt(s,{kind:"shared-generation-build",detail:{generationId:e.generationId},parseLegacy:c});if(d.kind==="acquired")return{kind:"owner",release:()=>d.lock.release()};let u=o-i();if(u<=0)break;await Gn(Math.min(n,u))}return F(e)?{kind:"generation-ready"}:{kind:"timeout"}}function On(e,t,r,n=void 0){let i={version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,localCacheDir:t,baseGenerationId:e.generationId,activeGenerationId:e.generationId,lastAction:r,lastSeenAt:(n??(()=>new Date))().toISOString()},o={...i,ownershipChecksum:Ke(i)};return lr(e.repositoryCacheDir,o,!0),o}function No(e,t,r=void 0){let n={version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,localCacheDir:t,baseGenerationId:e.generationId,lastAction:"overlay",lastReason:`private cache forked from shared baseline ${e.generationId}`,lastSeenAt:(r??(()=>new Date))().toISOString()},i={...n,ownershipChecksum:Ke(n)};return lr(e.repositoryCacheDir,i,!0),i}function Ke(e){return fr(JSON.stringify({version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:j(e.projectRoot),localCacheDir:j(e.localCacheDir)}))}function dr(e){let t=JSON.parse(e);if(t.version!==Ue||t.artifactCatalogVersion!==Z||typeof t.generationId!="string"||!/^[a-f0-9]{64}$/.test(t.generationId)||typeof t.repositoryId!="string"||!/^[a-f0-9]{24}$/.test(t.repositoryId)||typeof t.treeOid!="string"||!t.treeOid||typeof t.producerIdentity!="string"||t.producerIdentity!==ge||typeof t.sourceProjectRoot!="string"||typeof t.scipProjectRoot!="string"||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!t.fingerprint||!Array.isArray(t.artifacts))throw new Error("invalid shared generation manifest");let r=new Set;for(let n of t.artifacts){if(!n||typeof n.path!="string"||typeof n.size!="number"||n.size<0||typeof n.sha256!="string"||!/^[a-f0-9]{64}$/.test(n.sha256))throw new Error("invalid shared generation artifact");if(fe(n.path),r.has(n.path))throw new Error(`duplicate shared generation artifact: ${n.path}`);r.add(n.path)}for(let n of["index.db","index.scip","meta.json"])if(!r.has(n))throw new Error(`shared generation is missing ${n}`);return t}function te(e,t,r=384){return ie(e,t,{mode:r})}function jn(e,t,r){$(e,{recursive:!0}),v(l(e,cr),{version:1,repositoryId:t,worktreeId:r},{spacing:2,trailingNewline:!0})}function rr(e){try{let t=pe(e),r=nr("sha256");for(let n of t.files){let i=T(e,n),o=me(i).size;r.update(n).update("\0").update(String(o)).update("\0"),Ze(i,{inputKind:"source-generation artifact",maxBytes:I},a=>r.update(a)),r.update("\0")}return r.digest("hex")}catch{return null}}function Mn(e){try{let t=rt(x(l(e,"meta.json"),{inputKind:"reindex metadata",maxBytes:b}));return(t.kind==="legacy"||t.kind==="supported")&&t.capabilities.publishableGeneration?t.metadata:void 0}catch{return}}function Fn(e,t){let r=xe(e.languages,e);return JSON.stringify(r)===JSON.stringify(t)}function Qe(e){return l(e.repositoryCacheDir,"generations",e.generationId)}function _n(e){let t=JSON.parse(x(l(e,cr),{inputKind:"worktree cache pointer",maxBytes:b}));return t.version!==1||typeof t.repositoryId!="string"||!/^[a-f0-9]{24}$/.test(t.repositoryId)||typeof t.worktreeId!="string"||!/^[a-f0-9]{24}$/.test(t.worktreeId)?null:{version:t.version,repositoryId:t.repositoryId,worktreeId:t.worktreeId}}function lr(e,t,r){let n=ft(e,{waitMs:5e3});if(!n)throw new Error("repository cache cleanup is busy");try{if(r){let o=t.activeGenerationId??t.baseGenerationId;if(!o||!A(l(e,"generations",o)))throw new Error("shared generation disappeared before its lease was attached")}let i=l(e,"worktrees");$(i,{recursive:!0}),v(l(i,`${t.worktreeId}.json`),t,{spacing:2,trailingNewline:!0}),jn(t.localCacheDir,t.repositoryId,t.worktreeId)}finally{n.release()}}function Nn(e,t){let r=l(t,".rollback"),n=new Map,i=new Map;$(r,{recursive:!0});for(let s of["index.scip","index.db","meta.json"]){let c=l(e,s),d=A(c);n.set(s,d),d&&te(c,l(r,"stable",s))}for(let s of Je){let c=l(e,s),d=A(c);if(d){let u=He(c);if(!u.isDirectory()||u.isSymbolicLink())throw new Error(`managed artifact path is not a directory: ${s}`)}i.set(s,d)}let o=l(e,ae),a=A(o);return a&&ur(o,l(r,"sqlite-generations")),{root:r,stableFiles:n,managedDirectories:i,generationStoreExisted:a}}function Bn(e,t,r){for(let n of Je){let i=l(t,n);if(r.managedDirectories.get(n)){let a=l(r.root,"managed",n);$(Ve(a),{recursive:!0}),M(i,a)}let o=l(e,n);A(o)&&M(o,i)}}function $n(e,t){for(let i of Je){let o=l(e,i),a=l(t.root,"managed",i);t.managedDirectories.get(i)?A(a)&&(C(o,{recursive:!0,force:!0}),M(a,o)):C(o,{recursive:!0,force:!0})}for(let[i,o]of t.stableFiles){let a=l(e,i);if(!o){C(a,{force:!0});continue}let s=`${a}.shared-restore-${Dn()}`;te(l(t.root,"stable",i),s),C(a,{force:!0}),M(s,a)}let r=l(e,ae);C(r,{recursive:!0,force:!0});let n=l(t.root,"sqlite-generations");t.generationStoreExisted&&A(n)&&M(n,r)}function ur(e,t){$(t,{recursive:!0});for(let r of or(e,{withFileTypes:!0})){let n=l(e,r.name),i=l(t,r.name);if(r.isSymbolicLink())throw new Error(`managed cache backup cannot contain a symlink: ${n}`);r.isDirectory()?ur(n,i):r.isFile()&&te(n,i)}}function qn(e,t){if(e.generationId!==t.generationId||e.repositoryId!==t.repositoryId||e.treeOid!==t.treeOid||e.producerIdentity!==t.producerIdentity||JSON.stringify(e.fingerprint)!==JSON.stringify(t.fingerprint))throw new Error("shared generation manifest does not match the requested snapshot")}function pr(e,t,r,n=!0,i=!0){try{let o=Mn(e);if(!o||JSON.stringify(o.fingerprint)!==JSON.stringify(r)||JSON.stringify([...o.indexedLanguages??[]].sort())!==JSON.stringify([...r.languages].sort()))return ee("source validation rejected metadata"),!1;let a=pe(e),s=Be(l(e,"index.db"),l(e,"meta.json"));if(n?s.state!=="current":s.state==="invalid"||s.state==="drifted")return ee(`source validation rejected SQLite generation state ${s.state}`),!1;let c=new kn(l(e,"index.db"),{readonly:!0,fileMustExist:!0});try{if(i){if(c.pragma("quick_check(1)",{simple:!0})!=="ok")return!1}else c.pragma("schema_version",{simple:!0})}finally{c.close()}let d=Xe(t),g=(i?a.files.filter(m=>m.endsWith(".scip")):["index.scip"]).every(m=>{let E=sr(h(T(e,m),{inputKind:"shared SCIP validation artifact",maxBytes:I})).metadata?.projectRoot;return E!==d&&ee(`source validation rejected SCIP root for ${m}: ${String(E)}`),E===d});return g||ee("source validation rejected SCIP project roots"),g}catch(o){return ee(`source validation failed: ${o instanceof Error?o.message:String(o)}`),!1}}function ee(e){process.env.SCIP_QUERY_DEBUG&&console.error(`shared-cache: ${e}`)}function Xe(e){try{return Zt(ar(e)).href}catch{return Zt(j(e)).href}}function Wn(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===3&&Array.isArray(t.languages)&&typeof t.pnpmWorkspaces=="boolean"&&(t.typescriptProjectMode==="single"||t.typescriptProjectMode==="workspace")&&Array.isArray(t.typescriptProjects)&&Array.isArray(t.files)&&t.files.every(r=>r!==null&&typeof r=="object"&&typeof r.path=="string"&&typeof r.size=="number"&&typeof r.hash=="string")}function fr(e){return nr("sha256").update(e).digest("hex")}export{Yn as a,ti as b,di as c,li as d,mi as e,Gi as f,ki as g,Ni as h,Bi as i,$i as j,Ht as k,un as l,Zi as m,Be as n,An as o,Ao as p,Lo as q,Oo as r,F as s,jo as t,Mo as u,Fo as v,_o as w,On as x,No as y,Ke as z};
|
|
2
|
-
//# sourceMappingURL=chunk-AUP6YI5M.js.map
|
package/dist/chunk-CA5RE6H7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as I}from"./chunk-63MBA7EG.js";import{a as y,e as g}from"./chunk-5IZTXSOL.js";import{z as v}from"./chunk-AA7K3XLM.js";import{c as b,h as D,i as _,p as F,r as p,u as E,w as x}from"./chunk-DMQ7ZKJG.js";import{spawnSync as O}from"child_process";import{createHash as U}from"crypto";import{existsSync as k}from"fs";import{dirname as L,join as T}from"path";import{fileURLToPath as j}from"url";var N=b("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),M=E({kind:"consumer-file-usage",invalidation:x("consumer-file-usage"),serialize:Q,deserialize:W});function Le(e,n){return{forDefinitions(r,i){return V(e,n,r,i)}}}function Me(e){let n=new Map;for(let[r,i]of e)n.set(r,new Set(i.files.map(t=>t.file)));return n}function Re(e,n,r){return w(e,n,r).partition}function V(e,n,r,i){let t=h(r.length),s=F()?_(e):null,a=s?B(r,i,s):void 0,o=a?{workIdentity:a,workOutcome:"computed"}:{};return p("consumer-evidence.product",()=>{let l=p("consumer-evidence.provenance",()=>z(e,n,r,i),()=>({...o,definitions:r.length,semantic:i.semantic,sourceFallback:i.sourceFallback!==!1})),u=new Map;t={...t,...l.counters};let c=Y(r,l.sources);return p("consumer-evidence.classify",()=>{let f=q(e,r,l.sources,c);for(let d of r){let m=f.get(d.symbolId)??H();t.realFiles+=m.partition.realConsumers.length,t.reexportOnlyFiles+=m.partition.barrelConsumers,t.importOnlyFiles+=m.partition.importOnlyConsumers,u.set(d.symbolId,{definition:d,files:m.files,...m.partition})}},()=>({...o,...c,realFiles:t.realFiles,reexportOnlyFiles:t.reexportOnlyFiles,importOnlyFiles:t.importOnlyFiles})),u},()=>({...o,...t}))}function B(e,n,r){let i=U("sha256").update("consumer-evidence-v1\0").update(r).update("\0").update(n.semantic?"semantic\0":"indexed\0").update(n.sourceFallback===!1?"no-source-fallback":"source-fallback");for(let t of e.map(s=>s.symbol).sort())i.update("\0").update(t);return i.digest("hex").slice(0,24)}function h(e){return{definitions:e,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function z(e,n,r,i){let t=h(r.length),s=new Map;return S(s,t,"indexed",n.crossFileCallerMap(r,{semantic:!1})),i.semantic&&S(s,t,"semantic",I(e,r)),i.sourceFallback!==!1&&S(s,t,"source-fallback",n.sourceFallbackCallerFiles(r)),t.totalFiles=[...s.values()].reduce((a,o)=>a+o.size,0),{sources:s,counters:t}}function Y(e,n){return{definitions:e.length,consumerFiles:[...n.values()].reduce((r,i)=>r+i.size,0),nativeAttempted:!1,nativeUsed:!1,nativeReason:"not-attempted"}}function S(e,n,r,i){let t=0;for(let[s,a]of i){let o=e.get(s);o||(o=new Map,e.set(s,o));for(let l of a){t++;let u=o.get(l)??new Set;u.add(r),o.set(l,u)}}r==="indexed"?n.indexedFiles+=t:r==="semantic"?n.semanticFiles+=t:n.fallbackFiles+=t}function q(e,n,r,i){let t=re(e,n,r,i);return t||$(e,n,r)}function $(e,n,r){let i=new Map;for(let t of n){let s=r.get(t.symbolId)??new Map;i.set(t.symbolId,w(e,t,[...s.keys()],s))}return i}function w(e,n,r,i=new Map){let t=[],s=0,a=0,o=g(n.symbol),l=[];for(let u of r){let c;X(e,u,n.relativePath,o)?(s++,c="reexport-only"):J(e,u,o)?(a++,c="import-only"):(t.push(u),c="real"),l.push({file:u,sources:[...i.get(u)??[]],classification:c})}return{partition:{realConsumers:t,barrelConsumers:s,importOnlyConsumers:a},files:l}}function H(){return{partition:{realConsumers:[],barrelConsumers:0,importOnlyConsumers:0},files:[]}}function J(e,n,r){if(!r)return!1;let i=v(n);if(!i)return!1;let t=N.get(e,n,()=>A(e,n,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function A(e,n,r){let i=y(e).forFile(n,{text:!0,ast:!0}),t=i.text;if(!t)return G();let s=D(e,n,t),a=M.read(e,n,s);if(a)return a;let o=K(i.ast,r);return M.write(e,n,s,o),o}function K(e,n){let r=new Set,i=new Set;if(!e)return{importedLeaves:r,usedLeaves:i};let t=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),s=(a,o)=>{let l=o||t.has(a.type);(a.type==="identifier"||a.type==="type_identifier"||a.type==="property_identifier"||a.type==="field_identifier")&&(l?r.add(a.text):i.add(a.text));for(let u of a.children)s(u,l)};return s(e.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function G(){return{importedLeaves:new Set,usedLeaves:new Set}}function Q(e){return JSON.stringify({importedLeaves:[...e.importedLeaves],usedLeaves:[...e.usedLeaves]})}function W(e){try{let n=JSON.parse(e);return!Array.isArray(n.importedLeaves)||!Array.isArray(n.usedLeaves)?null:{importedLeaves:new Set(n.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(n.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function X(e,n,r,i){if(!i)return!1;let t=y(e).forFile(n,{lines:!0,reexports:!0}),s=t.lines??[];if(s.length===0)return!1;let a=t.reexports??[];return P(s,a,i)}function P(e,n,r){if(e.length===0||n.length===0)return!1;let i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`\\b${i}\\b`),s=0;for(let a=0;a<e.length;a++){if(!t.test(e[a]??""))continue;if(s++,!n.find(l=>l.startLine<=a&&a<=l.endLine))return!1}return s>0}var Z="SCIP_QUERY_NATIVE_CONSUMER_CLASSIFY",ee="SCIP_QUERY_NATIVE_KERNELS_BIN",ne="SCIP_QUERY_NATIVE_CONSUMER_CLASSIFY_MIN_FILES",R=1e3,ie=5e3,te=64*1024*1024,C;function re(e,n,r,i){let t=process.env[Z]?.toLowerCase();if(t!=="1"&&t!=="true")return i.nativeReason=t==="0"||t==="false"?"disabled":"opt-in-required",null;if(i.consumerFiles<fe())return i.nativeReason="below-threshold",null;let s=me();if(!s)return i.nativeReason="binary-missing",null;i.nativeAttempted=!0;let a=se(e,n,r),o=O(s,["consumer-classify"],{input:JSON.stringify(a),encoding:"utf8",timeout:ie,maxBuffer:te});if(o.status!==0||o.error)return i.nativeReason=o.error?`spawn-error:${o.error.message}`:`exit-${o.status??"null"}`,null;try{let l=JSON.parse(o.stdout),u=ae(l,n);return u?(i.nativeUsed=!0,i.nativeReason="used",u):(i.nativeReason="invalid-response",null)}catch{return i.nativeReason="invalid-json",null}}function se(e,n,r){let i=new Map,t=[];for(let o of n){let l=g(o.symbol),c=[...(r.get(o.symbolId)??new Map).entries()].map(([f,d])=>{let m=i.get(f)??new Set;return l&&m.add(l),i.set(f,m),{file:f,sources:[...d]}});t.push({symbol_id:o.symbolId,leaf:l,consumer_files:c})}let s={},a={};for(let[o,l]of i){let u=v(o);if(u){let f=N.get(e,o,()=>A(e,o,u));s[o]={imported_leaves:[...f.importedLeaves],used_leaves:[...f.usedLeaves]}}let c=oe(e,o,l);c.length>0&&(a[o]=c)}return{definitions:t,file_usages:s,reexport_only_leaves:a}}function oe(e,n,r){if(r.size===0)return[];let i=y(e).forFile(n,{lines:!0,reexports:!0}),t=i.lines??[],s=i.reexports??[];return t.length===0||s.length===0?[]:[...r].filter(a=>P(t,s,a))}function ae(e,n){if(!Array.isArray(e.entries)||e.entries.length!==n.length)return null;let r=new Set(n.map(t=>t.symbolId)),i=new Map;for(let t of e.entries){let s=le(t);if(!s||!r.has(s.symbol_id))return null;i.set(s.symbol_id,{partition:{realConsumers:s.real_consumers,barrelConsumers:s.barrel_consumers,importOnlyConsumers:s.import_only_consumers},files:s.files})}for(let t of r)if(!i.has(t))return null;return i}function le(e){if(!e||typeof e!="object")return null;let n=e;if(typeof n.symbol_id!="number"||!Array.isArray(n.real_consumers)||typeof n.barrel_consumers!="number"||typeof n.import_only_consumers!="number"||!Array.isArray(n.files)||!n.real_consumers.every(i=>typeof i=="string"))return null;let r=[];for(let i of n.files){if(!i||typeof i!="object")return null;let t=i;if(typeof t.file!="string"||!Array.isArray(t.sources)||!t.sources.every(ue)||!ce(t.classification))return null;r.push({file:t.file,sources:t.sources,classification:t.classification})}return{symbol_id:n.symbol_id,real_consumers:n.real_consumers,barrel_consumers:n.barrel_consumers,import_only_consumers:n.import_only_consumers,files:r}}function ue(e){return e==="indexed"||e==="semantic"||e==="source-fallback"}function ce(e){return e==="real"||e==="reexport-only"||e==="import-only"}function fe(){let e=process.env[ne];if(!e)return R;let n=Number(e);return Number.isFinite(n)&&n>=0?n:R}function me(){if(C!==void 0)return C;let e=process.env[ee],n=process.platform==="win32"?"scip-query-kernels.exe":"scip-query-kernels";return C=[...e?[e]:[],...de().map(i=>T(i,"target","release",n))].find(i=>k(i))??null,C}function de(){let e=new Set,n=L(j(import.meta.url));for(let r=0;r<5;r++)e.add(n),n=L(n);return[...e]}export{Le as a,Me as b,Re as c,J as d};
|
|
2
|
-
//# sourceMappingURL=chunk-CA5RE6H7.js.map
|
package/dist/chunk-CT5SI2I4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Ie,i as De,j as W}from"./chunk-54EOGFBR.js";import{c as we,h as Ae}from"./chunk-T6FRID7Y.js";import{a as be,i as A,k,l as ke,n as q,o as U,p as xe}from"./chunk-G6OGPXJW.js";import{a as Me,e as he,i as Ee}from"./chunk-DRENNWRG.js";import{a as S,c as ye,d as M,e as p,f as Q,g as J,i as Se}from"./chunk-H5EXS3HM.js";import{a as C,e as X,g as v}from"./chunk-HGFDYOVB.js";import{a as fe,b as Re,c as me,d as w}from"./chunk-3VLJ2DCA.js";import{a as ce,b as E,c as de,f as pe,g as x,ha as ge,k as $}from"./chunk-4DCKBY6T.js";import{createHash as cn}from"crypto";import{resolve as dn}from"path";var b=3;function F(e){return cn("sha256").update(A({kind:"scip-query-durable-rust-mailbox",protocolVersion:b,sessionDir:dn(e)})).digest("hex")}function pn(e,n){if(!S(e)||typeof e.id!="string"||!e.id)return T("Durable Rust semantic helper received an invalid mailbox request.");if(e.id!==n.claimRequestId)return T("Durable Rust semantic request identity does not match its mailbox path.");if(e.protocolVersion===void 0){if(e.mailboxVersion!==void 0||e.operationKey!==void 0||e.clientId!==void 0||e.enqueuedAtMs!==void 0||e.deadlineAtMs!==void 0||e.sessionIdentity!==void 0)return T("Durable Rust semantic helper received a partially versioned request without a protocol version.");let s=_e(e.request);if(!s)return T("Durable Rust semantic helper received an invalid legacy request kind or payload.");let i=n.nowMs+Math.max(1,s.timeoutMs);return{ok:!0,compatibility:"legacy-v2",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:q("rust-semantic-v2",{id:e.id,request:s}),clientId:"legacy-v2",enqueuedAtMs:n.nowMs,deadlineAtMs:i,sessionIdentity:n.sessionIdentity,request:s}}}let t=fn(e,n);if(!t.ok)return t;if(e.protocolVersion!==b)return{ok:!1,code:"unsupported-protocol",error:`Durable Rust semantic helper does not support mailbox protocol ${String(e.protocolVersion)}.`,responseIdentity:t.responseIdentity};let r=_e(e.request);return r?t.operationKey!==q("rust-semantic-v3",r)?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a mismatched mailbox operation identity.",responseIdentity:t.responseIdentity}:t.deadlineAtMs-t.enqueuedAtMs!==r.timeoutMs?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a deadline that does not match the request timeout.",responseIdentity:t.responseIdentity}:t.deadlineAtMs<n.nowMs?{ok:!1,code:"expired-request",error:"Durable Rust semantic request expired before processing.",responseIdentity:t.responseIdentity}:{ok:!0,compatibility:t.priorSessionIdentity?"prior-v3":"current-v3",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:t.operationKey,clientId:t.clientId,enqueuedAtMs:t.enqueuedAtMs,deadlineAtMs:t.deadlineAtMs,sessionIdentity:n.sessionIdentity,request:r}}:{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received an invalid request kind or payload.",responseIdentity:t.responseIdentity}}function ne(e,n){return S(e)?e.protocolVersion!==b?ve(e.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(e.protocolVersion)}`):e.mailboxVersion!==k||e.id!==n.requestId||e.operationKey!==n.operationKey||e.sessionIdentity!==n.sessionIdentity||e.deadlineAtMs!==n.deadlineAtMs?ve("helper wrote an incompatible response identity"):typeof e.completedAtMs!="number"||!Number.isFinite(e.completedAtMs)||e.completedAtMs>n.deadlineAtMs||n.nowMs>n.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:e.ok===!1?typeof e.error!="string"||!In(e.errorCode)?Z("helper wrote an invalid rejection response"):{ok:!1,code:e.errorCode,error:e.error}:e.ok!==!0||e.session!=="created"&&e.session!=="reused"&&e.session!=="invalidated"||!Sn(e.response,n.requestKind)?Z("helper wrote an invalid success response"):{ok:!0,session:e.session,response:e.response}:Z("helper wrote an invalid response object")}function fn(e,n){if(e.mailboxVersion!==k||typeof e.protocolVersion!="number"||!Number.isInteger(e.protocolVersion)||typeof e.operationKey!="string"||!J(e.operationKey)||e.id!==U(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||!J(e.sessionIdentity))||e.sessionIdentity===void 0&&e.protocolVersion!==b)return T("Durable Rust semantic helper received an invalid mailbox lifecycle.");let t={id:n.claimRequestId,sessionIdentity:n.sessionIdentity,deadlineAtMs:e.deadlineAtMs};return e.sessionIdentity!==void 0&&e.sessionIdentity!==n.sessionIdentity?{ok:!1,code:"malformed-request",error:"Durable Rust semantic request belongs to a different mailbox session.",responseIdentity:t}:{ok:!0,responseIdentity:t,operationKey:e.operationKey,clientId:e.clientId,enqueuedAtMs:e.enqueuedAtMs,deadlineAtMs:e.deadlineAtMs,priorSessionIdentity:e.sessionIdentity===void 0}}function _e(e){return!S(e)||typeof e.identityKey!="string"||!e.identityKey||!Q(e.timeoutMs)||e.workerEnvironment!==void 0&&!ye(e.workerEnvironment)?null:e.kind==="semantic"&&Rn(e.request)?{kind:"semantic",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:e.kind==="import-definitions"&&mn(e.request)?{kind:"import-definitions",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:null}function Rn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!Te(e.definitions)?!1:G(e.referenceDefinitions)&&G(e.calleeDefinitions)&&G(e.signatureDefinitions)&&I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.referenceRetryTimeoutMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)&&ee(e.includeReferences)&&ee(e.includeCallees)&&ee(e.includeSignatures)}function mn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!M(e.file)||!Array.isArray(e.positions)||!e.positions.every(n=>S(n)&&M(n.id)&&M(n.file)&&p(n.line)&&p(n.column))?!1:I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)}function Te(e){return Array.isArray(e)&&e.every(yn)}function G(e){return e===void 0||Te(e)}function yn(e){return S(e)&&p(e.symbolId)&&p(e.documentId)&&p(e.startLine)&&qe(e.startChar)&&p(e.endLine)&&qe(e.endChar)&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&(e.parentTypeName===null||typeof e.parentTypeName=="string")&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(e.kind===null||Number.isSafeInteger(e.kind))&&(e.documentation===null||typeof e.documentation=="string")&&(e.enclosingSymbol===null||typeof e.enclosingSymbol=="string")}function Sn(e,n){return!S(e)||typeof e.available!="boolean"||e.available===!1&&(typeof e.reason!="string"||e.reason.length===0)||e.available===!0&&e.reason!==void 0?!1:n==="import-definitions"?Array.isArray(e.sourcePaths)&&e.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):Ce(e.references,bn)&&(e.incompleteReferenceSymbolIds===void 0||Array.isArray(e.incompleteReferenceSymbolIds)&&e.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(e.callees===void 0||Ce(e.callees,gn))&&(e.signatures===void 0||Array.isArray(e.signatures)&&e.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function Ce(e,n){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(n))}function bn(e){return S(e)&&typeof e.file=="string"&&p(e.line)&&p(e.column)}function gn(e){return S(e)&&typeof e.symbol=="string"&&typeof e.file=="string"&&p(e.line)&&(e.callsiteLine===void 0||p(e.callsiteLine))}function In(e){return e==="unsupported-protocol"||e==="malformed-request"||e==="expired-request"||e==="handler-error"}function T(e){return{ok:!1,code:"malformed-request",error:e}}function Z(e){return{ok:!1,code:"malformed-response",error:e}}function ve(e){return{ok:!1,code:"incompatible-response",error:e}}function Pe(e){return e===void 0||Q(e)}function qe(e){return e===void 0||p(e)}function I(e){return e===void 0||Se(e)}function ee(e){return e===void 0||typeof e=="boolean"}import{spawn as Tn}from"child_process";import{createHash as Pn,randomUUID as Bn}from"crypto";import{existsSync as He,realpathSync as Nn,rmSync as On}from"fs";import{tmpdir as Un}from"os";import{resolve as _}from"path";import{execFileSync as An}from"child_process";import{existsSync as Dn}from"fs";import{deserializeSCIP as Mn,SymbolRole as hn}from"@c4312/scip";var te=new WeakMap,En="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function kt(e,n){let t=new Map,r=L(),s=n.filter(u=>Ne(u,r));if(s.length===0)return t;let i=Oe(e);if(!i)return t;for(let u of s){let l=Be(i,u);l!==null&&t.set(u.symbolId,l)}return t}function xt(e,n){if(!Ne(n,L()))return null;let t=Oe(e);return t?Be(t,n):null}function Be(e,n){return e.referencesBySymbol.get(n.symbol)??[]}function Ne(e,n="safe"){if(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||Ee(e.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(e.symbol))return!1;if(n==="all")return!0;let t=he(e.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Me(e.symbol);return"kind"in r?!1:!kn(r)}function kn(e){for(let n=0;n<e.descriptors.length-1;n+=1)if(e.descriptors[n]?.suffix==="type")return!0;return!1}function Oe(e){if(te.has(e))return te.get(e)??null;let n=xn(e);return te.set(e,n),n}function xn(e){if(!e.generation.indexPath||!Dn(e.generation.indexPath))return null;try{let n=Mn(pe(e.generation.indexPath,{inputKind:"SCIP occurrence-reference index",maxBytes:de})),t=new Map;for(let r of n.documents??[]){let s=r.relativePath;if(!(!s||e.isIgnored(s)))for(let i of r.occurrences??[]){if(!i.symbol||(i.symbolRoles&hn.Definition)!==0)continue;let u=wn(s,i.range);if(!u)continue;let l=t.get(i.symbol)??[];l.push(u),t.set(i.symbol,l)}}for(let[r,s]of t)t.set(r,Ae(s));return{referencesBySymbol:t}}catch{return null}}function wn(e,n){if(n.length<3)return null;let t=n[0],r=n[1];return!Number.isInteger(t)||!Number.isInteger(r)?null:{file:e,line:t,column:r}}function L(){return process.env[En]==="all"?"all":"safe"}function Ue(e){let n=De(Ie,e),t=n.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}var We=new Map;function re(e){let t=Ue(e).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?_n(e,t):"unavailable"}}function Tt(e){return{...re(e),scipOccurrenceReferenceMode:L()}}function _n(e,n){let t=`${e}\0${n}`,r=We.get(t);if(r)return r;let s;try{s=An(n,["--version"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim()}catch{s="unknown"}return We.set(t,s),s}import{createHash as Cn}from"crypto";var vn=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function Fe(e){let n=ge(e,{includePath:qn});return Cn("sha256").update(JSON.stringify(n)).digest("hex")}function qn(e){let n=e.replaceAll("\\","/"),t=n.split("/").at(-1)??n;return n.endsWith(".rs")||vn.has(t)?!0:n===".cargo/config"||n===".cargo/config.toml"||n.endsWith("/.cargo/config")||n.endsWith("/.cargo/config.toml")}var Wn=5e3,$e=10,Fn=3e4;function Le(e,n,t,r=en){let s=r.engineIdentity(e),i={protocolVersion:b,projectRoot:r.canonicalProjectRoot(e),projectFingerprint:r.projectFingerprint(e),engine:{engine:s.engine,resolvedBinary:s.resolvedBinary,version:s.version},workerFingerprint:r.fileFingerprint(n),environment:Je(r.environment())};return{key:se(A(i)),...i}}var je=class{constructor(n,t=Kn){this.createRequester=n;this.applyEnvironment=t}createRequester;applyEnvironment;requester=null;identityKey=null;semanticResponseCache=null;handle(n){this.applyEnvironment(n.workerEnvironment??{});let t;if(this.requester?this.identityKey!==n.identityKey?(this.semanticResponseCache=null,this.requester.shutdown(),this.requester=this.createRequester(),this.identityKey=n.identityKey,t="invalidated"):t="reused":(this.requester=this.createRequester(),this.identityKey=n.identityKey,t="created"),n.kind==="semantic"){let r=Ln(n.request),s=t==="reused"&&r!==null&&this.semanticResponseCache?.identityKey===n.identityKey&&this.semanticResponseCache.requestKey===r?this.semanticResponseCache.response:null;if(s)return Ke(!0,n.request.definitions.length),{session:t,response:s};let i=this.requester.requestSemantic(n.request,n.timeoutMs);return r!==null&&jn(i)&&(this.semanticResponseCache={identityKey:n.identityKey,requestKey:r,response:i}),Ke(!1,n.request.definitions.length),{session:t,response:i}}return{session:t,response:this.requester.requestImportDefinitions(n.request,n.timeoutMs)}}shutdown(){this.requester?.shutdown(),this.requester=null,this.identityKey=null,this.semanticResponseCache=null}};function Ln(e){if(e.includeReferences===!1||e.includeCallees!==!0||e.includeSignatures===!0||(e.referenceDefinitions?.length??0)===0||(e.calleeDefinitions?.length??0)===0)return null;let{readinessDeadlineMs:n,...t}=e;return se(A(t))}function jn(e){return e.available&&Array.isArray(e.callees)&&(e.incompleteReferenceSymbolIds?.length??0)===0}function Ke(e,n){C()&&v({type:"span",name:"rust.semantic.durable-session.response-cache",durationMs:0,ok:!0,hit:e,definitions:n})}function j(e,n,t,r){if(e.protocolVersion!==b||!t(e.pid))return!1;if(!e.processIdentity)return!0;let s=r?.(e.pid);return s!=null&&Re(e.processIdentity,s)}function Qe(e,n,t){let r;try{r=$(n,{maxBytes:E,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let s=se(A({projectRoot:_(e),serverPath:_(n),serverFingerprint:r})).slice(0,20);return _(t,`scip-query-rust-session-${s}`)}function ze(e){let n=e===void 0?Number.NaN:Number(e);return Number.isInteger(n)&&n>=0?n:0}function Je(e){return Object.fromEntries(Object.entries(e).filter(([n])=>Ge(n)).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>[n,t??null]))}function Xe(e,n){let t=n.runtime??$n,r=n.identityRuntime??en,s=Qe(e,n.serverPath,n.tempRoot??Un()),i=!1,u=(l,d)=>{if(i)throw new Error("Durable Rust semantic session was already disposed.");return Vn(s,n.serverPath,n.semanticWorkerPath,l,d,t,n.mailboxLimits)};return{requestSemantic(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"semantic",identityKey:R.key,workerEnvironment:Ye(),request:{...o,referenceRetryTimeoutMs:zn(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,l.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},requestImportDefinitions(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"import-definitions",identityKey:R.key,workerEnvironment:Ye(),request:{...o,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},shutdown(){i=!0}}}function Kn(e){for(let n of Object.keys(process.env))Ze(n)&&delete process.env[n];for(let[n,t]of Object.entries(e))t!==null&&(process.env[n]=t)}function zn(e,n){return n!==void 0?n:e===void 0?Fn:void 0}function Vn(e,n,t,r,s,i,u={}){let l=i.now(),d=l+s,R=(i.monotonicNow??w)(),c=R+s,o=q("rust-semantic-v3",r),a=U(o),f=ke(e),m=F(e),y=xe(f,{mailboxVersion:k,protocolVersion:b,id:a,operationKey:o,clientId:i.randomId(),enqueuedAtMs:l,deadlineAtMs:d,sessionIdentity:m,request:r},{nowMs:l,limits:u});for(Ve(e,n,t,c,i);(i.monotonicNow??w)()<=c;){if(He(y.responsePath)){let D=Yn(x(y.responsePath,{maxBytes:u.maxItemBytes??E,inputKind:"durable Rust semantic mailbox response"}),{requestId:a,operationKey:o,sessionIdentity:m,deadlineAtMs:y.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:i.now()});if(!D.ok)throw new Error(D.error);return C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:(i.monotonicNow??w)()-R,ok:!0,session:D.session,kind:r.kind}),D.response}let h=K(e);(!h||!j(h,i.now(),i.isProcessAlive,i.readProcessIdentity))&&Ve(e,n,t,c,i),i.sleep($e)}throw new Error(`Durable Rust semantic session timed out after ${(s/1e3).toFixed(0)}s.`)}function Ve(e,n,t,r,s){let i=K(e);if(i&&j(i,s.now(),s.isProcessAlive,s.readProcessIdentity))return;On(_(e,"server.json"),{force:!0}),s.spawnServer(n,e,t);let u=s.monotonicNow??w,l=Math.min(r,u()+Wn);for(;u()<=l;){let d=K(e);if(d&&j(d,s.now(),s.isProcessAlive,s.readProcessIdentity))return;s.sleep($e)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function K(e){try{let n=JSON.parse(x(_(e,"server.json"),{maxBytes:ce,inputKind:"durable Rust session state"}));if(typeof n.protocolVersion!="number"||n.sessionIdentity!==void 0&&(typeof n.sessionIdentity!="string"||n.sessionIdentity!==F(e))||typeof n.pid!="number"||typeof n.heartbeatAtMs!="number"||n.busyUntilMs!==void 0&&typeof n.busyUntilMs!="number"||n.mailbox!==void 0&&!Hn(n.mailbox))return null;let t=n.processIdentity===void 0?null:fe(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{protocolVersion:n.protocolVersion,...n.sessionIdentity===void 0?{}:{sessionIdentity:n.sessionIdentity},pid:n.pid,...t?{processIdentity:t}:{},heartbeatAtMs:n.heartbeatAtMs,...n.busyUntilMs===void 0?{}:{busyUntilMs:n.busyUntilMs},...n.mailbox===void 0?{}:{mailbox:n.mailbox}}}catch{return null}}function Yn(e,n){try{return ne(JSON.parse(e),n)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function Hn(e){if(!e||typeof e!="object")return!1;let n=e;return p(n.pending)&&p(n.inflight)&&p(n.responses)&&p(n.deadLetters)&&p(n.invalid)&&p(n.totalItems)&&typeof n.totalBytes=="number"&&Number.isFinite(n.totalBytes)&&n.totalBytes>=0&&(n.oldestPendingAt===void 0||Number.isFinite(Date.parse(n.oldestPendingAt)))}function Ye(){return Object.fromEntries(Object.entries(process.env).filter(([e])=>Ze(e)).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,n??null]))}function Ge(e){return e==="HOME"||e==="PATH"||e.startsWith("CARGO_")||e.startsWith("RA_")||e.startsWith("RUST")}function Ze(e){return Ge(e)||e.startsWith("SCIP_RUST_")||e==="SCIP_QUERY_PROFILE"||e==="SCIP_QUERY_PROFILE_CACHE_STATE"||e==="SCIP_QUERY_PROFILE_COMMAND"||e==="SCIP_QUERY_PROFILE_OUT"||e==="SCIP_QUERY_PROFILE_RUN_ID"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND"||e==="SCIP_QUERY_PROFILE_MIN_MS"}var en={canonicalProjectRoot(e){try{return Nn(e)}catch{return _(e)}},projectFingerprint(e){return Fe(e)},engineIdentity:re,fileFingerprint(e){return $(e,{maxBytes:E,inputKind:"Rust semantic engine artifact"})},environment(){return Je(process.env)}},$n={now:Date.now,monotonicNow:w,randomId:Bn,isProcessAlive:be,readProcessIdentity:me,spawnServer(e,n,t){if(!He(e))throw new Error(`Durable Rust semantic session helper was not found at ${e}. Run npm run build first.`);Tn(process.execPath,[e,n,t],{detached:!0,stdio:"ignore"}).unref()},sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)}};function se(e){return Pn("sha256").update(e).digest("hex")}import{existsSync as Qn,mkdtempSync as nn,rmSync as oe}from"fs";import{tmpdir as tn}from"os";import{join as ae}from"path";import{fileURLToPath as H,pathToFileURL as Jn}from"url";import{SHARE_ENV as Xn,Worker as Gn}from"worker_threads";function z(e,n,t=new Set){let r=new Map;for(let s of e)t.has(s.symbolId)||r.set(s.symbolId,n.get(s.symbolId)??[]);return r}function ie(e,n,t){let r=W(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let s=Math.max(1,Math.ceil(e/Math.max(1,t)));return Math.max(12e4,3e4+s*n)}var rn=15e3,sn=8,an=5e3,Zn=64,et=96,le=class{constructor(n,t,r={}){this.projectRoot=n;this.status=t;this.opts=r;this.requester=r.requester??it(n,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),references:N(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!0});return{...P(r),resolvedBinary:t.resolvedBinary,references:z(n,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:N(n)}}}calleesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),callees:O(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!0});return{...P(r),resolvedBinary:t.resolvedBinary,callees:ue(n,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:O(n)}}}referencesAndCalleesForDefinitions(n,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),references:N(n),callees:O(t)};let s=[...n,...t];try{let i=this.requestSession(r.resolvedBinary,s,{includeReferences:n.length>0,includeCallees:t.length>0,referenceDefinitions:n,calleeDefinitions:t});return{...P(i),resolvedBinary:r.resolvedBinary,references:z(n,new Map(i.references),new Set(i.incompleteReferenceSymbolIds??[])),callees:ue(t,new Map(i.callees??[]))}}catch(i){return this.fallbackReferencesAndCallees(r,n,t,i)}}signaturesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),signatures:on(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...P(r),resolvedBinary:t.resolvedBinary,signatures:ct(n,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:on(n)}}}importDefinitionsForFile(n,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),sourcePaths:new Map(t.map(s=>[s.id,null]))};try{let s=this.requestImportDefinitions(r.resolvedBinary,n,t);return{...P(s),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(s.sourcePaths)}}catch(s){return{available:!1,resolvedBinary:r.resolvedBinary,reason:s instanceof Error?s.message:String(s),sourcePaths:new Map(t.map(i=>[i.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=Y(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),u=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),l=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),d=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,R=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,c=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,o=nt(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),a={projectRoot:this.projectRoot,rustAnalyzerBinary:n,definitions:[...t],...d?{referenceDefinitions:d}:{},...R?{calleeDefinitions:R}:{},...c?{signatureDefinitions:c}:{},requestTimeoutMs:s,...r.includeReferences!==!1&&i>0?{referenceRetryTimeoutMs:i}:{},diagnosticsTimeoutMs:l,settleDelayMs:o,concurrency:u,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},f=dt(a);return X("rust.semantic.session.request",()=>this.requester.requestSemantic(a,ie(f,pt(s,a.referenceRetryTimeoutMs),u)),()=>({definitions:t.length,operationDefinitions:f,referenceDefinitions:a.referenceDefinitions?.length,calleeDefinitions:a.calleeDefinitions?.length,signatureDefinitions:a.signatureDefinitions?.length,references:a.includeReferences!==!1,callees:a.includeCallees===!0,signatures:a.includeSignatures===!0,referenceRetryTimeoutMs:a.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(n,t,r,s){let i=t.length===0?{available:!0,resolvedBinary:n.resolvedBinary,references:N(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),u=r.length===0?{available:!0,resolvedBinary:n.resolvedBinary,callees:O(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(i&&u){let l={resolvedBinary:i.resolvedBinary??u.resolvedBinary??n.resolvedBinary,references:z(t,i.references),callees:ue(r,u.callees)};return i.available&&u.available?{available:!0,...l}:{available:!1,reason:(i.available?void 0:i.reason)??(u.available?void 0:u.reason)??"Rust semantic fallback was unavailable.",...l}}return{available:!1,resolvedBinary:n.resolvedBinary,reason:s instanceof Error?s.message:String(s),references:N(t),callees:O(r)}}requestImportDefinitions(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),u=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Y(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,an),d={projectRoot:this.projectRoot,rustAnalyzerBinary:n,file:t,positions:[...r],requestTimeoutMs:s,diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:i};return X("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(d,ie(r.length,s,i)),()=>({file:t,positions:r.length}))}};function P(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function B(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function mr(e,n,t={}){return new le(e,n,t)}function nt(e,n){let t=ln(e);if(t!==null)return t;let r=n.includeReferences!==!1;return r&&n.includeCallees!==!0&&n.includeSignatures!==!0&&n.definitionCount<=Zn||r&&n.includeCallees===!0&&n.includeSignatures!==!0&&n.definitionCount<=et?0:an}function tt(e){let n=e?.trim().toLowerCase(),t=n==="0"||n==="false"||n==="off"||n==="worker",r=n==="1"||n==="true"||n==="on"||n==="durable",s=n===void 0||n==="";return{transport:t||!s&&!r?"worker":"durable",source:s?"default":"environment",fallback:"worker",valid:s||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function rt(e){return tt(e).transport}function st(e,n){let t=null,r=!1,s=!1,i=!1,u=()=>t??=n(),l=()=>{s||(e.shutdown(),s=!0)},d=(c,o,a)=>{let f=lt(c);r=!0;try{l()}catch{}C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:a,ok:!1,kind:o,session:"worker-fallback",reason:f})},R=(c,o,a)=>{if(i)throw new Error("Rust semantic failover session was already disposed.");if(r)return a(u());let f=performance.now();try{return o(e)}catch(m){d(m,c,performance.now()-f)}return a(u())};return{requestSemantic(c,o){return R("semantic",a=>a.requestSemantic(c,o),a=>a.requestSemantic(c,o))},requestImportDefinitions(c,o){return R("import-definitions",a=>a.requestImportDefinitions(c,o),a=>a.requestImportDefinitions(c,o))},shutdown(){if(i)return;i=!0;let c=[];try{l()}catch(o){c.push(o)}try{t?.shutdown()}catch(o){c.push(o)}if(c.length>0)throw c[0]}}}function it(e,n,t={worker:()=>ot(),durable:()=>Xe(e,{serverPath:H(ft()),semanticWorkerPath:H(un())})}){return rt(n)==="durable"?st(t.durable(),t.worker):t.worker()}function ot(e={}){let n=null,t=null,r=1,s=!1,i=null,u=null,l=o=>{o&&oe(o,{recursive:!0,force:!0})},d=()=>{if(i)return;let o=n,a=t;n=null,t=null;let f=o?o.terminate():Promise.resolve(0);i=Promise.allSettled([f,we(a,{gracefulMs:1e3,forceMs:1e3})]).then(([m,y])=>{let D=(y.status==="fulfilled"?y.value:[{reaped:!1,detail:String(y.reason)}]).filter(g=>!g.reaped);if(m.status==="rejected"||D.length>0){u=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${a??"unknown"}.`);return}l(a)}).finally(()=>{i=null})},R=()=>{if(n)return n;if(i)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(u)throw u;let o=e.semanticWorkerPath?Jn(e.semanticWorkerPath):un();if(!Qn(H(o)))throw new Error(`Rust semantic session worker was not found at ${H(o)}. Run npm run build before using built semantic Rust queries.`);return t=nn(ae(tn(),"scip-query-rust-session-")),n=new Gn(o,e.shareEnvironment?{env:Xn}:void 0),n.unref(),n},c=()=>{let o=t??nn(ae(tn(),"scip-query-rust-session-"));return t=o,ae(o,`${r++}.json`)};return{requestSemantic(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"semantic",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=at(x(m,{maxBytes:E,inputKind:"Rust semantic worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},requestImportDefinitions(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"import-definitions",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic import-definition session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=ut(x(m,{maxBytes:E,inputKind:"Rust import-definition worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},shutdown(){if(s)return;if(s=!0,!n){l(t),t=null;return}let o=c(),a=new SharedArrayBuffer(4),f=new Int32Array(a);n.postMessage({kind:"shutdown",responsePath:o,sharedBuffer:a}),Atomics.wait(f,0,0,5e3),d()}}}function at(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function ut(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function lt(e){let n=e instanceof Error?`${e.name} ${e.message}`.toLowerCase():String(e).toLowerCase();return n.includes("readiness")?"readiness":n.includes("timeout")||n.includes("timed out")?"timeout":n.includes("helper")?"helper":"request"}function N(e){return new Map(e.map(n=>[n.symbolId,[]]))}function O(e){return new Map(e.map(n=>[n.symbolId,[]]))}function on(e){return new Map(e.map(n=>[n.symbolId,null]))}function ue(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??[]]))}function ct(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function dt(e){let n=0;return e.includeReferences!==!1&&(n+=(e.referenceDefinitions??e.definitions).length),e.includeCallees===!0&&(n+=(e.calleeDefinitions??e.definitions).length),e.includeSignatures===!0&&(n+=(e.signatureDefinitions??e.definitions).length),Math.max(1,n)}function pt(e,n){return n&&n>0?Math.max(e,n):e}function un(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function ft(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function V(e,n){return W(e)??n}function Y(e,n){return ln(e)??n}function ln(e){if(!e)return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}export{kt as a,xt as b,Ue as c,Tt as d,b as e,F as f,pn as g,je as h,z as i,ie as j,mr as k,nt as l,ot as m,pt as n};
|
|
2
|
-
//# sourceMappingURL=chunk-CT5SI2I4.js.map
|
package/dist/chunk-D5EKVZPI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as v,b as j}from"./chunk-QDCCHMVZ.js";import{a as M}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-35IW3P4H.js";import{b as q}from"./chunk-7COHFNJK.js";import{t as I}from"./chunk-5IZTXSOL.js";import{w as x}from"./chunk-I3U2FN2T.js";import{a as U}from"./chunk-AA7K3XLM.js";var T=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,D=new Map;function V(e,r,t,o){if(!r?.testPaths?.length)return[];let c=k(r),s=[];for(let i of L(e,r.testPaths)){let a=z(e,i,o),l=a?t(a):null;if(l)for(let g of x(e,i)){let C=g.sourcePath;if(!C)continue;let d=t(C);d&&d!==l&&(c.get(l)?.has(d)||s.push({testFile:i,ownerBoundary:l,importedFile:C,importedBoundary:d,reason:"outside-owner-policy"}))}}return H(s)}function k(e){let r=e.allowedDependencies??{},t=e.boundaries.map(i=>i.name),o=new Map,c=(i,a)=>{for(let l of r[i]??[])a.has(l)||(a.add(l),c(l,a))};for(let i of t){let a=new Set;c(i,a),o.set(i,a)}let s=new Map;for(let i of t){let a=new Set(o.get(i));for(let l of t)l!==i&&o.get(l)?.has(i)&&a.add(l);s.set(i,a)}return s}function L(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=D.get(t);if(o)return o;let c=new Set;for(let i of r)for(let a of j(e.config.projectRoot,i))T.test(a)&&c.add(a);let s=[...c].sort();return D.set(t,s),s}function z(e,r,t){let o=r.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(o!==r&&t(o))return o;let c=r.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=x(e,r).map(i=>i.sourcePath).filter(i=>!!i&&t(i)&&i.split("/").pop()===c);return s.length===1?s[0]:null}function H(e){let r=new Map;for(let t of e){let o=`${t.testFile}\0${t.importedBoundary}`;r.has(o)||r.set(o,t)}return[...r.values()].sort((t,o)=>t.testFile.localeCompare(o.testFile)||t.importedBoundary.localeCompare(o.importedBoundary))}function O(e,r){let t=(e?.boundaries??[]).filter(o=>o.paths.some(c=>v(c,r)));return t.length===1?t[0].name:null}var b="architecture:";function G(e,r,t,o={}){let c=K(e,r);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let s=new Map,i=new Map(t.boundaries.map(n=>[n.name,new Set])),a=[],l=[];for(let n of c){let f=t.boundaries.filter(p=>p.paths.some(F=>v(F,n))).map(p=>p.name).sort();if(f.length===0)a.push(n);else if(f.length>1)l.push({file:n,boundaries:f});else{let p=f[0];s.set(n,p),i.get(p).add(n)}}let g=new Map;for(let[n,f]of e){let p=s.get(n);if(p)for(let F of f){let R=s.get(F);if(!R||p===R)continue;let $=w(p,R),B=g.get($);B||(B={from:p,to:R,fileEdges:[],importers:new Set,importedFiles:new Set},g.set($,B)),B.fileEdges.push({fromFile:n,toFile:F}),B.importers.add(n),B.importedFiles.add(F)}}let C=[...g.values()].map(n=>N(n,t)).sort(te),d=C,E=new Map(d.map(n=>[w(n.from,n.to),n])),S=new Map(t.boundaries.map(n=>[n.name,new Set]));for(let n of d)S.get(n.from).add(n.to);let m=[];for(let n of d){if(n.from>=n.to)continue;let f=E.get(w(n.to,n.from));f&&m.push({boundaries:[n.from,n.to],forward:n,reverse:f})}let{components:A}=M(S),y=A.filter(n=>n.length>1).map(n=>J(n,d,t.requireAcyclic===!0)).sort((n,f)=>f.boundaries.length-n.boundaries.length||n.boundaries.join("/").localeCompare(f.boundaries.join("/"))),h=t.allowedDependencies??{},u=t.boundaries.map(n=>n.name).filter(n=>!Object.hasOwn(h,n)).sort();return{configured:!0,boundaries:t.boundaries.map(n=>({name:n.name,paths:[...n.paths],fileCount:i.get(n.name).size,dependencyPolicyDeclared:Object.hasOwn(h,n.name)})).sort((n,f)=>n.name.localeCompare(f.name)),edges:C,forbiddenEdges:d.filter(n=>n.policyStatus==="forbidden"),reciprocalPairs:m,cycles:y,staleAllowances:W(t,d),boundaryLimits:Y(t,d,i),fragileEdges:d.filter(n=>n.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:Q(e,i,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,n=>t.boundaries.find(f=>f.name===n)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-u.length,totalBoundaries:t.boundaries.length,missingRows:u,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function ge(e,r={}){let t=q(e,r.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),o=U(e,{includeIgnored:!1}).filter(s=>!r.scope||s.includes(r.scope)),c=new Set(o);return G(t,o,e.config.architecture,{isModuleHierarchyFile:s=>_(e,s),testBoundaryViolations:V(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function _(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:I(e,r).length===0}function ye(e){let r=e.forbiddenEdges.map(o=>`${b}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${b}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${b}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${b}ambiguous-file:${encodeURIComponent(o.file)}:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`)}if(e.policyCoverage.requiresMinimalPolicy)for(let o of e.staleAllowances)r.push(`${b}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${b}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${b}boundary-limit:${o.kind}:${encodeURIComponent(o.boundary)}`);let t=new Map;for(let o of e.coarseBoundaries)o.violatesPolicy&&t.set(o.boundary,(t.get(o.boundary)??0)+1);for(let[o,c]of t){let s=`${b}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let i=2;i<=c;i+=1)r.push(`${s}:component:${i}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${b}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function he(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireCompleteCoverage===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(r=>r.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function K(e,r){let t=new Set(r);for(let[o,c]of e){t.add(o);for(let s of c)t.add(s)}return[...t].sort()}function N(e,r){let t=[...e.fileEdges].sort((o,c)=>o.fromFile.localeCompare(c.fromFile)||o.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:X(r,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function X(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function J(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),i=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===i),violatesPolicy:t}}function Q(e,r,t=Z,o=!1,c=()=>"directory"){let s=[];for(let[i,a]of r){let l=c(i)==="file"?m=>m:ee,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let C=new Set(g),d=new Map,E=new Map;for(let m of g)E.set(l(m),new Set);for(let m of g)for(let A of e.get(m)??[]){if(!C.has(A))continue;let y=l(m),h=l(A);if(y===h)continue;let u=w(y,h),n=d.get(u);n||(n={from:y,to:h,fileEdges:[]},d.set(u,n)),n.fileEdges.push({fromFile:m,toFile:A}),E.get(y).add(h)}let{components:S}=M(E);for(let m of S){if(m.length<2)continue;let A=new Set(m),y=[...d.values()].filter(u=>A.has(u.from)&&A.has(u.to)).map(u=>({from:u.from,to:u.to,fileEdgeCount:u.fileEdges.length,examples:u.fileEdges.slice(0,5)})).sort((u,n)=>u.from.localeCompare(n.from)||u.to.localeCompare(n.to)),h=Math.min(...y.map(u=>u.fileEdgeCount));s.push({boundary:i,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:y,narrowestEdges:y.filter(u=>u.fileEdgeCount===h)})}}return s.sort((i,a)=>a.subUnits.length-i.subUnits.length||i.boundary.localeCompare(a.boundary))}function W(e,r){let t=new Set(r.map(i=>w(i.from,i.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(i=>i.name)),s=[];for(let[i,a]of Object.entries(o))if(c.has(i))for(let l of a)!c.has(l)||t.has(w(i,l))||s.push({from:i,to:l});return s.sort((i,a)=>i.from.localeCompare(a.from)||i.to.localeCompare(a.to))}function Y(e,r,t){let o=[],c=new Map;for(let s of r)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&o.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let i=s.maxFiles??e.maxBoundaryFiles;if(i!==void 0){let a=t.get(s.name)?.size??0;a>i&&o.push({boundary:s.name,kind:"files",observed:a,limit:i})}}return o.sort((s,i)=>s.boundary.localeCompare(i.boundary)||s.kind.localeCompare(i.kind))}function Z(e){let r=P(e);return r==="test"||r==="entry"}function ee(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function w(e,r){return`${e}\0${r}`}function te(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{b as a,G as b,ge as c,ye as d,he as e,Q as f};
|
|
2
|
-
//# sourceMappingURL=chunk-D5EKVZPI.js.map
|
package/dist/chunk-DMQ7ZKJG.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{h as k,i as A}from"./chunk-7HU2IJ2T.js";import{v as L}from"./chunk-MO226P4Q.js";var x=[];function _(e){e.groups.length>0&&x.push(e)}function ke(e,t){let n=new Set(t.groups);for(let i of x)i.groups.some(r=>n.has(r))&&(t.file!==void 0&&i.clearFile?i.clearFile(e,t.file):i.clearAll(e))}function M(){let e=new WeakMap;return{cache:e,ensure(t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}}}function E(e,t){let{cache:n,ensure:i}=M(),r={get(a,s,o){let c=i(a);if(c.has(s))return c.get(s);let d=o();return c.set(s,d),d},invalidate(a,s){n.get(a)?.delete(s)},invalidateAll(a){n.delete(a)},size(a){return n.get(a)?.size??0}};return _({name:e,groups:t.clearGroups,clearAll:a=>r.invalidateAll(a),clearFile:(a,s)=>r.invalidate(a,s)}),r}function Me(e,t){let n=new WeakMap,i={get(r,a){let s=n.get(r);if(s)return s.value;let o=a();return n.set(r,{value:o}),o},invalidate(r){n.delete(r)},has(r){return n.has(r)}};return _({name:e,groups:t.clearGroups,clearAll:r=>i.invalidate(r)}),i}var se={clearGroups:["whole-project","source-file"]};function je(e){return oe(e,se)}function oe(e,t){let{cache:n,ensure:i}=M(),r={get(a,s,o,c){let d=i(a),N=d.get(s);if(N&&N.source===o)return N.value;let I=c();return d.set(s,{source:o,value:I}),I},invalidate(a,s){n.get(a)?.delete(s)},invalidateAll(a){n.delete(a)}};return _({name:e,groups:t.clearGroups,clearAll:a=>r.invalidateAll(a),clearFile:(a,s)=>r.invalidate(a,s)}),r}import{createHash as ce}from"crypto";import{existsSync as He,mkdirSync as de}from"fs";import{dirname as j,join as le}from"path";import V from"better-sqlite3";var pe="evidence.db";var ue=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],P=new Set(ue);var $e=512*1024*1024,fe=6e4,T=new WeakMap,ge=E("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Ee=E("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",v="version NOT LIKE 'evidence-%'";function K(e){return ce("sha256").update(e).digest("hex")}function Ge(e,t,n){return ge.get(e,t,()=>K(n))}function U(e){return Ee.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=L(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,i=[...n.indexedLanguages??[]].sort();return K(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:i,status:n.status}))}catch(t){return h("project fingerprint unavailable",t),null}})}function h(e,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function u(e){if(T.has(e))return T.get(e)??null;let t=null;try{let n=new V(le(j(e.config.dbPath),pe));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
-
kind TEXT NOT NULL,
|
|
12
|
-
cache_key TEXT NOT NULL,
|
|
13
|
-
project_fingerprint TEXT NOT NULL,
|
|
14
|
-
version TEXT NOT NULL,
|
|
15
|
-
payload TEXT NOT NULL,
|
|
16
|
-
PRIMARY KEY (kind, cache_key)
|
|
17
|
-
);
|
|
18
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
-
relative_path TEXT NOT NULL,
|
|
20
|
-
symbol TEXT NOT NULL,
|
|
21
|
-
content_hash TEXT NOT NULL,
|
|
22
|
-
deps_digest TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
-
relative_path TEXT NOT NULL,
|
|
29
|
-
symbol TEXT NOT NULL,
|
|
30
|
-
project_fingerprint TEXT NOT NULL,
|
|
31
|
-
version TEXT NOT NULL,
|
|
32
|
-
payload TEXT NOT NULL,
|
|
33
|
-
PRIMARY KEY (relative_path, symbol)
|
|
34
|
-
);
|
|
35
|
-
`),t={evidence:n,shared:ve(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
|
|
36
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${v}
|
|
37
|
-
ORDER BY version DESC
|
|
38
|
-
LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
|
|
39
|
-
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${v}
|
|
40
|
-
ORDER BY version DESC
|
|
41
|
-
LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
42
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
43
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${v}
|
|
44
|
-
ORDER BY version DESC
|
|
45
|
-
LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
46
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
47
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${v}
|
|
48
|
-
ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
49
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
50
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
51
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${v}
|
|
52
|
-
ORDER BY version DESC
|
|
53
|
-
LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
54
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
55
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND ${v}
|
|
56
|
-
ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
57
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){h("disabled (open failed)",n)}return T.set(e,t),t}function f(e,t,n){h(`disabled (${t})`,n),T.set(e,null)}function ve(e){if(!e)return null;try{de(j(e),{recursive:!0});let t=new V(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
|
|
58
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
59
|
-
kind TEXT NOT NULL,
|
|
60
|
-
relative_path TEXT NOT NULL,
|
|
61
|
-
content_hash TEXT NOT NULL,
|
|
62
|
-
version TEXT NOT NULL,
|
|
63
|
-
payload TEXT NOT NULL,
|
|
64
|
-
last_accessed_at INTEGER NOT NULL,
|
|
65
|
-
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
66
|
-
);
|
|
67
|
-
CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
68
|
-
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
|
|
69
|
-
`),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
70
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
71
|
-
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
72
|
-
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
|
|
73
|
-
SET last_accessed_at = ?
|
|
74
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
|
|
75
|
-
AND last_accessed_at < ?`)}}catch(t){return h("shared cache disabled (open failed)",t),null}}function b(e,t,n){h(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function H(e,t,n,i){let r=u(e);if(!r)return null;try{let a=r.readFileEvidence.get(t,n,i,p)??r.readLegacyFileEvidence.get(t,n,i);if(a?.payload!==void 0)return a.payload;if(!P.has(t)||!r.shared)return null;try{let s=r.shared.readFileEvidence.get(t,n,i,p);return s?.payload!==void 0&&he(r.shared,t,n,i),s?.payload??null}catch(s){return b(r,"file_evidence read",s),null}}catch(a){return f(e,"file_evidence read",a),null}}function he(e,t,n,i){let r=Date.now();try{e.touchFileEvidence.run(r,t,n,i,p,r-fe)}catch(a){h("shared file_evidence recency touch skipped",a)}}function W(e,t,n,i,r){let a=u(e);if(a)try{if(a.writeFileEvidence.run(t,n,i,p,r),P.has(t)&&a.shared)try{a.shared.writeFileEvidence.run(t,n,i,p,r,Date.now())}catch(s){b(a,"file_evidence write",s)}}catch(s){f(e,"file_evidence write",s)}}function X(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{for(let r of t)n.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();let i=t.filter(r=>P.has(r.kind));if(i.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let r of i)n.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){b(n,"file_evidence batch write",r)}}catch(i){f(e,"file_evidence batch write",i)}}function B(e,t,n,i){let r=u(e);if(!r)return null;try{return(r.readProjectEvidence.get(t,n,i,p)??r.readLegacyProjectEvidence.get(t,n,i))?.payload??null}catch(a){return f(e,"project_evidence read",a),null}}function Y(e,t,n,i,r){let a=u(e);if(a)try{a.writeProjectEvidence.run(t,n,i,p,r)}catch(s){f(e,"project_evidence write",s)}}function ze(e,t,n,i){let r=u(e);if(!r)return new Map;try{let a=r.readCalleesForFile.all(t,n,i,p),s=r.readLegacyCalleesForFile.all(t,n,i);return $([...s,...a])}catch(a){return f(e,"semantic_callees bulk read",a),new Map}}function Qe(e,t,n){let i=u(e);if(!i)return new Map;try{let r=i.readReferencesForFile.all(t,n,p),a=i.readLegacyReferencesForFile.all(t,n);return $([...a,...r])}catch(r){return f(e,"semantic_references bulk read",r),new Map}}function $(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function Je(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),n.dropStaleCallees.run(r.relativePath,r.contentHash)),n.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(i){f(e,"semantic_callees write",i)}}function qe(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.projectFingerprint}`;i.has(a)||(i.add(a),n.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),n.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(i){f(e,"semantic_references write",i)}}function et(e){return typeof e=="object"&&e!==null}function tt(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}import{appendFileSync as ye,mkdirSync as me}from"fs";import{createHash as _e,randomUUID as Te}from"crypto";import{dirname as Se}from"path";import{performance as y}from"perf_hooks";var J="SCIP_QUERY_PROFILE",q="SCIP_QUERY_PROFILE_OUT",Z="SCIP_QUERY_PROFILE_COMMAND",ee="SCIP_QUERY_PROFILE_CACHE_STATE",R="SCIP_QUERY_PROFILE_RUN_ID",w="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",O="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",te=[J,q,Z,ee,R,w,O],ot=new Set(te),G=new Set,z=new Map,Q=!1;function g(){let e=process.env[J];return e==="1"||e==="true"}function De(){return process.env[q]}function ne(){return process.env[Z]}function Ce(){return process.env[ee]}function re(){let e=process.env[R];if(e)return e;if(!g())return;let t=Te();return process.env[R]=t,t}function ie(){return process.env[w]}function Ne(e){let t=ie();if(t)return t;if(!g())return;let n=re();if(!n)return;let i=e.projectFingerprint?"published-project":"run-only",r=m(["profile-workload-v1",e.toolVersion,e.command,e.projectFingerprint??n]);return process.env[w]=r,process.env[O]=i,r}function m(e){return _e("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function ct(){return Object.fromEntries(te.flatMap(e=>{let t=process.env[e];return t===void 0?[]:[[e,t]]}))}function F(e,t,n){if(!g())return t();let i=y.now();try{let r=t();return S({type:"span",name:e,durationMs:Math.round(y.now()-i),ok:!0,...D(n)??{}}),r}catch(r){throw S({type:"span",name:e,durationMs:Math.round(y.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...D(n)??{}}),r}}async function dt(e,t,n){if(!g())return t();let i=y.now();try{let r=await t();return S({type:"span",name:e,durationMs:Math.round(y.now()-i),ok:!0,...D(n)??{}}),r}catch(r){throw S({type:"span",name:e,durationMs:Math.round(y.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...D(n)??{}}),r}}function S(e,t=De()){let n=Pe(e),i={timestamp:new Date().toISOString(),pid:process.pid,runId:re(),command:ne(),cacheState:Ce(),...n,...e},r=`${JSON.stringify(i)}
|
|
76
|
-
`;if(t)try{let a=Se(t);G.has(a)||(me(a,{recursive:!0}),G.add(a)),ye(t,r);return}catch(a){Q||(Q=!0,process.stderr.write(`[profile] failed to write ${t}: ${a instanceof Error?a.message:String(a)}
|
|
77
|
-
`));return}g()&&process.stderr.write(r)}function Pe(e){let t=ie()??Ne({command:ne()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!t)return{};let n=process.env[O],i=typeof e.name=="string"?e.name:void 0;if(!i)return{workloadIdentity:t,workloadIdentityKind:n};let r=i.split(/[.:]/,1)[0]??i,a=`${t}\0${i}`,s=z.get(a);return s||(s=m(["profile-subsystem-v1",t,i]),z.set(a,s)),{workloadIdentity:t,workloadIdentityKind:n,subsystem:r,subsystemWorkIdentity:s}}function D(e){return typeof e=="function"?e():e}var be=[l("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),l("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),l("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),l("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),l("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),l("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),l("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),l("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),l("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),l("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),l("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),l("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),C("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),C("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),C("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),C("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Et(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(g()){let c=U(n);if(c){let d=`${c}\0${i}\0${r}`;o=t.get(d),o||(o=m(["evidence-product-file-read-v1",e.kind,c,i,r]),t.set(d,o))}}return F("evidence-product.file.read",()=>{let c=H(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let d=e.deserialize(c);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){W(n,e.kind,i,r,e.serialize(a))},writeBatch(n,i){X(n,i.map(r=>({kind:e.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:e.serialize(r.value)})))}}}function vt(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(g()){let c=`${r}\0${i}`;o=t.get(c),o||(o=m(["evidence-product-project-read-v1",e.kind,r,i]),t.set(c,o))}return F("evidence-product.project.read",()=>{let c=B(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let d=e.deserialize(c);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){Y(n,e.kind,i,r,e.serialize(a))}}}function ht(e){let t=be.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function l(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function C(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var Re=E("source-text",{clearGroups:["whole-project","source-file"]}),we=E("source-lines",{clearGroups:["whole-project","source-file"]});function Oe(e,t){let n=t.replace(/\\/g,"/");return Re.get(e,n,()=>{try{return k(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(i){if(A(i))return"";throw i}})}function Tt(e){if(e.length===0)return[];let t=e.split(`
|
|
78
|
-
`);return e.endsWith(`
|
|
79
|
-
`)&&t.pop(),t}function Fe(e,t){let n=t.replace(/\\/g,"/");return we.get(e,n,()=>{let i=Oe(e,n);return i?i.split(`
|
|
80
|
-
`):[]})}var Ie=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Le(e){let t=Ie.exec(e);return t?t[1]??"":null}function St(e,t,n){return ae(e,t,n).length>0}function Dt(e,t,n,i){let r=i.toLowerCase();return ae(e,t,n).some(a=>a.toLowerCase()===r)}function ae(e,t,n){if(n<=0)return[];let i=Fe(e,t);if(i.length===0)return[];let r=[];for(let a=n-1;a>=0&&a>=n-5;a-=1){let s=(i[a]??"").trim();if(s==="")continue;let o=Le(s);if(o!==null){r.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return r}return r}export{_ as a,ke as b,E as c,Me as d,je as e,oe as f,K as g,Ge as h,U as i,ze as j,Qe as k,Je as l,qe as m,et as n,tt as o,g as p,ct as q,F as r,dt as s,S as t,Et as u,vt as v,ht as w,Oe as x,Tt as y,Fe as z,Le as A,St as B,Dt as C};
|
|
81
|
-
//# sourceMappingURL=chunk-DMQ7ZKJG.js.map
|
package/dist/chunk-ELNRLMC5.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
function m(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT
|
|
2
|
-
m.symbol_id,
|
|
3
|
-
d.relative_path,
|
|
4
|
-
COUNT(*) AS ref_count
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents d ON c.document_id = d.id
|
|
8
|
-
WHERE m.role != 1
|
|
9
|
-
${t}
|
|
10
|
-
${n.pathExclusionsFor("d")}
|
|
11
|
-
GROUP BY m.symbol_id, d.relative_path`,...e??[])})}function c(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
12
|
-
FROM mentions m
|
|
13
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
-
JOIN documents d ON c.document_id = d.id
|
|
15
|
-
WHERE m.role != 1
|
|
16
|
-
${t}
|
|
17
|
-
${n.pathExclusionsFor("d")}`,...e??[])}).filter(e=>e.symbol_id!==null)}function l(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id
|
|
18
|
-
FROM mentions m
|
|
19
|
-
WHERE m.role != 1
|
|
20
|
-
${t}`,...e??[])}).filter(e=>e.symbol_id!==null)}function u(n,o){return i(n,o,e=>{let t=e?`AND m.symbol_id IN (${e.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
21
|
-
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
22
|
-
FROM mentions m
|
|
23
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
24
|
-
JOIN documents d ON c.document_id = d.id
|
|
25
|
-
WHERE m.role != 1
|
|
26
|
-
${t}
|
|
27
|
-
${n.pathExclusionsFor("d")}
|
|
28
|
-
ORDER BY d.relative_path, c.start_line`,...e??[])})}function i(n,o,e){if(!o)return e();if(o.length===0)return[];let t=[];for(let r=0;r<o.length;r+=750)t.push(...e(o.slice(r,r+750)));return t}export{m as a,c as b,l as c,u as d};
|
|
29
|
-
//# sourceMappingURL=chunk-ELNRLMC5.js.map
|