scip-query 0.22.0 → 0.24.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 +500 -0
- package/README.md +13 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-H3P6BR5G.js +2 -0
- package/dist/call-graph-VTG2CUOQ.js +2 -0
- package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
- package/dist/chunk-2BMSSRBH.js +2 -0
- package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
- package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
- package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
- package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
- package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
- package/dist/chunk-2VAHDDLM.js +133 -0
- package/dist/chunk-2XWIUW5Z.js +455 -0
- package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
- package/dist/chunk-3D4BOXW6.js +20 -0
- package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
- package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
- package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
- package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
- package/dist/chunk-4FR6GQIT.js +2 -0
- package/dist/chunk-4KBTHJLP.js +2 -0
- package/dist/chunk-5BIKR67W.js +2 -0
- package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
- package/dist/chunk-5V7EPTII.js +2 -0
- package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
- package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
- package/dist/chunk-6D4F5VWG.js +10 -0
- package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
- package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
- package/dist/chunk-6MFXCMZC.js +2 -0
- package/dist/chunk-6O7FACKB.js +2 -0
- package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
- package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
- package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
- package/dist/chunk-7F45LJKI.js +2 -0
- package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
- package/dist/chunk-7H6VHWWJ.js +2 -0
- package/dist/chunk-7HXT6YLU.js +5 -0
- package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
- package/dist/chunk-7RIRIADH.js +7 -0
- package/dist/chunk-7ZLWLOGT.js +2 -0
- package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
- package/dist/chunk-AADQLOQ4.js +38 -0
- package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
- package/dist/chunk-ANLNLY66.js +2 -0
- package/dist/chunk-ATXPTSEI.js +81 -0
- package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
- package/dist/chunk-B3PYOSCX.js +2 -0
- package/dist/chunk-B7MPDEAK.js +3 -0
- package/dist/chunk-BBB5FBX4.js +2 -0
- package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
- package/dist/chunk-BJWFVAA5.js +2 -0
- package/dist/chunk-BKVWUP7Y.js +2 -0
- package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
- package/dist/chunk-BL6DCHQP.js +2 -0
- package/dist/chunk-BOW7SSQH.js +43 -0
- package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
- package/dist/chunk-C7C6AKAT.js +117 -0
- package/dist/chunk-CD6M6LS2.js +16 -0
- package/dist/chunk-CFE6PSG6.js +2 -0
- package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
- package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
- package/dist/chunk-CZW5MZ5B.js +2 -0
- package/dist/chunk-DBBZ63ZX.js +2 -0
- package/dist/chunk-DBN7DMJB.js +18 -0
- package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
- package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
- package/dist/chunk-DZOIKCTM.js +3 -0
- package/dist/chunk-E4PKTOL3.js +2 -0
- package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
- package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
- package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
- package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
- package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
- package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
- package/dist/chunk-EPX6NQN6.js +4 -0
- package/dist/chunk-ETC674NS.js +5 -0
- package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
- package/dist/chunk-FH3DGXC6.js +2 -0
- package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
- package/dist/chunk-FJF6VO2P.js +2 -0
- package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
- package/dist/chunk-FVFDOIM3.js +2 -0
- package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
- package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
- package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
- package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
- package/dist/chunk-GG45PK4S.js +4 -0
- package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
- package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
- package/dist/chunk-GTZZVLKJ.js +2 -0
- package/dist/chunk-GXXW5ZHH.js +2 -0
- package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
- package/dist/chunk-HEZWBAZY.js +2 -0
- package/dist/chunk-HMEWLMML.js +2 -0
- package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
- package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
- package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
- package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
- package/dist/chunk-IKQVBVQL.js +40 -0
- package/dist/chunk-J6GLBBRK.js +4 -0
- package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
- package/dist/chunk-JCSAZ35V.js +2 -0
- package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
- package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
- package/dist/chunk-JFMI5SGB.js +4 -0
- package/dist/chunk-JJP37RGX.js +57 -0
- package/dist/chunk-JZ2A7LDM.js +5 -0
- package/dist/chunk-KNLQGXVH.js +80 -0
- package/dist/chunk-KVQCECPR.js +2 -0
- package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
- package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
- package/dist/chunk-L6XHYJPZ.js +21 -0
- package/dist/chunk-L7KTFEAV.js +43 -0
- package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
- package/dist/chunk-LEECKFCJ.js +2 -0
- package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
- package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
- package/dist/chunk-MOKUWRHO.js +3 -0
- package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
- package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
- package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
- package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
- package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
- package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
- package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
- package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
- package/dist/chunk-NJQISBL4.js +8 -0
- package/dist/chunk-NJT3ZEKY.js +16 -0
- package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
- package/dist/chunk-NODFZ6ED.js +2 -0
- package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
- package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
- package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
- package/dist/chunk-NWLVNU66.js +557 -0
- package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
- package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
- package/dist/chunk-ODPDP7A4.js +3 -0
- package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
- package/dist/chunk-OIAPEKMT.js +3 -0
- package/dist/chunk-OIOC5EHF.js +3 -0
- package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
- package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
- package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
- package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
- package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
- package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
- package/dist/chunk-PXTRBKRK.js +3 -0
- package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
- package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
- package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
- package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
- package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
- package/dist/chunk-QXCKQTKR.js +60 -0
- package/dist/chunk-RBAD4GJ2.js +13 -0
- package/dist/chunk-RMDPFPNW.js +2 -0
- package/dist/chunk-ROPJDEJZ.js +4 -0
- package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
- package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
- package/dist/chunk-SCPMZ73U.js +2 -0
- package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
- package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
- package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
- package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
- package/dist/chunk-SYVJEEUJ.js +3 -0
- package/dist/chunk-T3CZAZSI.js +8 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
- package/dist/chunk-T6HRIROJ.js +7 -0
- package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
- package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
- package/dist/chunk-TULNMD5T.js +368 -0
- package/dist/chunk-U2FPY5XA.js +3 -0
- package/dist/chunk-U3SXIMII.js +38 -0
- package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
- package/dist/chunk-UH3XSKS5.js +9 -0
- package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
- package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
- package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
- package/dist/chunk-VBKUWB6N.js +2 -0
- package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
- package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
- package/dist/chunk-VDSDOEWF.js +2 -0
- package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
- package/dist/chunk-WDSFQDPN.js +2 -0
- package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
- package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
- package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
- package/dist/chunk-WYPL7GF7.js +2 -0
- package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
- package/dist/chunk-X6OGVFIT.js +2 -0
- package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
- package/dist/chunk-Y5DFAW5W.js +4 -0
- package/dist/chunk-YSYPDRD5.js +3 -0
- package/dist/chunk-ZFVPWH62.js +5 -0
- package/dist/chunk-ZGIHTH27.js +2 -0
- package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
- package/dist/chunk-ZHG4WAHR.js +12 -0
- package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
- package/dist/chunk-ZLMXIQLC.js +21 -0
- package/dist/chunk-ZMCQIHI4.js +2 -0
- package/dist/cli-main.js +2 -2
- package/dist/code-TAVIKWJI.js +2 -0
- package/dist/code-result-json-5FEFQCAQ.js +2 -0
- package/dist/command-descriptors-7BKH53Y3.js +343 -0
- package/dist/dataflow-GFBTVDH3.js +2 -0
- package/dist/dependence-slice-GWGQCODG.js +2 -0
- package/dist/deps-4QHVDPYA.js +2 -0
- package/dist/direct-navigation-4UBC6HNW.js +3 -0
- package/dist/entry-map-QCTF4RVY.js +2 -0
- package/dist/files-M2UBF5HJ.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
- package/dist/hierarchy-2UIHRLW4.js +2 -0
- package/dist/imports-WIE3YZOB.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/members-YKD636DA.js +2 -0
- package/dist/methods-VDF4IMYG.js +2 -0
- package/dist/output-continuation-command-4UMDOOLO.js +3 -0
- package/dist/output-pagination-2GME6OPY.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-XEQTRCV5.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -0
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +9 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +28 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +50 -23
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +4 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +7 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +22 -6
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +16 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +3 -3
- package/dist/refs-JNK5CLM7.js +2 -0
- package/dist/refs-pagination-6BLRYGMV.js +2 -0
- package/dist/reindex-worker.js +25 -25
- package/dist/reindex.d.ts +3 -2
- package/dist/reindex.js +35 -35
- package/dist/runtime.d.ts +34 -2
- 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-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
- package/dist/slice-PHPVNCWX.js +2 -0
- package/dist/surface-MQX5MPIV.js +2 -0
- package/dist/symbol-resolution-DBLVXLBC.js +2 -0
- package/dist/system-JOPKV4OG.js +2 -0
- package/dist/trace-I2P2YFH4.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-JJVMF7NP.js +2 -0
- package/dist/watch-server.js +3 -3
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/DETECTOR_GUIDE.md +51 -12
- package/docs/accuracy-audit-checklist.md +36 -13
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +2 -2
- package/skills/conductor/SKILL.md +110 -0
- package/skills/conductor/agents/openai.yaml +4 -0
- package/skills/principal-maintainability-review/SKILL.md +273 -0
- package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
- package/skills/scip-calibrate/SKILL.md +102 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-claim-audit/SKILL.md +113 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-probe-reachability/SKILL.md +93 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-root-cause/SKILL.md +160 -0
- package/skills/scip-root-cause/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/SKILL.md +252 -0
- package/skills/scip-system-compression/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/references/compression-atlas.md +116 -0
- package/skills/scip-system-compression/references/compression-patterns.md +87 -0
- package/skills/scip-twin-drift/SKILL.md +109 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/dist/by-kind-4IYG2SKW.js +0 -2
- package/dist/call-graph-WQNXMNNN.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-2BTJALUS.js +0 -454
- package/dist/chunk-3QXC54FQ.js +0 -3
- package/dist/chunk-3TJY6M3B.js +0 -7
- package/dist/chunk-42W3LFUK.js +0 -13
- package/dist/chunk-4GAQ6FI4.js +0 -43
- package/dist/chunk-6NC3YSPY.js +0 -38
- package/dist/chunk-6VEFRPTD.js +0 -5
- package/dist/chunk-7C26EKLZ.js +0 -4
- package/dist/chunk-7JYHQAH2.js +0 -22
- package/dist/chunk-7KSO2OAP.js +0 -2
- package/dist/chunk-7XZGZBSQ.js +0 -2
- package/dist/chunk-A77SCPW2.js +0 -3
- package/dist/chunk-AK3PYTIK.js +0 -5
- package/dist/chunk-AMIMMNA4.js +0 -11
- package/dist/chunk-AUY5BL74.js +0 -2
- package/dist/chunk-BDHFVH2M.js +0 -18
- package/dist/chunk-BECZLYNU.js +0 -8
- package/dist/chunk-BUTEIZKP.js +0 -10
- package/dist/chunk-BWVQP3LB.js +0 -38
- package/dist/chunk-BYDAFMSR.js +0 -57
- package/dist/chunk-BZYSGZRK.js +0 -2
- package/dist/chunk-C7IJMOFP.js +0 -134
- package/dist/chunk-CBBHFNLX.js +0 -2
- package/dist/chunk-D2MVJSP4.js +0 -21
- package/dist/chunk-D35XIZGN.js +0 -2
- package/dist/chunk-DKM723YF.js +0 -79
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-E44IVWIJ.js +0 -367
- package/dist/chunk-EDMB6SSO.js +0 -7
- package/dist/chunk-EETGXQY7.js +0 -3
- package/dist/chunk-FKGQOTKD.js +0 -2
- package/dist/chunk-GH5YSGZL.js +0 -5
- package/dist/chunk-GQIDEID3.js +0 -2
- package/dist/chunk-HCVJR2V4.js +0 -3
- package/dist/chunk-IMKZEXZG.js +0 -2
- package/dist/chunk-ISIQLPJ2.js +0 -61
- package/dist/chunk-IXESDH3J.js +0 -2
- package/dist/chunk-JJ62MTQH.js +0 -40
- package/dist/chunk-JT6XX7QY.js +0 -8
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-LRI5OMPE.js +0 -2
- package/dist/chunk-MHIEP7EG.js +0 -4
- package/dist/chunk-NK3JMP22.js +0 -2
- package/dist/chunk-NVSZNESQ.js +0 -2
- package/dist/chunk-OJNK5ALA.js +0 -2
- package/dist/chunk-OXYAWIEA.js +0 -2
- package/dist/chunk-OZETODHH.js +0 -2
- package/dist/chunk-PBUH2P5S.js +0 -3
- package/dist/chunk-PLJUQFQN.js +0 -2
- package/dist/chunk-PLYUVM4F.js +0 -2
- package/dist/chunk-PXXYQK55.js +0 -2
- package/dist/chunk-Q5TA4OY4.js +0 -20
- package/dist/chunk-Q7GBK5T7.js +0 -81
- package/dist/chunk-QLBSG7U5.js +0 -3
- package/dist/chunk-QWKHW6VZ.js +0 -2
- package/dist/chunk-RPL3ARU7.js +0 -16
- package/dist/chunk-SVHTMVA4.js +0 -4
- package/dist/chunk-T6QD2ZQB.js +0 -43
- package/dist/chunk-TD7VKJ2Y.js +0 -117
- package/dist/chunk-TKDNDQA7.js +0 -3
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TUSPIVZ3.js +0 -4
- package/dist/chunk-URSGGIZX.js +0 -2
- package/dist/chunk-UT7TADJX.js +0 -2
- package/dist/chunk-V4NG5OMS.js +0 -554
- package/dist/chunk-VTCIYFEK.js +0 -2
- package/dist/chunk-VU6LIWHT.js +0 -2
- package/dist/chunk-VUSKPCUB.js +0 -2
- package/dist/chunk-WN3TCGJ4.js +0 -2
- package/dist/chunk-WSLEJSFR.js +0 -2
- package/dist/chunk-WYZIHUPZ.js +0 -16
- package/dist/chunk-XE33FV5W.js +0 -2
- package/dist/chunk-XGGBK66W.js +0 -4
- package/dist/chunk-XSWYJCAK.js +0 -2
- package/dist/chunk-Y334QQU5.js +0 -3
- package/dist/chunk-Z2AWCTN6.js +0 -2
- package/dist/chunk-ZOXKSQQB.js +0 -2
- package/dist/chunk-ZPASRBLF.js +0 -2
- package/dist/chunk-ZZ3Z7D56.js +0 -2
- package/dist/code-EQJFDT6I.js +0 -2
- package/dist/code-result-json-7UWIWBOO.js +0 -2
- package/dist/command-descriptors-ORNTVNYV.js +0 -342
- package/dist/dataflow-6VL54GX5.js +0 -2
- package/dist/dependence-slice-DT2NUHD2.js +0 -2
- package/dist/deps-DB7H5IKC.js +0 -2
- package/dist/direct-navigation-O3LUAYWQ.js +0 -3
- package/dist/entry-map-6K62RV3D.js +0 -2
- package/dist/files-MSLD7MO6.js +0 -2
- package/dist/hierarchy-IVBXAKFA.js +0 -2
- package/dist/imports-FRAVZ3Y2.js +0 -2
- package/dist/members-KJOJDYGO.js +0 -2
- package/dist/methods-2AYABBT3.js +0 -2
- package/dist/output-continuation-command-JHMPH6NC.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-HYO4WD7Z.js +0 -3
- package/dist/refs-ARMA6XUJ.js +0 -2
- package/dist/refs-pagination-VUGIWN6U.js +0 -2
- package/dist/slice-YOB5YFAM.js +0 -2
- package/dist/surface-VY5EFWTW.js +0 -2
- package/dist/symbol-resolution-DGQN4XIV.js +0 -2
- package/dist/system-2KQ3QD2P.js +0 -2
- package/dist/trace-HTIPTXAE.js +0 -2
- package/dist/value-flow-5FV3VQI7.js +0 -2
package/dist/chunk-EDMB6SSO.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as U,b as j}from"./chunk-JHH5SCZ3.js";import{a as I}from"./chunk-K3XFWJI2.js";import{b as K}from"./chunk-57N6LN2A.js";import{b as z,e as N,i as b}from"./chunk-H5EXS3HM.js";import{d as X}from"./chunk-SB25YMEQ.js";import{d as A,e as w,f as F,h as G}from"./chunk-AK3PYTIK.js";var V=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as ee,statSync as Te}from"fs";import{dirname as ie,join as ae}from"path";import{appendFileSync as ge,existsSync as fe,mkdirSync as me,renameSync as pe,rmSync as ye,statSync as Re,truncateSync as be}from"fs";import{basename as xe,dirname as Be}from"path";var L=".previous",he=".rotation.lock",ve=2e3,J=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},M=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},q=Object.freeze({monotonicNow:X,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=K(e,{kind:"rotating-jsonl",detail:{target:xe(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){me(e,{recursive:!0})},exists:fe,readBytes(e){return F(e,{maxBytes:A,inputKind:"rotating JSONL segment"})},size(e){return Re(e).size},truncate:be,remove(e){ye(e,{force:!0})},rename:pe,append:ge});function Y(e,t,n){let r=n.runtime??q,a=JSON.stringify(t);if(a===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let s=Buffer.from(`${a}
|
|
2
|
-
`),i=Math.max(1,Math.floor(n.maxSegmentBytes),s.length);return Z(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(Be(e));let c=Ae(e,A,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??L}`,u=!1,g=!1;return r.exists(e)&&r.size(e)+s.length>i&&(r.exists(o)&&(r.remove(o),g=!0),n.onPhase?.("previous-pruned"),r.rename(e,o),u=!0,n.onPhase?.("current-rotated")),r.append(e,s),n.onPhase?.("record-appended"),{lineBytes:s.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:u,prunedPrevious:g}})}function H(e,t={}){let n=t.runtime??q,r=Le(t.maxSegmentBytes);return Z(e,t.lockTimeoutMs,n,()=>{let a=[],s=0,i=`${e}${t.previousSuffix??L}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=Se(Q(c,r,n));a.push(...o.lines),s+=o.partialTailBytes}return{lines:a,ignoredPartialTailBytes:s}})}function Z(e,t,n,r){let a=`${e}${he}`,s=Math.max(0,t??ve),i=n.monotonicNow()+s,c;for(;;){let m=n.tryAcquireLock(a,e);if(m.kind==="acquired"){c=m.lock;break}let R=i-n.monotonicNow();if(R<=0)throw new J(a,s);n.wait(Math.min(5,R))}let o=!1,u,g;try{g=r()}catch(m){o=!0,u=m}let l=!1;try{l=c.release()}catch(m){if(!o)throw m}if(o)throw u;if(!l)throw new M(a);return g}function Ae(e,t,n){if(!n.exists(e))return 0;let r=Q(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let a=r.lastIndexOf(10),s=a<0?0:a+1;return n.truncate(e,s),r.length-s}function Le(e){let t=e??A;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function Q(e,t,n){let r=n.size(e);if(r>t)throw new w("rotating JSONL segment",e,"too-large",r,t);let a=n.readBytes(e),s=n.size(e);if(s!==r||a.byteLength!==r)throw new w("rotating JSONL segment",e,"changed-during-read",s,t);return a}function Se(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
3
|
-
`).filter(a=>a.length>0),partialTailBytes:e.length-n}}var Oe="reindex-activity.jsonl",S=L,ke=1024*1024,Pe=1440*60*1e3,te=e=>G(e,"reindex activity segment");function T(e){return ae(ie(e),Oe)}function se(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:C(e.indexPath))+C(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let a=r.producedOutputBytes??r.outputBytes;a!==null&&(n+=a)}return n}function Ee(e){let t=se(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function st(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=se(t);return D(T(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:Ee(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:Ce(t)})}function ot(e,t){return D(T(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function ut(e,t,n=new Date){return D(T(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function _e(e,t,n=ke,r){Y(e,t,{maxSegmentBytes:n,previousSuffix:S,...r?{runtime:r}:{}})}function we(e,t=new Date,n=Pe,r=te){let a=t.getTime(),s=a-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(s).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{}},c=T(e),o=[];if(r===te){if(!ee(c)&&!ee(`${c}${S}`))return i;try{let u=H(c,{previousSuffix:S});o=u.lines,i.ignoredPartialTailBytes=u.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let u=0;for(let g of[`${c}${S}`,c])try{o.push(...Ue(r(g))),u+=1}catch{i.readErrors+=1}u===0?i.confidence="unavailable":i.readErrors>0&&(i.confidence="partial")}for(let u of o){i.recordsRead+=1;let g=Ne(u);if(!g){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:l}=g,m=Date.parse(l.recordedAt);if(m<s||m>a){i.skippedRecords+=1;continue}if(i.invalidLanguageDetails=(i.invalidLanguageDetails??0)+g.invalidLanguageDetails,i.byTrigger[l.trigger.kind]=(i.byTrigger[l.trigger.kind]??0)+1,l.event==="suppressed"){i.suppressed+=1;continue}i.runs+=1,i[l.result]+=1,i.estimatedLogicalOutputBytes+=l.estimatedLogicalOutputBytes;let R=Ie(l);i.estimatedWriteBytes=(i.estimatedWriteBytes??0)+R,i.reflinkedBytes=(i.reflinkedBytes??0)+(l.reflinkedBytes??0),i.fallbackCopiedBytes=(i.fallbackCopiedBytes??0)+(l.fallbackCopiedBytes??0),l.result!=="failed"&&(g.hasLanguageDetails?i.attributedRuns=(i.attributedRuns??0)+1:i.unattributedRuns=(i.unattributedRuns??0)+1);for(let[x,p]of oe(l.byLanguage)){let y=(i.byLanguage??={})[x]??=Fe();y.runs+=1,y[p.result]+=1,y.producedOutputBytes+=p.producedOutputBytes,y.durationMs+=p.durationMs}ne(l)&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=l.recordedAt),ne(l)&&(i.fullRebuilds=(i.fullRebuilds??0)+1),R>0&&i.oldestWriteAt===void 0&&(i.oldestWriteAt=l.recordedAt)}return i.ignoredPartialTailBytes>0&&i.confidence!=="unavailable"&&(i.confidence="partial"),i.languageAttribution=Ge(i),i}function D(e,t){try{return _e(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Ne(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!z(n.recordedAt)||!n.trigger||!Me(n.trigger.kind))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(n.event!=="run"||n.result!=="rebuilt"&&n.result!=="reused"&&n.result!=="failed"||!b(n.durationMs)||!b(n.estimatedLogicalOutputBytes)||n.estimatedWriteBytes!==void 0&&!b(n.estimatedWriteBytes)||n.reflinkedBytes!==void 0&&!b(n.reflinkedBytes)||n.fallbackCopiedBytes!==void 0&&!b(n.fallbackCopiedBytes)||n.incrementalWrittenBytes!==void 0&&!b(n.incrementalWrittenBytes))return null;let r=n,{byLanguage:a,...s}=r,i=De(a);return{record:{...s,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function Ie(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function dt(e,t,n=new Date){return t.enabled?Je(we(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function Je(e,t,n){let r=e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,a=e.fullRebuilds??e.rebuilt,s={rebuilt:a,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...s,detail:`reindex activity evidence is ${e.confidence}`}:a>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:re(e.oldestRebuildAt,t.windowMs,n),...s,detail:`${a}/${t.maxRebuilds} expensive full rebuild slots consumed`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:re(e.oldestWriteAt,t.windowMs,n),...s,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed`}:{state:"allowed",...s}:{state:"allowed",...s}}function ne(e){if(e.result!=="rebuilt")return!1;let t=oe(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function re(e,t,n){let r=e?Date.parse(e):Number.NaN;return Number.isFinite(r)&&r+t>n?r+t:n+t}function Me(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function C(e){try{return Te(e).size}catch{return 0}}function Ce(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(u=>u.language===n),a=r.find(u=>u.id===n),s=e.reused||(a?a.reused:r.length>0&&r.every(u=>u.reused)),i=C(ae(ie(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:a?.outputBytes??i,o=s?0:a?.durationMs??r.filter(u=>!u.reused).reduce((u,g)=>u+g.durationMs,0);t[n]={result:s?"reused":"rebuilt",strategy:s?"reused":a?.strategy??"full",...a?.strategy==="full"&&(a.fallbackReason??a.missReason)?{fallbackReason:a.fallbackReason??a.missReason}:{},outputBytes:c,producedOutputBytes:s?0:a?.producedOutputBytes??c,durationMs:o}}return t}function De(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[a,s]of Object.entries(e)){if(!$e(a)||!We(s)){n+=1;continue}t[a]=s}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function We(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&N(t.outputBytes)&&N(t.producedOutputBytes)&&b(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function $e(e){return I.includes(e)}function oe(e){return e?I.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function Fe(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function Ge(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function Ue(e){return e.endsWith(`
|
|
4
|
-
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
5
|
-
`)+1))),e.split(`
|
|
6
|
-
`).filter(t=>t.length>0)}function ct(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function gt(e){if(!(!e||Buffer.byteLength(e)>65536))try{return je(JSON.parse(e))}catch{return}}function je(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(t.version!==1||t.baseGeneration!==null&&typeof t.baseGeneration!="string"||typeof t.complete!="boolean"||!Array.isArray(t.entries)||t.entries.length>1024||t.incompleteReason!==void 0&&typeof t.incompleteReason!="string")return;let n=[],r=new Set;for(let a of t.entries){if(!a||typeof a!="object"||Array.isArray(a))return;let s=a;if(typeof s.path!="string"||!ze(s.path)||s.kind!=="add"&&s.kind!=="change"&&s.kind!=="delete"||r.has(s.path))return;r.add(s.path),n.push({path:s.path,kind:s.kind})}if(!(t.complete&&t.incompleteReason!==void 0)&&!(!t.complete&&(!t.incompleteReason||t.incompleteReason.trim()==="")))return{version:1,baseGeneration:t.baseGeneration,complete:t.complete,...t.incompleteReason===void 0?{}:{incompleteReason:t.incompleteReason},entries:n}}function ze(e){return!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:\//.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}import{spawn as Xe}from"child_process";import{platform as ue}from"os";import{performance as de}from"perf_hooks";var bt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},v=class extends Error{constructor(n,r,a,s={}){super(a,s.cause===void 0?void 0:{cause:s.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=s.timedOut??!1,this.reaped=s.reaped??!1,this.stdout=s.stdout??"",this.stderr=s.stderr??"",this.stdoutTruncated=s.stdoutTruncated??!1,this.stderrTruncated=s.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function h(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function le(e,t,n,r){let a=Math.max(0,r-n);a>0&&e.push(t.subarray(0,a))}function ce(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function xt(e){h(e.timeoutMs,"timeoutMs"),h(e.maxStdoutBytes,"maxStdoutBytes"),h(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;h(t,"terminationGraceMs");let n=e.terminationForceMs??t;return h(n,"terminationForceMs"),new Promise((r,a)=>{let s=de.now(),i=ue()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=ue()!=="win32"&&!i,o;try{o=Xe(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:c?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(d){let f=d instanceof Error?d.message:String(d);a(new v("spawn",e.label,`${e.label} could not start: ${f}`,{cause:d,reaped:!0}));return}let u=[],g=[],l=0,m=0,R=!1,x=!1,p=null,y=!1,W=o.pid===void 0?null:U(o.pid,c),O=()=>{clearTimeout($),e.signal?.removeEventListener("abort",P)},k=d=>{if(y||!p)return;y=!0,O();let f=Buffer.concat(u).toString("utf8"),E=Buffer.concat(g).toString("utf8"),_=d.reaped||!d.detail?"":` Process-tree cleanup failed: ${d.detail}`;a(new v(p.kind,e.label,`${p.message}${_}`,{timedOut:p.timedOut,reaped:d.reaped,stdout:f,stderr:E,stdoutTruncated:R,stderrTruncated:x}))},B=d=>{if(!(p||y)){if(p=d,!W){k({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}j(W,{gracefulMs:t,forceMs:n}).then(k,f=>{k({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},$=setTimeout(()=>{B({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);$.unref();let P=()=>{B({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",P,{once:!0}),e.signal?.aborted&&P(),o.stdout.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?ce(u,f,e.maxStdoutBytes):le(u,f,l,e.maxStdoutBytes),l+=f.length,l>e.maxStdoutBytes&&(R=!0,e.outputLimitBehavior!=="truncate-tail"&&B({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?ce(g,f,e.maxStderrBytes):le(g,f,m,e.maxStderrBytes),m+=f.length,m>e.maxStderrBytes&&(x=!0,e.outputLimitBehavior!=="truncate-tail"&&B({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",d=>{if(!y&&!p){if(o.pid===void 0){O(),y=!0,a(new v("spawn",e.label,`${e.label} could not start: ${d.message}`,{cause:d,reaped:!0}));return}B({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${d.message}`})}}),o.on("close",(d,f)=>{if(y||p)return;y=!0,O();let E=Buffer.concat(u).toString("utf8"),_=Buffer.concat(g).toString("utf8");r({status:d,signal:f,stdout:E,stderr:_,timedOut:!1,durationMs:de.now()-s,stdoutTruncated:R,stderrTruncated:x})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{bt as a,v as b,xt as c,V as d,L as e,Y as f,Oe as g,st as h,ot as i,ut as j,we as k,dt as l,ct as m,gt as n};
|
|
7
|
-
//# sourceMappingURL=chunk-EDMB6SSO.js.map
|
package/dist/chunk-EETGXQY7.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as O,b as H,c as ce,e as le,f as U,j as fe}from"./chunk-TQZV7KV4.js";import{R as v,S as de,d as ie,e as se,f as K,m as ae}from"./chunk-C7IJMOFP.js";import{a as A}from"./chunk-YXPUP5G2.js";import{d as w,e as pe}from"./chunk-DRENNWRG.js";import{c as re}from"./chunk-IW5XQG5G.js";import{a as j,e as x}from"./chunk-HGFDYOVB.js";import{h as ne,ia as oe,na as $}from"./chunk-AK3PYTIK.js";import{existsSync as E}from"fs";import b from"path";var _=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(i,t){let e=t?b.dirname(b.join(i,t)):i,o=b.resolve(i);for(;e.startsWith(o);){for(let a of _){let s=b.join(e,a);if(E(s))return s}let r=b.dirname(e);if(r===e)break;e=r}for(let r of _){let a=b.join(i,r);if(E(a))return a}return null}function ue(i){let t=i.config.projectRoot,n=new Set(Le(t,i.config.semantic?.typescript?.tsconfigs)),e=A(i,{includeIgnored:!1,extensions:O});for(let o of e){let r=z(t,o);r&&n.add(b.resolve(r))}if(n.size===0){let o=z(t);o&&n.add(b.resolve(o))}return[...n].filter(o=>!me(t,o)).sort((o,r)=>o.localeCompare(r))}function Le(i,t=[]){let n=new Set;for(let e of t){let o=b.isAbsolute(e)?e:b.join(i,e);E(o)&&n.add(b.resolve(o))}for(let e of we(i))for(let o of _){let r=b.join(e,o);E(r)&&n.add(b.resolve(r))}if(n.size===0){let e=z(i);e&&n.add(b.resolve(e))}return[...n].filter(e=>!me(i,e)).sort((e,o)=>e.localeCompare(o))}function we(i){let t=b.join(i,"package.json");if(!E(t))return[];let n;try{n=JSON.parse(ne(t,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(o=>se(i,o))}function me(i,t){let n=b.relative(i,t).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function I(i,t,n){if(i.has(t))return i.get(t);let e=n();return i.set(t,e),e}import he from"path";import{realpathSync as ye}from"fs";function Ee(i,t){return i.getReferences().map(n=>{let e=n.getNode();return B(e,t)})}function je(i){let t=i;return typeof t.findReferences=="function"?t.findReferences():[]}function Se(i,t,n,e){let o=[];for(let r of je(i))for(let a of Ee(r,e))a.file===t.relativePath&&a.line>=t.startLine&&a.line<=t.endLine||o.push(a);for(let r of n)o.push(r);return P(o)}function be(i,t,n,e){let o=[],r=n?.getStart();for(let a of i.getReferences()){let s=a.getNode();L(e,s.getSourceFile().getFilePath())===t&&(r!==void 0&&s.getStart()===r||o.push({location:B(s,e),node:s}))}return o}function B(i,t){let n=i.getSourceFile(),e=n.getLineAndColumnAtPos(i.getStart());return{file:L(t,n.getFilePath())??n.getBaseName(),line:e.line-1,column:e.column-1}}function Me(i,t,n){let e=i.getSourceFile(),o=q(e,i),r=i.getText(),a=new RegExp(`\\b${ae(r)}\\b`,"g"),s=e.getFullText().split(`
|
|
2
|
-
`),c=[];for(let l=0;l<s.length;l++){if(l===o)continue;let f=s[l]??"";a.lastIndex=0;let p;for(;(p=a.exec(f))!==null;)c.push({file:t,line:l,column:p.index})}return P(c.filter(l=>L(n,he.join(n,l.file))===t))}function V(i){for(let t=i;t;t=t.getParent()){let n=t.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(i,t){return i.getLineAndColumnAtPos(t.getStart()).line-1}function P(i){let t=new Set,n=[];for(let e of i){let o=`${e.file}:${e.line}:${e.column}`;t.has(o)||(t.add(o),n.push(e))}return n}function L(i,t){let n=i||process.cwd(),e=ge(n,t);if(e)return e;try{return ge(ye(n),ye(t))}catch{return null}}function ge(i,t){let n=he.relative(i,t).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Ie(i,t,n,e){let o=Ae(t,e);return o.size===0?new Map:Oe(i,n,o)}function Ae(i,t){let n=new Map;for(let e of v(i,t)){let o=w(e.symbol)??e.leaf;if(!o)continue;let r=n.get(o);r||(r=[],n.set(o,r)),r.push(e)}return n}function Oe(i,t,n){let e=new Map,o=new Map;return t.forEachDescendant(r=>{for(let a of He(i,r)){let s=n.get(a);if(!s)continue;let c=q(t,r);for(let l of s){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=o.get(l.symbolId);p!==void 0&&p<=f||(o.set(l.symbolId,f),e.set(l.symbolId,r))}}}),e}function He(i,t){let n=[],e=o=>{o&&!n.includes(o)&&n.push(o)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let o=t.getNameNode();e(o?.getText())}if("getName"in t&&typeof t.getName=="function"){let o=t.getName();e(o)}return i.Node.isIdentifier(t)&&e(t.getText()),n}var Ue=re("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function Fe(i,t,n,e){let o=J(i,t),r=Y(o.get(e)??[],n);if(r)return r;let a=[];for(let s of o.values())for(let c of s)((c.leaf||w(c.symbol)||"").includes(e)||c.symbol.includes(e))&&a.push(c);return Y(a,n)}function G(i,t,n,e){return Y(J(i,t).get(e)??[],n)}function xe(i,t){let n=new Map;for(let[e,o]of J(i,t)){let r=o[0];r&&n.set(e,r)}return n}function J(i,t){return Ue.get(i,t,()=>{let n=new Map;for(let e of v(i,t)){let o=e.leaf||w(e.symbol);if(!o)continue;let r=n.get(o);r||(r=[],n.set(o,r)),r.push({...e,leaf:o})}for(let e of n.values())e.sort((o,r)=>o.startLine-r.startLine||o.endLine-r.endLine||o.symbolId-r.symbolId);return n})}function Y(i,t){let n=null,e=Number.POSITIVE_INFINITY;for(let o of i){let r=Math.abs(o.startLine-t);(r<e||r===e&&n&&o.startLine<n.startLine)&&(n=o,e=r)}return n}import Be from"path";import{realpathSync as We}from"fs";function ke(i,t){let n=new Map,e=null,o=null,r=()=>(o??=A(i,{extensions:O}),o),a=()=>(e??=x("typescript.source-file-index",()=>$e(i.config.projectRoot,t,r()),()=>({projects:t.length,indexedDocuments:r().length})),e),s=c=>H(c)?I(n,c,()=>{let l=Te(i.config.projectRoot,c);if(!l)return null;for(let{project:f,sourceFiles:p}of a()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&X(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>s(c)?.sourceFile??null,sourceFileMatch:s,indexedTypeScriptLikeDocuments:r}}function $e(i,t,n){let e=t.map(({project:o})=>{let r=new Map;for(let a of o.getSourceFiles())X(r,a);return{project:o,sourceFiles:r}});for(let o of n){let r=Te(i,o);if(r)for(let a of e){if(a.sourceFiles.has(r))break;let s=a.project.addSourceFileAtPathIfExists(r)??null;if(s){X(a.sourceFiles,s);break}}}return e}function X(i,t){let n=Q(t.getFilePath());i.set(n,t);try{i.set(Q(We(n)),t)}catch(e){if(!$(e))throw e}}function Te(i,t){try{return Q(oe(i,t,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!$(n))throw n;return null}}function Q(i){return Be.resolve(i)}function Z(i,t){for(let n of i)if(t===n.name||t.startsWith(`${n.name}/`))return n.name;return null}function De(i){let t=`${i.relativeDir}/src`;return[`${t}/index.ts`,`${t}/index.tsx`,`${t}/index.mts`,`${t}/index.cts`]}var Ke=32;function Vt(i,t){let n=x("typescript.provider.load",()=>ce());if(!n)return U("ts-morph is not installed");let e=x("typescript.provider.tsconfig-discovery",()=>ue(i));if(e.length===0)return U("no tsconfig found");try{let o=x("typescript.provider.project-bundles",()=>le(n,e),()=>({tsconfigs:e.length}));return _e(i,n,o)}catch(o){return U(o instanceof Error?o.message:String(o),e[0],e)}}function _e(i,t,n,e={}){return x("typescript.provider.construct",()=>new ee(i,t,n),()=>({tsconfigs:n.length,reusedProjects:e.reusedProjects===!0}))}var ee=class{constructor(t,n,e){this.db=t;this.tsMorph=n;this.projects=e;this.workspacePackages=ie(t.config.projectRoot),this.sourceFiles=ke(t,e)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return I(this.importUsageCache,t,()=>{let n=this.sourceFiles.sourceFile(t);if(!n)return[];let e=Ve();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,n,e),()=>({file:t,...e}))})}referencesFor(t){return I(this.referencesCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,n)})}referencesForDefinitions(t,n={}){let e=new Map,o=j(),r=[];for(let f of t){let p=this.referencesCache.get(f.symbolId);p?e.set(f.symbolId,p):r.push(f)}if(r.length===0)return e;let a=r,s=n.exact?[]:r.filter(f=>!Ce(f));if(s.length>=Ke){let f=this.referencesForDefinitionsBySymbolScan(s);for(let p of s){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}if(a=r.filter(p=>Ce(p)),a.length===0)return e}let c=new Map;for(let f of a){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Re();x("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){o&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;o&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,o?d:void 0);this.referencesCache.set(y.symbolId,u),e.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...ve(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}}return e}referenceFragmentsForFiles(t){let n=de(this.db).filter(r=>H(r.relativePath)),e=t.filter(r=>this.sourceFiles.sourceFile(r)!==null),o=this.referencesForDefinitionsBySymbolScan(n,e);return fe(n,o,e)}referencesForDefinitionsBySymbolScan(t,n){let e=j(),o=Re(),r=new Map,a=new Set(t.map(c=>c.symbolId)),s=new Map(t.map(c=>[c.symbolId,c]));for(let c of t)r.set(c.symbolId,[]);return x("typescript.references-map.inverted-scan",()=>{let c=e?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of t){let g=l.get(u.symbolId)??[];if(g.length>0){let k=r.get(u.symbolId)??[];k.push(...g),r.set(u.symbolId,k)}e&&(o.packageReferenceCount+=g.length)}e&&(o.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(t),S=new Set(t.map(u=>u.leaf).filter(Boolean)),y=e?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(e&&(o.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,a,s,d,S,f,p,r,e?o:void 0))}e&&(o.scanMs+=m.now()-y);let h=e?m.now():0;this.addHierarchyMemberReferences(t,r,e?o:void 0),e&&(o.hierarchyMs+=m.now()-h);for(let[u,g]of r){let k=P(g);r.set(u,k),e&&(o.referenceCount+=k.length)}},()=>({definitions:t.length,...ve(o)})),r}addReferencesFromSourceFileScan(t,n,e,o,r,a,s,c,l,f){let p=this.compilerCheckerForSourceFile(t),d=t.compilerNode,S=Ge(t),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!a.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;s.has(u)?g=s.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),s.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let k=I(c,u,()=>this.compilerSymbolKeys(u)),C=null,T=null,R=g&&e.has(g.symbolId)?o.get(g.symbolId):void 0;if(R&&(C=W(d,h),!Ne(R,n,C))){let N=d.getLineAndCharacterOfPosition(h.getStart(d));T={file:n,line:N.line,column:N.character};let D=l.get(R.symbolId)??[];D.push(T),l.set(R.symbolId,D),f&&(f.requestedHits+=1)}for(let N of k)for(let D of r.get(N)?.values()??[]){if(C??=W(d,h),Ne(D,n,C))continue;if(!T){let F=d.getLineAndCharacterOfPosition(h.getStart(d));T={file:n,line:F.line,column:F.character}}let M=l.get(D.symbolId)??[];M.push(T),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsForDefinitions(t){let n=new Map;for(let e of t){let o=this.nodeForDefinition(e),r=o?.compilerNode;if(!r||!this.isHierarchyMethod(r))continue;let a=r.parent;if(!this.isHierarchyContainer(a))continue;let s=this.compilerCheckerForSourceFile(o.getSourceFile()),c=s.getSymbolAtLocation(r.name);if(c)for(let l of this.hierarchyMemberSymbols(s,a,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(e.symbolId,e),n.set(f,p)}}return n}hierarchyMemberSymbols(t,n,e){let o=new Set,r=new Set,a=(s,c,l)=>{if(!r.has(s)){r.add(s),o.add(c);for(let f of l){let p=f.getProperty(e.name);p&&a(f,p,this.hierarchyAncestorTypesForType(t,f))}}};return a(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}addHierarchyMemberReferences(t,n,e){let o=new Map;for(let r of t){let a=this.nodeForDefinition(r),s=a?.compilerNode;if(!s||!this.isHierarchyMethod(s))continue;let c=s.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(a.getSourceFile()),f=l.getSymbolAtLocation(s.name);if(!f)continue;let p=s.getSourceFile(),d=p.getLineAndCharacterOfPosition(s.name.getStart(p)),S={definition:r,location:{file:r.relativePath,line:d.line,column:d.character}},y=n.get(r.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),e&&(e.hierarchyReferences+=1);n.set(r.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=o.get(u)??new Map;g.set(r.symbolId,S),o.set(u,g)}e&&(e.hierarchyDefinitions+=1)}for(let r of o.values())if(!(r.size<2)){e&&(e.hierarchyFamilies+=1);for(let{definition:a}of r.values()){let s=n.get(a.symbolId)??[];for(let c of r.values())c.definition.symbolId!==a.symbolId&&(s.push(c.location),e&&(e.hierarchyReferences+=1));n.set(a.symbolId,s)}}}hierarchyRootMemberSymbols(t,n,e){let o=new Set,r=new Set,a=(s,c,l)=>{if(r.has(s))return;r.add(s);let f=!1;for(let p of l){let d=p.getProperty(e.name);d&&(f=!0,a(p,d,this.hierarchyAncestorTypesForType(t,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))o.add(p)};return a(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}compilerSymbolKeys(t){return(t.declarations??[]).map(n=>{let e=n.getSourceFile();return`${e.fileName}\0${n.getStart(e)}\0${t.name}`})}compilerSymbolLocations(t){let n=[];for(let e of t.declarations??[]){let o=e.getSourceFile(),r=L(this.db.config.projectRoot,o.fileName);if(!r)continue;let a=e.name,s=o.getLineAndCharacterOfPosition((a??e).getStart(o));n.push({file:r,line:s.line,column:s.character})}return n}baseTypes(t,n){try{return t.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(t,n){let e=new Set(this.hierarchyAncestorTypesForType(t,t.getTypeAtLocation(n)));for(let o of n.heritageClauses??[])for(let r of o.types)e.add(t.getTypeAtLocation(r));return[...e]}hierarchyAncestorTypesForType(t,n){let e=new Set(this.baseTypes(t,n));for(let o of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(o))for(let r of o.heritageClauses??[])for(let a of r.types)e.add(t.getTypeAtLocation(a));return[...e]}isHierarchyMethod(t){return this.tsMorph.ts.isMethodDeclaration(t)||this.tsMorph.ts.isMethodSignature(t)}isHierarchyContainer(t){return this.tsMorph.ts.isClassDeclaration(t)||this.tsMorph.ts.isClassExpression(t)||this.tsMorph.ts.isInterfaceDeclaration(t)}compilerReferenceSymbol(t,n,e){e&&(e.symbolLookups+=1);let o=t.getSymbolAtLocation(n);if(o){if((o.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return o;try{return e&&(e.aliasResolutions+=1),t.getAliasedSymbol(o)}catch{return o}}}calleesFor(t){return I(this.calleesCache,t.symbolId,()=>I(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath)).get(t.symbolId)??[])}calleesForDefinitions(t){let n=new Map,e=new Map;for(let o of t){let r=e.get(o.relativePath);r?r.push(o):e.set(o.relativePath,[o])}for(let[o,r]of e){let a=this.fileCalleesCache.get(o),s=new Set(r.map(l=>l.symbolId)),c=a??this.calleeMapForFile(o,s);for(let l of r){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(t,n,e){let o=e?m.now():0,r=this.packageImportReferencesForDefinition(t);if(e&&(e.packageRefsMs+=m.now()-o,e.packageReferenceCount+=r.length),!n)return r;let a=e?m.now():0,s=Se(n,t,r,this.db.config.projectRoot);return e&&(e.semanticRefsMs+=m.now()-a,e.referenceCount+=s.length),s}signatureFor(t){return I(this.signatureCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let e=n.getType().getCallSignatures()[0];if(!e)return null;let o=e.getParameters().map(a=>{let s=a.getDeclarations()[0],c=s?a.getTypeAtLocation(s).getText(s):a.getValueDeclaration()?.getType().getText()??"unknown";return Pe(c)}),r=e.getReturnType().getText(n);return`(${o.join(",")})=>${Pe(r)}`})}importUsageForSourceFile(t,n,e){let o=[],r=new Map;for(let a of n.getImportDeclarations()){e.declarations+=1;let s=K(this.db,t,a.getModuleSpecifierValue()),c=a.getImportClause()?.isTypeOnly()??!1;for(let l of te(a)){e.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?e.bindingSymbols+=1:e.missingBindingSymbols+=1);let p={sourcePath:s,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(o.push(p),c||!l.localName||!f)continue;let d=r.get(l.localName);d?d.push(p):r.set(l.localName,[p])}}return r.size>0&&n.forEachDescendant(a=>{if(a.getKindName()!=="Identifier")return;let s=r.get(a.getText());if(!s||qe(a))return;e.scannedIdentifiers+=1;let c=a.getSymbol()?.compilerSymbol;if(e.symbolLookups+=1,!!c){for(let l of s)if(l.bindingSymbol===c){l.references.push({location:B(a,this.db.config.projectRoot),node:a}),e.matchedReferences+=1;break}}}),o.map(a=>a.typeOnlyDeclaration?ze(t,a.sourcePath,a.entry):a.entry.identifier&&!a.bindingSymbol?(e.fallbackEntries+=1,this.valueImportUsageForEntry(t,a.sourcePath,a.entry)):this.valueImportUsageFromLocations(t,a.sourcePath,a.entry,a.references))}valueImportUsageForEntry(t,n,e){let o=e.identifier?e.identifier.findReferences():[],r=[];for(let a of o)for(let s of be(a,t,e.identifier,this.db.config.projectRoot))r.push(s);return this.valueImportUsageFromLocations(t,n,e,r)}valueImportUsageFromLocations(t,n,e,o){let r=o.some(c=>!V(c.node)),a=o.some(c=>V(c.node)),s=e.isTypeOnly;return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:s,isUsed:s||o.length>0,isTypeUsed:s||a,isValueUsed:r,references:o.map(c=>c.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferencesForFiles(t){let n=new Map,e=new Set;for(let r of t){let a=this.sourceFiles.sourceFile(r);if(a)for(let s of a.getImportDeclarations()){let c=Z(this.workspacePackages,s.getModuleSpecifierValue());c&&e.add(c)}}if(e.size===0)return n;let o=this.packageExportsForNames(e);for(let r of t)this.addPackageImportReferencesForDocument(n,o,r);for(let[r,a]of n)n.set(r,P(a));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,n=this.packageExports();for(let e of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,n,e);for(let[e,o]of t)t.set(e,P(o));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,n,e){if(this.db.isIgnored(e))return;let o=this.sourceFiles.sourceFileMatch(e);if(o)for(let r of o.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,n,e,r)}addPackageImportReferencesForDeclaration(t,n,e,o){let r=Z(this.workspacePackages,o.getModuleSpecifierValue());if(!r)return;let a=n.get(r);if(a)for(let s of te(o)){if(s.kind!=="named"||!s.identifier)continue;let c=a.get(s.importedName);if(!c||c.size===0)continue;let l=Me(s.identifier,e,this.db.config.projectRoot);l.length>0&&Ze(t,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(t=>t.name))),this.packageExportIndex)}packageExportsForNames(t){let n=new Map;for(let e of this.workspacePackages){if(!t.has(e.name))continue;let o=new Map;for(let r of De(e))this.collectPackageExports(e,r,o,new Set);o.size>0&&n.set(e.name,o)}return n}collectPackageExports(t,n,e,o){if(o.has(n))return;o.add(n);let r=this.sourceFiles.sourceFile(n);if(r)for(let a of r.getExportDeclarations()){let s=a.getModuleSpecifierValue(),c=s?K(this.db,n,s):n;if(!c||!c.startsWith(`${t.relativeDir}/src/`))continue;let l=a.getNamedExports();if(l.length===0){if(a.isNamespaceExport())continue;this.collectPackageExports(t,c,e,o);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=e.get(d);y||(y=new Set,e.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(t,n){return I(this.indexedDefinitionLeafCache,t,()=>xe(this.db,t)).get(n)??null}nodeForDefinition(t){return I(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return I(this.fileDefinitionNodeCache,t,()=>{let n=this.sourceFiles.sourceFile(t);return n?Ie(this.tsMorph,this.db,n,t):new Map})}referenceDefinitionFromCompilerSymbol(t){return this.definitionFromCompilerSymbol(t,void 0,!0)}definitionFromCompilerSymbol(t,n,e=!1){let o=t.name,r=n?m.now():0,a=t.declarations??[];n&&(n.declarationsMs+=m.now()-r,n.declarationChecks+=a.length);for(let s of a){let c=n?m.now():0,l=s.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(s.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(s),y=e?G(this.db,f,p,o)??(S&&S!==o?G(this.db,f,p,S):null):Fe(this.db,f,p,o);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(t){let n=t.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(t,n){let e=j(),o=0,r=0,a=0,s=0,c=0,l=0,f=0,p=0,d=e?Xe():void 0;return x("typescript.callee-map.file",()=>{let S=e?m.now():0,y=this.sourceFiles.sourceFile(t);if(e&&(c=Math.round(m.now()-S)),!y)return new Map;let h=e?m.now():0,u=v(this.db,t).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(e&&(l=Math.round(m.now()-h)),o=u.length,u.length===0)return new Map;let g=new Map,k=e?m.now():0,C=this.compilerCheckerForSourceFile(y),T=y.compilerNode;e&&(f=Math.round(m.now()-k));let R=new Map,N=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){e&&(r+=1);let F=this.semanticCalleeForCallNode(C,T,u,M,R,n,d);F&&(e&&(a+=1),Ye(g,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,N)},D=e?m.now():0;N(T),e&&(p=Math.round(m.now()-D));for(let[M,F]of g)g.set(M,et(F));return s=g.size,g},()=>({relativePath:t,definitions:o,callNodes:r,resolvedCallees:a,outputRows:s,requestedDefinitions:n?.size??o,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?Qe(d):{}}))}semanticCalleeForCallNode(t,n,e,o,r,a,s){let c=s?m.now():0,l=Je(e,W(n,o));if(s&&(s.callerLookupMs+=m.now()-c),!l)return null;if(a&&!a.has(l.symbolId))return s&&(s.skippedUnrequestedCallers+=1),null;let f=o.expression,p=this.compilerSymbolForExpression(t,f,s),d=null;if(p)if(s&&(s.targetSymbolHits+=1),r.has(p))s&&(s.compilerSymbolCacheHits+=1),d=r.get(p)??null;else{s&&(s.compilerSymbolCacheMisses+=1);let S=s?m.now():0;d=this.definitionFromCompilerSymbol(p,s),s&&(s.targetLookupMs+=m.now()-S),r.set(p,d)}else s&&(s.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:W(n,o)}}:null}compilerSymbolForExpression(t,n,e){let o=e?m.now():0,r=t.getSymbolAtLocation(n);if(e&&(e.expressionSymbolMs+=m.now()-o),r)return r;e&&(e.typeFallbacks+=1);let a=e?m.now():0,s=t.getTypeAtLocation(n).getSymbol();return e&&(e.typeSymbolMs+=m.now()-a),s}compilerCheckerForSourceFile(t){let n=t.getProject(),e=this.compilerCheckerCache.get(n);return e||(e=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,e)),e}};function te(i){let t=[],n=i.getDefaultImport();n&&t.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let e=i.getNamespaceImport();e&&t.push({identifier:e,importedName:"*",localName:e.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let o of i.getNamedImports()){let r=o.getNameNode(),s=o.getAliasNode()??(r.getKindName()==="Identifier"?r:null);t.push({identifier:s,importedName:r.getText(),localName:s?.getText()??r.getText(),kind:"named",isTypeOnly:o.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function ze(i,t,n){return{importer:i,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ve(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function qe(i){for(let t=i;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function Ye(i,t,n){let e=i.get(t);e||(e=[],i.set(t,e)),e.push(n)}function Ge(i){let t=new Set;for(let n of i.getImportDeclarations())for(let e of te(n))e.localName&&t.add(e.localName);return t}function Je(i,t){let n=null;for(let e of i)t<e.startLine||t>e.endLine||(!n||e.startLine>=n.startLine)&&(n=e);return n}function W(i,t){return i.getLineAndCharacterOfPosition(t.getStart(i)).line}function Ne(i,t,n){return t===i.relativePath&&n>=i.startLine&&n<=i.endLine}function Ce(i){return i.symbol.includes("#")?pe(i.symbol)==="type"&&i.relativePath.endsWith(".d.ts"):!1}function Xe(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function Qe(i){return{...i,callerLookupMs:Math.round(i.callerLookupMs),expressionSymbolMs:Math.round(i.expressionSymbolMs),typeSymbolMs:Math.round(i.typeSymbolMs),targetLookupMs:Math.round(i.targetLookupMs),declarationsMs:Math.round(i.declarationsMs),declarationLocationMs:Math.round(i.declarationLocationMs),indexedLookupMs:Math.round(i.indexedLookupMs)}}function Re(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function ve(i){return{...i,scanMs:Math.round(i.scanMs),packageRefsMs:Math.round(i.packageRefsMs),semanticRefsMs:Math.round(i.semanticRefsMs),hierarchyMs:Math.round(i.hierarchyMs)}}function Ze(i,t,n){for(let e of t){let o=i.get(e)??[];o.push(...n),i.set(e,o)}}function et(i){let t=new Set,n=[];for(let e of i){let o=`${e.symbol}|${e.file}|${e.line}|${e.callsiteLine??""}`;t.has(o)||(t.add(o),n.push(e))}return n}function Pe(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ue as a,Vt as b,_e as c};
|
|
3
|
-
//# sourceMappingURL=chunk-EETGXQY7.js.map
|
package/dist/chunk-FKGQOTKD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as R}from"./chunk-T6QD2ZQB.js";import{b as T,d as b,g as z,h as _,i as O}from"./chunk-TQZV7KV4.js";import{a as A,c as N}from"./chunk-C7IJMOFP.js";import{a as G}from"./chunk-YXPUP5G2.js";import{b as k}from"./chunk-DKM723YF.js";import{d as H}from"./chunk-K3XFWJI2.js";import{d as B}from"./chunk-IW5XQG5G.js";import{e as w}from"./chunk-HGFDYOVB.js";import{m as E,o as C}from"./chunk-AK3PYTIK.js";function P(e){let t=v(e.projectFiles),n=new Set(t),c=new Map(e.snapshot.files.map(r=>[r.path,r])),s=e.snapshot.files.filter(r=>{let o=E(r.path,["typescript"]);return o==="config"||o==="ambient"}).map(r=>r.path),i=v([...t,...s]),a=i.find(r=>!c.has(r)),u=new Set(e.snapshot.files.map(r=>r.path)).size!==e.snapshot.files.length,m=!a&&i.some(r=>J(c.get(r))),f=k(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:v(e.snapshot.typescriptProjects),membership:t})),y,l;return{identityFor(r,o){if(!n.has(r))return g("target-outside-project");if(u)return g("duplicate-input-path");if(a)return g("missing-input-fingerprint");if(m)return g("unreadable-input");let d=[],p,S;if(e.graph===null)d.push("dependency-graph-unavailable"),S="whole-project",p=i;else{let h=r===y&&l?l:Y(r,e.graph);if(y=r,l=h,h.find(j=>!c.has(j)))return g("missing-input-fingerprint");if(p=v([...h,...s]),p.some(j=>J(c.get(j))))return g("unreadable-input");S="dependency-closure"}let W=p.map(h=>q(c.get(h)));return{version:1,key:k(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:o,projectIdentity:f,inputs:W})),mode:S,inputFiles:p,reasons:d}}}}function Y(e,t){let n=new Set,c=[e];for(let s=0;s<c.length;s+=1){let i=c[s];if(!(i===void 0||n.has(i))){n.add(i);for(let a of[...t.get(i)??[]].sort())n.has(a)||c.push(a)}}return[...n].sort()}function q(e){return e.semanticHash===void 0?{path:e.path,size:e.size,hash:e.hash}:{path:e.path,semanticHash:e.semanticHash}}function J(e){return e.size<0||e.hash==="unreadable"}function g(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function v(e){return[...new Set(e)].sort()}var L=B("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function D(e,t,n){let c=L.get(e,()=>$(e));if(!c)return null;let s=`${n}\0${t}`,i=c.identities.get(s);if(i)return i;let a=c.builder.identityFor(t,n);return c.identities.set(s,a),a}function F(e){return G(e,{includeIgnored:!1}).filter(T).sort()}function $(e){try{if(!e.generation.metadataRaw)return null;let t=H(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=C(t.metadata.fingerprint);return n?{builder:P({projectFiles:F(e),snapshot:n,graph:R(e),engineIdentity:b()}),identities:new Map}:null}catch{return null}}var M="typescript-reference-fragment-v2",U=128,x=A({kind:"typescript-reference-fragments",invalidation:N("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:X});function Re(e,t,n,c=e,s,i=new Set(n.keys())){let a=F(e),u=P({projectFiles:a,snapshot:t,graph:s??R(e),engineIdentity:b()}),m=[],f=0;for(let[l,r]of n){let o=u.identityFor(l,M).key;if(!o){f+=1;continue}m.push({relativePath:l,contentHash:o,value:[...r]})}let y=a.filter(l=>!i.has(l)&&!n.has(l)).length;return x.writeBatch(c,m),{affectedFiles:m.length,carriedFiles:y,skippedAffectedFiles:f}}function Te(e,t,n,c){let s=t.filter(a=>T(a.relativePath));if(s.length===0)return I("no TypeScript definitions");let i=I("shadow did not run");return w("typescript.reference-fragments.shadow",()=>{try{let a=c(s[0].relativePath);if(!a.availability().available||!a.referenceFragmentsForFiles)return i=I("TypeScript reference fragment provider is unavailable"),i;let u=F(e),m=new Set(u),f=new Map;for(let o of V(u)){let d=a.referenceFragmentsForFiles(o);if(o.some(p=>!d.has(p)))return i=I("TypeScript reference fragment provider returned an incomplete batch"),i;for(let p of o)f.set(p,d.get(p)??[])}let y=z(s,f),l=O(s,K(n,m),y);if(!l.passed)return i={state:"failing",files:u.length,keyedFiles:0,writtenFiles:0,...l},i;let r=[];for(let o of u){let d=D(e,o,M);d?.key&&r.push({relativePath:o,contentHash:d.key,value:f.get(o)??[]})}return x.writeBatch(e,r),i={state:"passing",files:u.length,keyedFiles:r.length,writtenFiles:r.length,...l},i}catch(a){return i=I(a instanceof Error?a.message:String(a)),i}},()=>({...i}))}function K(e,t){return new Map([...e].map(([n,c])=>[n,c.filter(s=>t.has(s.file))]))}function be(e,t,n){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let c="fallback",s=0,i=0,a=0,u=0;return w("typescript.reference-fragments.materialize",()=>{try{let m=F(e);s=m.length;let f=_(t),y=[];for(let r of m){let o=D(e,r,M);if(!o?.key)return null;let d=x.read(e,r,o.key);d===null?(a+=1,y.push({file:r,contentHash:o.key})):(i+=1,f.add(d))}if(a===0)return c="hit",{references:f.finish(),files:s,cacheHits:i,cacheMisses:a,computedFiles:u};let l=n(t[0].relativePath);if(!l.availability().available||!l.referenceFragmentsForFiles)return null;for(let r of V(y)){let o=r.map(({file:p})=>p),d=l.referenceFragmentsForFiles(o);if(o.some(p=>!d.has(p)))return null;x.writeBatch(e,r.map(({file:p,contentHash:S})=>({relativePath:p,contentHash:S,value:d.get(p)??[]})));for(let p of o)f.add(d.get(p)??[]);u+=r.length}return c="computed",{references:f.finish(),files:s,cacheHits:i,cacheMisses:a,computedFiles:u}}catch{return null}},()=>({state:c,files:s,cacheHits:i,cacheMisses:a,computedFiles:u}))}function V(e){let t=[];for(let n=0;n<e.length;n+=U)t.push(e.slice(n,n+U));return t}function I(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function X(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Z)?null:t}catch{return null}}function Z(e){if(!e||typeof e!="object")return!1;let t=e,n=t.location;return typeof t.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}export{D as a,Re as b,Te as c,be as d};
|
|
2
|
-
//# sourceMappingURL=chunk-FKGQOTKD.js.map
|
package/dist/chunk-GH5YSGZL.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{isAbsolute as nt,relative as Sn}from"path";var g=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function Se(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Gi(e){return e.replace(/\\/g,"/")}function Wi(e,t){return Se(e)===Se(t)}function j(e,t){let n=Sn(e,t);return n===""||!n.startsWith("..")&&!nt(n)}function w(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(nt(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=Se(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function te(e,t,n=[]){let r=xe(e);if(ut.has(r)||n.some(o=>ee(r,o))||t.some(o=>pt(r,o)))return"config";if(t.some(lt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=dt(r);return t.some(o=>(ft[o]??[]).includes(i))?"source":"other"}function ct(e,t,n){let r=xe(e);if(ut.has(r)||n?.some(o=>ee(r,o))||pt(r,t)||lt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=dt(r);return(ft[t]??[]).includes(i)}function Hi(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!it(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!it(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(be)?null:t}function rt(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function $i(e,t){return!e||!t?e===t:JSON.stringify(rt(e))===JSON.stringify(rt(t))}function Ui(e,t){let n=new Map((e?.files??[]).map(a=>[a.path,a])),r=new Map(t.files.map(a=>[a.path,a])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let a of[...i].sort()){let c=n.get(a),u=r.get(a),d=te(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:d,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:d,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:d,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(ot(e?.files??[])||ot(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(bn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!xn(e,t):!0,uncertainty:[...s].sort()}}function it(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ot(e){return new Set(e.map(t=>t.path)).size!==e.length}function be(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function bn(e){return e.hash==="unreadable"||e.size<0}function xn(e,t){return st(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&st(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function st(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((i,o)=>i===r[o])}var ut=new Set([".scipquery.json"]),Pn={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},jn={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},at=new Map;function pt(e,t){return Pn[t].some(n=>ee(e,n))||jn[t].some(n=>ee(e,n))}function ee(e,t){let n=xe(t).replace(/^\.\//,"");if(!n)return!1;let r=e.split("/").at(-1)??e,i=n.includes("/")?e:r;if(!n.includes("*")&&!n.includes("?"))return i===n;let o=at.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),at.set(n,o)}return o.test(i)}function xe(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function dt(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function lt(e){return e==="typescript"||e==="javascript"}var ft={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Ji(e){return typeof e=="string"&&e.length>0}function Vi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ki(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Cn=/^[a-f0-9]{64}$/u;function Yi(e){return typeof e=="string"&&Cn.test(e)}function Xi(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Qi(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var ht=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var Pe=2,v=3;var je=new Set(ht);function oo(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${vn(s)}`}}if(!R(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==Pe&&n!==v)return{kind:"unsupported",version:n,direction:n<Pe?"older":"future"};let r=kn(t,n);if(r)return{kind:"malformed",reason:r};let i=t,o={metadata:i,capabilities:Fn(i)};return n===Pe?{kind:"legacy",...o,metadata:i}:{kind:"supported",...o,metadata:i}}function so(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function ao(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===v?t.sqliteLayoutVersion:void 0})}function Fn(e){let t=e.fingerprint!==void 0,n=R(e.fingerprint),r=e.indexedLanguages!==void 0,i=e.status==="complete",o=e.version===v?e:null;return{usableForQuery:r,usableForEvidenceCache:t,publishableGeneration:i&&n&&r,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!o?.languageFingerprints,typescriptProjectShardReuse:!!o?.typescriptProjectShards}}function kn(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!gt(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!wn(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!Rn(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===v&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===v&&e.languageFingerprints!==void 0&&!En(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===v&&e.typescriptProjectShards!==void 0&&!In(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function co(e){return e.version===v&&e.sqliteLayoutVersion===1}function wn(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&je.has(t))?!1:new Set(e).size===e.length}function Rn(e){return Array.isArray(e)&&e.every(t=>R(t)&&typeof t.language=="string"&&je.has(t.language)&&typeof t.reason=="string")}function En(e){return R(e)&&Object.entries(e).every(([t,n])=>je.has(t)&&R(n))}function In(e){return R(e)&&Object.values(e).every(t=>R(t)&&Array.isArray(t.files)&&t.files.every(be))}function vn(e){return e instanceof Error?e.message:String(e)}import{closeSync as Ce,fstatSync as ne,openSync as Fe,readFileSync as Tn,readSync as mt}from"fs";import{createHash as On}from"crypto";var yt=8*1024*1024,St=64*1024*1024,An=512*1024*1024,Ln=256*1024*1024,E=class extends Error{constructor(n,r,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${n} ${JSON.stringify(r)} ${a}`);this.inputKind=n;this.inputPath=r;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function re(e,t){T(t.maxBytes);let n=String(e),r=Fe(e,"r");try{let i=ne(r);xt(i,t,n);let o=Tn(r),s=ne(r);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new E(t.inputKind,n,"changed-during-read",s.size,t.maxBytes);return o}finally{Ce(r)}}function ke(e,t,n="utf8"){return re(e,t).toString(n)}function z(e,t){return ke(e,{maxBytes:yt,inputKind:t})}function Dn(e,t){return ke(e,{maxBytes:St,inputKind:t})}function we(e,t){T(t.maxBytes);let n=[],r=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=mt(e,r,0,r.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new E(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);n.push(Buffer.from(r.subarray(0,o)))}return Buffer.concat(n,i)}function _n(e,t,n="utf8"){return we(e,t).toString(n)}function bt(e,t){let n=Fe(e,"r");try{return we(n,t)}finally{Ce(n)}}function Bn(e,t,n="utf8"){return bt(e,t).toString(n)}function ie(e,t,n){T(t.maxBytes);let r=String(e),i=Fe(e,"r");try{let o=ne(i);xt(o,t,r);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=mt(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;n(s.subarray(0,u)),a+=u}let c=ne(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new E(t.inputKind,r,"changed-during-read",c.size,t.maxBytes);return a}finally{Ce(i)}}function Mn(e,t){let n=On("sha256");return ie(e,t,r=>n.update(r)),n.digest("hex")}function xt(e,t,n){if(!e.isFile())throw new E(t.inputKind,n,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new E(t.inputKind,n,"too-large",Number(e.size),t.maxBytes)}function T(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{spawnSync as Gn}from"child_process";import{createHash as Wn}from"crypto";import{existsSync as zn,lstatSync as Hn,realpathSync as $n}from"fs";import{dirname as Un,isAbsolute as qn,join as Jn,relative as Co,resolve as ae,sep as Fo}from"path";var Pt=Symbol.for("scip-query.project-file-listing-context.v1"),jt=globalThis,Re=jt[Pt],O=Re&&typeof Re=="object"?Re:{};jt[Pt]=O;function Ct(e,t){let n=O.active?O.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function Ft(){return O.sequence??0}function kt(e,t,n){let r=O.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Nn(n(),(O.sequence??0)+1);if(O.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function*wt(e){let t=0;for(;t<e.taggedOutput.length;){let n=e.taggedOutput.indexOf("\0",t);if(n<0)return;yield e.taggedOutput.slice(t+2,n),t=n+1}}function Nn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var H={run(e,t){let n=Et(e,t);return n.kind==="success"?n.output:void 0},runResult:Et},Vn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],It=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],oe=/^[0-9a-f]{40,64}$/;function wo(e,t,n=H){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let r=n.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(r.kind!=="success"||!oe.test(r.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return r.output}function Ro(e,t=H){return Kn(e,t)?.context}function Kn(e,t=H){let n=t.runResult(e,Vn);if(n.kind==="success"){let i=Yn(n.output);if(i){let o=Xn(i,t);if(o)return Rt(o)}}let r=Qn(e,t);return r?Rt(r):void 0}function Rt(e){return{context:e,projectFileInventorySequence:Ft()}}function vt(e){let t=e.split("\0").filter(Boolean),n=t.find(i=>i.startsWith("# branch.oid "))?.slice(13),r=n==="(initial)"?void 0:n;if(!(r!==void 0&&!oe.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function Yn(e){let t=e.split(`
|
|
2
|
-
`).map(c=>c.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!oe.test(o)||!oe.test(s))return;let a=I(n);return{root:a,gitDir:I(se(a,r)),commonDir:I(se(a,i)),headCommit:o,treeOid:s}}function Xn(e,t){let n=t.run(e.root,It);if(n===void 0)return;let r=vt(n);return r?.headCommit!==e.headCommit?void 0:{...Tt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Ie("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function Qn(e,t){let n=Zn(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=I(se(i,o)),a=Ee(t.run(i,["rev-parse","--verify","HEAD"])),c=Ee(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,It);if(u===void 0)return;let d=vt(u);if(!(!d||d.headCommit!==a))return{...r,commonDir:s,repositoryId:Ie("repository",s),headCommit:a,treeOid:c,clean:d.clean}}function Zn(e,t=H){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=I(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=I(se(i,o));return{kind:"worktree",identity:Tt(i,s)}}function Tt(e,t){return{projectRoot:e,gitDir:t,worktreeId:Ie("worktree",`${e}\0${t}`)}}function Eo(e,t,n=H){return Ee(n.run(e,t))}function se(e,t){return qn(t)?t:ae(e,t)}function I(e){try{return $n(e)}catch{return ae(e)}}function Ie(e,t){return Wn("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function Ee(e){return e?.trim()||void 0}function Et(e,t){let n=Gn("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(n.status===0)return{kind:"success",output:n.stdout.trimEnd()};let i=(typeof n.stderr=="string"?n.stderr.trim():"")||n.error?.message||`git exited with status ${n.status??"unknown"}`,o=n.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&zn(ae(e)))&&!er(e)?{kind:"not-repository"}:{kind:"error",message:i}}function er(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ae(e);for(;;){try{return Hn(Jn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Un(t);if(n===t)return!1;t=n}}import{createRequire as rr}from"module";import{existsSync as ir,lstatSync as Do,readdirSync as or,statSync as sr}from"fs";import f from"path";import{AsyncLocalStorage as tr}from"async_hooks";var nr=new tr;function A(e,t){let n=ce(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function L(e,t){let n=ce(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Ot(e,t){return ce(e)?.fingerprints.get(t)}function D(e){return ce(e)?.paths}function ce(e){let t=nr.getStore();if(t)return t.projectRoot===I(e)?t:void 0}var ar=rr(import.meta.url),At=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),cr=18003;function Te(e,t=[]){let n=f.resolve(e),r=t.flatMap(c=>dr(n,c));if(r.length>0)return Lt(n,_t(r));let i=pr(n),o=_t(i),s=lr(n,o)?[n,...o]:o,a=s.length>0?s:[n];return Lt(n,a)}function Bt(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Mt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var ur=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function Go(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function Nt(e){return ur.test(e)}function Gt(e,t,n=[]){let r;try{r=ar("@ts-morph/common/dist/typescript.js")}catch{return null}let i=f.resolve(e),o=t==="workspace"?Te(i,n):["."],s=new Set;for(let a of o){let c=a==="."?i:f.join(i,a),u=f.join(c,"tsconfig.json"),d=mr(r,i);if(!d.fileExists(u))return null;let p=r.readConfigFile(u,d.readFile);if(p.error)return null;let l=r.parseJsonConfigFileContent(p.config,d,c);if(l.errors.some(m=>m.code!==cr))return null;for(let m of l.fileNames){let h=f.resolve(m);j(i,h)&&s.add(f.relative(i,h).split(f.sep).join("/"))}}return s}function Lt(e,t){return[...new Set(t.map(n=>$(e,n)))].sort((n,r)=>n.localeCompare(r))}function pr(e){let t=D(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>At.has(s)))return[];let o=f.join(e,...i.split("/"));return Dt(e,o)?[f.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=or(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=f.join(i,s.name);if(s.isDirectory()){!At.has(s.name)&&!s.name.startsWith(".")&&r.push(a);continue}s.isFile()&&Dt(e,a)&&n.push(f.dirname(a))}}return n}function dr(e,t){let n=t.trim();if(!n)return[];let r=f.resolve(e,n);if(!j(e,r))return[];let i=D(e);if(i){let o=$(e,r);if(i.includes(o)&&ve(f.basename(r)))return[f.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[r]:[]}try{let o=sr(r);if(o.isDirectory())return[r];if(o.isFile()&&ve(f.basename(r)))return[f.dirname(r)]}catch{return[]}return[]}function Dt(e,t){if(!ve(f.basename(t)))return!1;let n=Wt(e,t);return n?f.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function ve(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function _t(e){let t=[...new Set(e.map(n=>f.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&Sr(n,r)))}function lr(e,t){if(t.length===0||t.some(r=>f.resolve(r)===e))return!1;let n=f.join(e,"tsconfig.json");return gr(e,n)&&fr(e,n)}function fr(e,t){let r=Wt(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!f.extname(i))):!1}function Wt(e,t){try{let n=JSON.parse(hr(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function gr(e,t){let n=$(e,t),r=L(e,n);return r?r==="present":ir(t)}function hr(e,t){let n=$(e,t);if(D(e)){let i=A(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return z(t,"TypeScript project config")}function mr(e,t){let n=D(t);if(!n)return e.sys;let r=f.resolve(t),i=new Set(n),o=yr(r,n),s=e,a=c=>{let u=f.resolve(c);return j(r,u)?$(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):A(r,u)?.content.toString("utf8")},readDirectory(c,u,d,p,l){let m=f.resolve(c);return j(r,m)?s.matchFiles(m,u,d,p,e.sys.useCaseSensitiveFileNames,r,l,h=>o.get(f.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(c,u,d,p,l)}}}function yr(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),r.get(a).add(u),a=f.join(a,u),i(a)}n.get(a).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function $(e,t){let n=f.relative(e,t);return n?n.split(f.sep).join("/"):"."}function Sr(e,t){let n=f.relative(e,t);return!!n&&!n.startsWith("..")&&!f.isAbsolute(n)}import{createHash as Le}from"crypto";import{execFileSync as zt}from"child_process";import{createRequire as br}from"module";var xr=br(import.meta.url),Pr=/\.(?:[cm]?[jt]sx?)$/iu,jr=/\.[jt]sx$/iu,Ht=/(?:^|\/)package\.json$/iu,U,Oe=new Map;function $t(e,t){if(!De(e))return;let n=Cr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=jr.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Le("sha256").update(`typescript-semantic-v1\0${i}\0`),a=!1,c=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){a&&(c=!0);continue}c&&s.update("line-break\0");let d=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(d)}\0`).update(d).update("\0"),a=!0,c=!1}return s.digest("hex")}catch{return}}function De(e){return Pr.test(e)}function _e(e,t){if(Ht.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return Le("sha256").update("typescript-package-json-v1\0").update(Ae(i)).digest("hex")}catch{return}}function Be(e){return Ht.test(e)}function Uo(e,t,n){if(!Be(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(Oe.has(r))return Oe.get(r);let i;try{let o=zt("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let a=zt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Le("sha256").update(a).digest("hex")===n){i=_e(t,a);break}}}catch{i=void 0}return Oe.set(r,i),i}function Cr(){if(U!==void 0)return U;try{U=xr("typescript")}catch{U=null}return U}function Ae(e){return Array.isArray(e)?`[${e.map(Ae).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${Ae(n)}`).join(",")}}`:JSON.stringify(e)}import{createHash as Yt,randomUUID as Or}from"crypto";import{chmodSync as Xt,existsSync as _,linkSync as Ar,lstatSync as fe,readdirSync as Ge,realpathSync as C,unlinkSync as Lr,writeSync as Dr}from"fs";import{homedir as _r}from"os";import{basename as Br,dirname as ge,isAbsolute as Vt,join as y,resolve as he}from"path";import{closeSync as Fr,existsSync as kr,fsyncSync as wr,mkdirSync as Rr,openSync as Er}from"fs";import{dirname as Ut}from"path";function ue(e,t,n,r){let i=0;for(;i<t.length;){let o=n.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${r} write did not make valid forward progress`);i+=o}}function Me(e,t){if(t!=="win32")return!1;let n=e.code;return n==="EACCES"||n==="EBADF"||n==="EINVAL"||n==="EISDIR"||n==="EPERM"}var q=Object.freeze({platform:process.platform,pathExists:e=>kr(e),makeDirectory:e=>Rr(e,{recursive:!0}),openFile:(e,t,n)=>Er(e,t,n),syncFile:e=>wr(e),closeFile:e=>Fr(e)});function qt(e,t=q){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Ut(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=de(i,pe(Ut(o),t));return i}function pe(e,t=q){let n;try{n=t.openFile(e,"r")}catch(r){if(Me(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(Me(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function de(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as Ir}from"module";var vr=Ir(import.meta.url),Jt=Tr().version;function Tr(){for(let e of["../package.json","../../package.json"])try{return vr(e)}catch{}return{version:"0.0.0"}}var Qt=1,V=".scip-query-cache-owner.json",Mr=16*1024,Zt=Object.freeze({...q,randomToken:()=>Or(),linkFile:(e,t)=>Ar(e,t),removeFile:e=>Lr(e),writeFile:(e,t,n,r)=>Dr(e,t,n,r)});function le(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function F(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Nr(e,t){let n=C(e);return Wr(n,We(n,t))}function We(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?he(r):t?.dbPath?Hr(n,t.dbPath):Gr(n)}function en(){let e=process.env.XDG_CACHE_HOME;return y(e||y(_r(),".cache"),"scip-query")}function Gr(e){let t=he(e);try{t=C(t)}catch{}let n=Yt("sha256").update(t).digest("hex").slice(0,12);return y(en(),"projects",n)}function us(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(en(),"repositories",e);return rn(t),C(t)}function ps(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function ds(e,t){let n=Nr(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function Wr(e,t,n=Zt){return zr(e,t,n).cacheDir}function zr(e,t,n=Zt){let r=C(e),i=_(t)?"synced":rn(t,n),o=C(t),s=y(o,V);if(_(s))return Ne(r,o),ze(s),J(o),{kind:"existing",cacheDir:o};Kt(o),Vr(o),Kt(o);let c=`${JSON.stringify({schemaVersion:Qt,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Jt},null,2)}
|
|
3
|
-
`;try{let u=Kr(s,c,n),d=de(i,u);return{kind:"published",cacheDir:o,achievedDurability:d==="synced"?"directory-durable":"file-flushed",directorySync:d}}catch(u){if(Xr(u))return Ne(r,o),{kind:"existing",cacheDir:o};throw u}}function Ne(e,t){let n=C(e),r=C(t);return Ur(r,n,r)}function ls(e,t){return _(y(t,V))?(Ne(e,t),tn(t),!0):!1}function Hr(e,t){let n;try{n=w(t)}catch(s){throw s instanceof g?le(t,s.reason):s}let r=he(e,...n.split("/"));if(r===e||!j(e,r))throw le(t,"outside-project");let i=$r(r),o=C(i);if(!j(e,o)&&o!==e)throw le(t,"symlink-escape");return r}function $r(e){let t=e;for(;!_(t);){let n=ge(t);if(n===t)throw le(e,"no-existing-ancestor");t=n}return t}function Ur(e,t,n){let r=y(e,V);if(!_(r)||fe(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=fe(r);if(!i.isFile()||i.size>Mr)throw F(e,"invalid ownership record file");let o=z(r,"cache ownership record"),s=qr(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw F(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw F(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Yt("sha256").update(o).digest("hex"),physicalCacheDir:e}}function qr(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==Qt||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Vt(n.canonicalProjectRoot)||!Vt(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw F(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Kt(e){let t=Ge(e).filter(n=>n!==V&&!Jr(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Jr(e){return e.startsWith(`${V}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function Vr(e){for(let t of Ge(e)){let n=y(e,t);try{let r=fe(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())J(n);else if(r.isFile())ze(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(nn(r))continue;throw r}}J(e)}function tn(e,t=!1){try{let n=fe(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){ze(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");J(e);for(let r of Ge(e))tn(y(e,r),!0)}catch(n){if(t&&nn(n))return;throw n}}function nn(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rn(e,t=q){let n=qt(e,t);return J(e),n}function Kr(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,ue(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=pe(ge(e),n);return n.removeFile(r),o=!1,de(s,pe(ge(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function J(e){process.platform!=="win32"&&Xt(e,448)}function ze(e){process.platform!=="win32"&&Xt(e,384)}function Yr(e){if(_(e))return C(e);let t=C(ge(e));return y(t,Br(e))}function fs(e){return Yr(he(e))}function Xr(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as fi}from"child_process";import{isUtf8 as dn}from"buffer";import{createHash as Ve}from"crypto";import{closeSync as gn,fstatSync as K,lstatSync as Ye,openSync as hn,readdirSync as gi,readFileSync as hi,readSync as ln,readlinkSync as mi,realpathSync as X}from"fs";import{isAbsolute as yi,join as Xe,relative as Si,resolve as bi,sep as xi}from"path";import{closeSync as on,existsSync as $e,openSync as Qr,realpathSync as Zr,renameSync as ei,unlinkSync as sn,writeSync as ti}from"fs";import{dirname as ni,join as ri}from"path";var ii="fingerprint-stat-cache.json",an=1,oi=8*1024*1024,He=new Map;function Ue(e,t,n,r){let i=cn(e),o=i.files.get(t);if(!(!o||!un(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function qe(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=cn(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},a=o.files.get(t);a&&di(a,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Je(e){let t=He.get(pn(e));if(!(!t?.dirty||!t.cachePath))try{let n=ni(t.cachePath);if(!$e(n))return;li(t.cachePath,ci(t)),t.dirty=!1}catch{}}function cn(e){let t=pn(e),n=He.get(t);if(n)return n;let r=si(t),i=ai(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return He.set(t,o),o}function si(e){try{let t=We(e);return $e(t)?ri(t,ii):null}catch{return null}}function ai(e){let t=new Map;if(!e||!$e(e))return t;try{let n=JSON.parse(re(e,{inputKind:"fingerprint stat cache",maxBytes:oi}).toString("utf8"));if(!ui(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function ci(e){return{version:an,files:Object.fromEntries(e.files)}}function ui(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==an||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(pi)}function pi(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function un(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function di(e,t){return un(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function li(e,t){let n=`${e}.${process.pid}.tmp`;try{sn(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
|
|
4
|
-
`,"utf8"),i=Qr(n,"wx",384);try{ue(i,r,{writeFile:(o,s,a,c)=>ti(o,s,a,c)},"fingerprint stat cache")}catch(o){throw on(i),sn(n),o}on(i),ei(n,e)}function pn(e){return Zr(e)}var Q=64*1024*1024,Pi=1024*1024,ji=1024,B=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Ci(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function Qe(e,t,n={}){let r=w(t),i=Ct(e,()=>X(e)),o=bi(i,...r.split("/"));if(!j(i,o)||o===i)throw new g(t,"outside-project");let s=X(o);if(!j(i,s)||s===i)throw new g(t,"outside-project");let a=Ye(s);if(!a.isFile())throw new g(t,"not-a-file");let c={projectRoot:i,relativePath:r,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=n.maxBytes??Q;if(T(u),c.size>u)throw new B(n.inputKind??"project file",c.relativePath,c.size,u);return c}function Fi(e,t,n={}){let r=w(t),i=L(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let c=A(e,r);if(!c)throw new g(r,"changed-during-read");let u=n.maxBytes??Q;if(T(u),c.size>u)throw new B(n.inputKind??"project file",r,c.size,u);return Buffer.from(c.content)}let o=Qe(e,t,n),s=n.maxBytes??Q,a=hn(o.absolutePath,"r");try{let c=K(a);if(Y(c,o,t),c.size>s)throw new B(n.inputKind??"project file",o.relativePath,c.size,s);let u=hi(a),d=K(a);if(Y(d,o,t),u.byteLength!==c.size)throw new g(t,"changed-during-read");return u}finally{gn(a)}}function Ls(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=ki(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function ki(e,t,n,r={}){if(n.length===0||n.some(c=>c.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=w(t),o=L(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let c=A(e,i);if(!c)throw new g(i,"changed-during-read");let u=r.maxBytes??Q;if(T(u),c.size>u)throw new B(r.inputKind??"project file",i,c.size,u);let d=!c.content.includes(0)&&dn(c.content),p=n.map(fn),l=d?Ri(c.content,n,p):[];return{byteLength:c.size,isUtf8Text:d,matchedLiteralIndexes:l,bytes:l.length>0?Buffer.from(c.content):null,...r.computeSha256?{sha256:c.sha256}:{}}}let s=Qe(e,t,r),a=hn(s.absolutePath,"r");try{let c=K(a);Y(c,s,t);let u=r.computeSha256?Ve("sha256"):null,d=r.scratchBuffer??Buffer.allocUnsafe(Pi);if(d.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let p=0,l=n.map(()=>!1),m=!1,h=!0,b=Buffer.alloc(0),Z=n.map(()=>Buffer.alloc(0)),M=n.map(fn);for(;p<c.size;){let x=ln(a,d,0,Math.min(d.byteLength,c.size-p),p);if(x<=0)throw new g(t,"changed-during-read");let P=d.subarray(0,x);if(u?.update(P),m||=P.includes(0),h){let S=b.byteLength>0?Buffer.concat([b,P]):P,W=wi(S);h=dn(S.subarray(0,W)),b=Buffer.from(S.subarray(W))}for(let S=0;S<n.length;S+=1){if(l[S])continue;let W=n[S],tt=Z[S];l[S]=Ei(P,W,tt,M[S]),Z[S]=Ii(P,W,tt)}p+=x}h&&=b.byteLength===0,Y(K(a),s,t);let N=!m&&h,G=N?l.flatMap((x,P)=>x?[P]:[]):[],k=null;if(G.length>0){k=Buffer.allocUnsafe(c.size);let x=0;for(;x<k.byteLength;){let P=ln(a,k,x,k.byteLength-x,x);if(P<=0)throw new g(t,"changed-during-read");x+=P}Y(K(a),s,t)}return{byteLength:c.size,isUtf8Text:N,matchedLiteralIndexes:G,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{gn(a)}}function Ds(e,t,n={}){return Fi(e,t,n).toString("utf8")}function Y(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new g(n,"changed-during-read")}function wi(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function Ri(e,t,n){return t.flatMap((r,i)=>Ke(e,r,n[i])?[i]:[])}function Ei(e,t,n,r){if(Ke(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return Ke(Buffer.concat([n,i]),t,r)}function Ke(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>ji)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function fn(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Ii(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function Ze(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function _s(e,t){try{return Qe(e,t),!0}catch(n){if(Ze(n))return!1;throw n}}function vi(e){let t=D(e);return t?t.filter(n=>n&&!ye(n)).sort():(_i(e)??Bi(e)).filter(n=>n&&!ye(n)).sort()}function Ti(e,t={}){let n=(t.includePaths??[]).map(w),r=[...new Set([...vi(e),...n])].filter(s=>!ye(s)).filter(s=>!t.language||ct(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,a)=>s.localeCompare(a)),i=X(e),o=r.flatMap(s=>mn(e,i,s));return Je(i),o}function mn(e,t,n){let r=Ot(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(L(e,n)==="present"){let o=A(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=Xe(e,n);try{let o=Ye(i);if(o.isSymbolicLink()){let b=Ue(t,n,"symlink",me(o));if(b)return[{path:n,size:b.size,hash:b.hash}];let Z=X(i),M=Si(t,Z);if(M===".."||M.startsWith(`..${xi}`)||yi(M))throw new Error("external symlink");let N=mi(i),G=Ve("sha256").update("symlink\0").update(N).digest("hex"),k=Buffer.byteLength(N);return qe(t,n,"symlink",me(o),{hash:G,size:k}),[{path:n,size:k,hash:G}]}let s=De(n)||Be(n),a=Ue(t,n,"file",me(o));if(a&&(!s||a.semanticHash!==void 0))return[{path:n,size:a.size,hash:a.hash,...a.semanticHash===void 0?{}:{semanticHash:a.semanticHash}}];let c=Ve("sha256"),u=s,d=[],p=ie(i,{inputKind:"project fingerprint input",maxBytes:Q},b=>{c.update(b),u&&d.push(Buffer.from(b))}),l=c.digest("hex"),m=u?Buffer.concat(d,p):void 0,h=m?$t(n,m)??_e(n,m):void 0;return qe(t,n,"file",me(o),{hash:l,size:p,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:p,hash:l,...h===void 0?{}:{semanticHash:h}}]}catch(o){return Ze(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function me(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function yn(e,t,n){let r=et(t,n),i=[...r.typescriptProjects.filter(c=>Li(e,c)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Gt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?Te(e,r.typescriptProjects):["."]:[],a=Bt(s);return{...r,files:Ti(e,{includePath:c=>{if(c===".scipquery.json")return!1;let u=te(c,t,i);return u==="other"||u==="config"&&Mt(c)&&!a.has(c)?!1:u!=="source"||!Ai(c)||!o?!0:o.has(c)},includePaths:i})}}function Bs(e,t){let n=new Set(t.files.map(o=>o.path)),r=yn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...et(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Ms(e,t,n,r,i,o){let s=p=>({mode:"full",fingerprint:yn(e,t,n),reason:p});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let a=et(t,n);if(!Oi(r,a))return s("project-input-configuration-changed");if(new Set(r.files.map(p=>p.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...a,files:[...r.files].sort((p,l)=>p.path.localeCompare(l.path))},changedPaths:[]};let c=[...a.typescriptProjects,...a.clojureConfigPath?[a.clojureConfigPath]:[]],u=new Map(r.files.map(p=>[p.path,p]));for(let p of i.entries){let l=u.get(p.path);if(te(p.path,t,c)!=="source")return s("non-source-project-input-changed");if(p.kind==="add"&&l)return s("added-path-already-in-prior-project-input-snapshot");if(p.kind==="delete"&&!l)return s("deleted-path-not-in-prior-project-input-snapshot");if(p.kind==="change"&&!l)return s("changed-path-not-in-prior-project-input-snapshot");if(l&&(l.hash==="unreadable"||l.size<0))return s("changed-path-was-unreadable")}let d=X(e);for(let p of i.entries){let l=mn(e,d,p.path);if(p.kind==="delete"){if(l.length!==0)return s("deleted-source-is-still-readable");u.delete(p.path);continue}if(l.length!==1||l[0].hash==="unreadable"||l[0].size<0)return s(p.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(p.path,l[0])}return Je(d),{mode:"delta",fingerprint:{...a,files:[...u.values()].sort((p,l)=>p.path.localeCompare(l.path))},changedPaths:i.entries.map(p=>p.path).sort()}}function Oi(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ai(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Li(e,t){let n;try{n=w(t)}catch{return!1}let r=L(e,n);if(r)return r==="present";try{return Ye(Xe(e,n)).isFile()}catch(i){if(Ze(i))return!1;throw i}}function et(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Ci(t.typescriptProjects),clojureConfigPath:Di(t.clojureConfigPath)}}function Di(e){return e?.trim()||void 0}function _i(e){try{let t=kt(e,52428800,()=>fi("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...wt(t)]}catch{return null}}function Bi(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?Xe(e,r):e,o;try{o=gi(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){ye(a)||n.push(a);continue}t.push(a)}}return t}function ye(e){let t=e.split("/");return e==="meta.json"||Nt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>Mi.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Mi=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{g as a,Se as b,Gi as c,Wi as d,j as e,w as f,te as g,ct as h,Hi as i,rt as j,$i as k,Ui as l,Pn as m,R as n,gt as o,Ji as p,Vi as q,Ki as r,Yi as s,Xi as t,Qi as u,ht as v,v as w,oo as x,so as y,ao as z,Fn as A,co as B,yt as C,St as D,An as E,Ln as F,E as G,re as H,ke as I,z as J,Dn as K,_n as L,Bn as M,ie as N,Mn as O,ue as P,Me as Q,q as R,qt as S,pe as T,de as U,kt as V,wt as W,H as X,wo as Y,Ro as Z,Eo as _,se as $,I as aa,Te as ba,Bt as ca,Mt as da,Go as ea,Nt as fa,Gt as ga,Uo as ha,Jt as ia,We as ja,en as ka,Gr as la,us as ma,ps as na,ds as oa,ls as pa,fs as qa,B as ra,Ci as sa,Qe as ta,Fi as ua,Ls as va,ki as wa,Ds as xa,Ze as ya,_s as za,vi as Aa,Ti as Ba,yn as Ca,Bs as Da,Ms as Ea,et as Fa};
|
|
5
|
-
//# sourceMappingURL=chunk-GH5YSGZL.js.map
|
package/dist/chunk-GQIDEID3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-7KCZELVM.js";import{a as p,b as h}from"./chunk-6NC3YSPY.js";import{a as t}from"./chunk-IXESDH3J.js";import{a as m}from"./chunk-EELPBR7E.js";import{c,g as d}from"./chunk-DRENNWRG.js";function C(a,v,y={}){let l=m(a,v);if(!l)return null;let o=y.semantic!==!1,b=h(a,l,{semantic:o,semanticEvidence:t}).filter(e=>d(e.symbol)).slice(0,50),g=u(p(a,l,{limit:50,additive:!0,callableOnly:!0,semantic:o,semanticEvidence:t})),s=b.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source!=="caller-map-inversion"?"reference-candidate":e.callEvidence==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="caller-map-inversion"&&e.callEvidence!=="scip-chunk"?"exact":"candidate",evidenceSource:e.callEvidence??e.source})),r=g.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source}));return{symbol:l.symbol,shortName:c(l.symbol),callers:s.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callees:r.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callerEvidence:s,calleeEvidence:r,coverage:{scope:"indexed-static-call-graph",blindSpots:["unresolved dynamic dispatch and reflection","external or unindexed callees without a resolved symbol identity","SCIP chunk co-occurrence is retained only as candidate call evidence"]}}}export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-GQIDEID3.js.map
|
package/dist/chunk-HCVJR2V4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-JHH5SCZ3.js";import{a as p}from"./chunk-SB25YMEQ.js";import{g as f,ia as d,ma as P,na as h}from"./chunk-AK3PYTIK.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
|
|
2
|
-
`,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
|
|
3
|
-
//# sourceMappingURL=chunk-HCVJR2V4.js.map
|
package/dist/chunk-IMKZEXZG.js
DELETED
package/dist/chunk-ISIQLPJ2.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import{a as S,b as k,c as P,d as I,e as j,i as J}from"./chunk-HG722PO7.js";import{C as z,I as Q,J as f,O as B,P as W,Q as h,x as C,z as $}from"./chunk-GH5YSGZL.js";function de(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function dt(t,e){if(t?.aborted)throw de(t,e)}import{randomUUID as le}from"crypto";import{closeSync as ue,fsyncSync as fe,linkSync as ye,mkdirSync as pe,openSync as me,statSync as ge,unlinkSync as be,writeSync as ke}from"fs";import{dirname as x}from"path";var E="scip-query-process-lock",G=1,F=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:I,readProcessIdentity:P,randomToken:()=>le(),makeDirectory:t=>pe(t,{recursive:!0}),openFile:(t,e,r)=>me(t,e,r),writeFile:(t,e,r,n)=>ke(t,e,r,n),syncFile:t=>fe(t),closeFile:t=>ue(t),linkFile:(t,e)=>ye(t,e),readFile:t=>f(t,"process lock record"),statFile:t=>{let e=ge(t);return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs}},removeFile:t=>be(t)});function K(t,e){let r=e.runtime??F;r.makeDirectory(x(t));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:H(t,e,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=m(t,{parseLegacy:e.parseLegacy,runtime:r});if(i===0&&Se(t,s,{creationGraceMs:e.creationGraceMs,parseLegacy:e.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:m(t,{parseLegacy:e.parseLegacy,runtime:r})}}function m(t,e={}){let r=e.runtime??F,n,i;try{n=r.statFile(t),i=r.readFile(t)}catch(c){return c.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=Le(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Fe(s),parsed:o};let a=e.parseLegacy?.(o)??null;return a?{state:"legacy",raw:i,identity:n,owner:a,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function Le(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;if(e.protocol!==E||e.version!==G||typeof e.kind!="string"||e.kind.trim()===""||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.token!="string"||e.token.trim()===""||typeof e.startedAt!="string"||!Number.isFinite(Date.parse(e.startedAt))||e.detail!==void 0&&(typeof e.detail!="object"||e.detail===null||Array.isArray(e.detail)))return null;let r=e.processIdentity===void 0?null:S(e.processIdentity);return e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{protocol:E,version:G,kind:e.kind,pid:e.pid,token:e.token,...r?{processIdentity:r}:{},startedAt:e.startedAt,...e.detail?{detail:e.detail}:{}}}function Se(t,e,r={}){let n=r.runtime??F;if(!A(e,n))return!1;let i=Ie(`${t}.reclaim`,n);if(!i)return!1;try{let o=m(t,{parseLegacy:r.parseLegacy,runtime:n});return!V(e,o)||!A(o,n)?!1:q(t,n)}finally{i.release()}}function H(t,e,r){let n=e.directoryDurability??"durable",i=e.pid??process.pid,o=r.randomToken(),s=e.processIdentity===void 0?r.readProcessIdentity(i):e.processIdentity,a={protocol:E,version:G,kind:e.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...e.detail?{detail:e.detail}:{}},c=`${t}.${o}.candidate`,y=r.openFile(c,"wx",384),l;try{W(y,Buffer.from(`${JSON.stringify(a)}
|
|
2
|
-
`),r,"process lock"),r.syncFile(y)}catch(u){l=u}try{r.closeFile(y)}catch(u){l??=u}if(l!==void 0)throw v(c,r),l;try{r.linkFile(c,t)}catch(u){throw v(c,r),u}if(v(c,r),n==="durable")try{X(x(t),r)}catch(u){throw Pe(t,a,r),u}let p=!1;return{path:t,record:a,release:()=>p?!1:(p=!0,U(t,a,r,n))}}function Pe(t,e,r=F){return U(t,e,r,"durable")}function U(t,e,r,n){let i=m(t,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==e.pid||i.record.token!==e.token||e.processIdentity&&(!i.record.processIdentity||!k(e.processIdentity,i.record.processIdentity))?!1:q(t,r,n)}function Ie(t,e){for(let r=0;r<2;r+=1)try{return H(t,{kind:"reclaim-guard",runtime:e},e)}catch(n){if(n.code!=="EEXIST")return null;let i=m(t,{runtime:e});if(r>0||!A(i,e))return null;let o=m(t,{runtime:e});if(!V(i,o)||!q(t,e))return null}return null}function A(t,e){if(t.state==="missing")return!1;if(t.owner){if(!e.isProcessAlive(t.owner.pid))return!0;if(!t.owner.processIdentity)return!1;let r=e.readProcessIdentity(t.owner.pid);return r!==null&&!k(t.owner.processIdentity,r)}return!1}function V(t,e){return t.state===e.state&&t.raw===e.raw&&t.identity!==void 0&&e.identity!==void 0&&t.identity.dev===e.identity.dev&&t.identity.ino===e.identity.ino&&t.identity.size===e.identity.size&&t.identity.mtimeMs===e.identity.mtimeMs}function Fe(t){return{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}}function X(t,e){let r;try{r=e.openFile(t,"r")}catch(n){if(h(n,process.platform))return;throw n}try{e.syncFile(r)}catch(n){if(!h(n,process.platform))throw n}finally{e.closeFile(r)}}function q(t,e,r="durable"){try{return e.removeFile(t),r==="durable"&&X(x(t),e),!0}catch{return!1}}function v(t,e){try{e.removeFile(t)}catch{}}import{join as we}from"path";var Re=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function It(t,e={}){return O(we(t,"gc.lock"),e)}function O(t,e={}){let r=e.waitMs??0,n=e.pollMs??10,i=e.now??j,o=i()+r;do{let s=he(t,e.directoryDurability);if(s)return ve(s);let a=o-i();if(a<=0)return null;Ee(Math.min(n,a))}while(i()<=o);return null}function he(t,e){let r=K(t,{kind:"generic",parseLegacy:Re,...e?{directoryDurability:e}:{}});return r.kind==="acquired"?r.lock:null}function ve(t){return{release:()=>{t.release()}}}function Ee(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}import{createHash as Ge,randomUUID as Ae}from"crypto";import{existsSync as g,mkdirSync as xe,readdirSync as qe,rmSync as Z,statSync as ee}from"fs";import{basename as Oe,dirname as w,join as d}from"path";var De=1,Me=1,Te=".scipquery-generations",Ne="manifest.json",te="readers",_e="gc.lock",Ce=128,L=new Map,re={pid:process.pid,now:()=>new Date,randomToken:()=>Ae(),isProcessAlive:I,readProcessIdentity:P};function b(t){return d(w(t),Te)}function $e(t){return d(b(t),_e)}function Dt(t,e=re){let r=O($e(t.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!r)throw new Error("SQLite generation retention is busy; retry opening the index.");let n;try{let i=We(t);if(i.source!=="immutable")return{generation:i,release(){}};let o=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let s=d(b(t.dbPath),te);xe(s,{recursive:!0}),n=d(s,`${e.pid}-${o}.json`);let a=e.readProcessIdentity(e.pid);J(n,{version:1,token:o,generationIdentity:i.identity,pid:e.pid,...a?{processIdentity:a}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let c=!1;return{generation:i,release(){c||!n||(c=!0,Z(n,{force:!0}))}}}finally{r.release()}}function Mt(t,e,r=re,n={}){let i=d(b(t),te);if(!g(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,c=0;for(let y of qe(i,{withFileTypes:!0})){if(!y.isFile()||!y.name.endsWith(".json"))continue;let l=d(i,y.name),p;try{p=ze(JSON.parse(f(l,"SQLite generation reader lease")))}catch{p=null}if(!p){c+=1;for(let u of e)o.add(u);continue}if(!Qe(p,r)){n.removeStale!==!1&&(Z(l,{force:!0}),a+=1);continue}s+=1,o.add(p.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:c}}function ze(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,r=e.processIdentity===void 0?null:S(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...r?{processIdentity:r}:{},acquiredAt:e.acquiredAt}}function Qe(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let r=e.readProcessIdentity(t.pid);return r===null||k(t.processIdentity,r)}function ne(t){try{let e=JSON.parse(f(d(b(t),"state.json"),"SQLite generation state"));return Ve(e)?e:null}catch{return null}}function Be(t,e){return je(b(t),e)}function je(t,e){try{let r=JSON.parse(f(d(t,e,Ne),"SQLite generation manifest"));return Ue(r,e)?r:null}catch{return null}}function We(t){let e=ne(t.dbPath);if(e){let r=Ke(t,e.currentGeneration);if(r)return r;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(g(d(w(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return He(t,e?.currentGeneration)}function Tt(t){let e=ne(t);if(e)return e.currentGeneration;try{let r=d(w(t),"meta.json"),n=g(r)?f(r,"reindex metadata"):void 0;return ie(t,n)}catch{return null}}function Je(t){return $(C(t))??t}function Ke(t,e){try{let r=d(b(t.dbPath),e),n=Be(t.dbPath,e);if(!n)return null;let i=D(r,n.database),o=n.index?D(r,n.index):void 0,s=n.metadata?D(r,n.metadata):void 0;return!M(i,n.database)||n.index&&(!o||!M(o,n.index))||n.metadata&&(!s||!M(s,n.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:f(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function He(t,e){let r=oe(t.dbPath),n=d(w(t.dbPath),"meta.json"),i=g(n)?f(n,"reindex metadata"):void 0,o=g(t.indexPath)?t.indexPath:void 0;return{identity:e??ie(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:n,metadataRaw:i},source:"legacy",databaseFileIdentity:r}}function ie(t,e){let r=Ge("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&r.update(Je(e)),r.update(`\0${oe(t)}`),r.digest("hex")}function oe(t){let e=ee(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function D(t,e){if(Oe(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return d(t,e.file)}function M(t,e){if(!g(t))return!1;let r=Y(t);if(!r||r.size!==e.size)return!1;let n=`${t}\0${e.sha256}\0${r.identity}`;if(L.has(n))return!0;let i=B(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=Y(t);if(!o||o.identity!==r.identity||i!==e.sha256)return!1;for(L.set(n,!0);L.size>Ce;){let s=L.keys().next().value;if(s===void 0)break;L.delete(s)}return!0}function Y(t){let e=ee(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function Ue(t,e){return t.version===Me&&t.identity===e&&T(t.database)&&(t.index===void 0||T(t.index))&&(t.metadata===void 0||T(t.metadata))}function T(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function Ve(t){return t.version===De&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&Xe(t.stableMirrors)&&Ye(t.previousGeneration)&&Ze(t.publication)}function Xe(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function Ye(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function Ze(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,r=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(n=>n!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&r.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}import et from"ignore";import{existsSync as se,readdirSync as tt}from"fs";import{dirname as N,isAbsolute as ae,join as R,relative as rt,resolve as nt}from"path";function Qt(t){let e=et();return it(t,e)||e.add(at),{isIgnored:n=>_(e,t,n),filter:n=>n.filter(i=>!_(e,t,i))}}function it(t,e){let r=new Set,n=(s,a)=>{if(!(r.has(s)||!se(s)))try{let c=Q(s,{maxBytes:z,inputKind:"gitignore file"});e.add(a?ot(c,a):c),r.add(s)}catch{}},i=N(t),o=0;for(;i!==N(i)&&o<5&&(n(R(i,".gitignore"),""),!se(R(i,".git")));)i=N(i),o++;return ce(t,"",e,n),r.size>0}function ce(t,e,r,n){let i=e?R(t,e):t;n(R(i,".gitignore"),e);let o;try{o=tt(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=e?`${e}/${s.name}`:s.name;_(r,t,`${a}/`)||ce(t,a,r,n)}}function ot(t,e){let r=e.replaceAll("\\","/").replace(/\/+$/,"");return t.split(/\r?\n/).map(n=>st(n,r)).join(`
|
|
3
|
-
`)}function st(t,e){let r=t.trimStart();if(!r||r.startsWith("#"))return t;let n=t.slice(0,t.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return t;let s=o.startsWith("/"),a=s?o.slice(1):o,l=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${e}/${a}`:`${e}/**/${a}`;return`${n}${i?"!":""}${l}`}var at=`
|
|
4
|
-
# Dependencies
|
|
5
|
-
node_modules/
|
|
6
|
-
vendor/
|
|
7
|
-
.bundle/
|
|
8
|
-
|
|
9
|
-
# Build output
|
|
10
|
-
dist/
|
|
11
|
-
build/
|
|
12
|
-
out/
|
|
13
|
-
target/
|
|
14
|
-
bin/
|
|
15
|
-
obj/
|
|
16
|
-
|
|
17
|
-
# Python
|
|
18
|
-
__pycache__/
|
|
19
|
-
*.pyc
|
|
20
|
-
*.pyo
|
|
21
|
-
.venv/
|
|
22
|
-
venv/
|
|
23
|
-
.env/
|
|
24
|
-
env/
|
|
25
|
-
*.egg-info/
|
|
26
|
-
|
|
27
|
-
# Rust
|
|
28
|
-
target/
|
|
29
|
-
|
|
30
|
-
# Java / Kotlin / Scala
|
|
31
|
-
*.class
|
|
32
|
-
.gradle/
|
|
33
|
-
.mvn/
|
|
34
|
-
|
|
35
|
-
# C# / .NET
|
|
36
|
-
bin/
|
|
37
|
-
obj/
|
|
38
|
-
packages/
|
|
39
|
-
|
|
40
|
-
# Go
|
|
41
|
-
vendor/
|
|
42
|
-
|
|
43
|
-
# Dart
|
|
44
|
-
.dart_tool/
|
|
45
|
-
build/
|
|
46
|
-
|
|
47
|
-
# PHP
|
|
48
|
-
vendor/
|
|
49
|
-
|
|
50
|
-
# IDE / OS
|
|
51
|
-
.idea/
|
|
52
|
-
.vscode/
|
|
53
|
-
*.swp
|
|
54
|
-
*.swo
|
|
55
|
-
.DS_Store
|
|
56
|
-
Thumbs.db
|
|
57
|
-
|
|
58
|
-
# Type definitions (often noise in queries)
|
|
59
|
-
*.d.ts
|
|
60
|
-
`;function _(t,e,r){let n=ct(e,r);if(!n)return!1;try{return t.ignores(n)}catch{return!1}}function ct(t,e){if(!e||e===".")return null;if(!ae(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let r=ae(e)?e:nt(t,e),n=rt(t,r).replaceAll("\\","/");return!n||n==="."||n.startsWith("..")?null:n}export{de as a,dt as b,K as c,m as d,Se as e,It as f,O as g,De as h,Me as i,Te as j,Ne as k,b as l,$e as m,Dt as n,Mt as o,ne as p,Be as q,je as r,We as s,Tt as t,Je as u,oe as v,Qt as w};
|
|
61
|
-
//# sourceMappingURL=chunk-ISIQLPJ2.js.map
|
package/dist/chunk-IXESDH3J.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as O,b as y,c as b,d as T,f as _,g as z,h as G}from"./chunk-OXYAWIEA.js";import{a as J}from"./chunk-FKGQOTKD.js";import{b as B}from"./chunk-T6QD2ZQB.js";import{d as N}from"./chunk-WSLEJSFR.js";import{h as d}from"./chunk-C7IJMOFP.js";import{b as v,c as g,l as U,n as P}from"./chunk-DKM723YF.js";import{c as A}from"./chunk-IW5XQG5G.js";import{a as j,e as m}from"./chunk-HGFDYOVB.js";var ce={references:_,referenceMap:z,callerMap:(e,s)=>b(e).callerMap(s),calleeMap:q};function q(e,s){let a=j(),i=new Map,o=T(e,s),l=[],n=[],h=0,c=0,p=0,f=0,E=0,H=0,I=0;for(let{definition:t,callees:r}of o.hits)E+=1,r.length>0&&(H+=1,I+=r.length,i.set(t.symbolId,r));let u=K(e,o.hits);if(u.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(e,u.entries),()=>({entries:u.entries.length,sourceMissing:u.sourceMissing,skippedUnsupportedLanguage:u.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[t,r]of O(o.misses)){if(!y(t)){a&&(h+=r.length);continue}let R=d(e,t);if(!R){a&&(c+=r.length),n.push(...r);continue}let x=g(e,t,R),C=$(e,t);if(!C){n.push(...r);continue}let Y=U(e,t,x,C);for(let D of r){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}l.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:h,sourceMissing:c,cacheHits:p,parseFailures:f,misses:l.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:H,inMemoryCalleeCount:I,resultRows:i.size})),l.length===0&&n.length===0)return i;let k=[...n,...l.map(t=>t.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let t=G(e,k);return w=t.size,t},()=>({definitions:k.length,misses:l.length,unkeyed:n.length,rows:w}));for(let[t,r]of F)i.set(t,r);let S=l.filter(t=>b(e).capability("semantic-callees",t.def.relativePath).available).map(t=>({relativePath:t.def.relativePath,symbol:t.def.symbol,contentHash:t.contentHash,depsDigest:t.depsDigest,payload:JSON.stringify(F.get(t.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(e,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:l.length})),i}function K(e,s){let a=[],i=new Map,o=0,l=0;for(let{definition:n,callees:h}of s){if(!y(n.relativePath)){l+=1;continue}if(!i.has(n.relativePath)){let p=d(e,n.relativePath),f=p?$(e,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(e,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(h)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:l}}var Q="typescript-callees-v2-callsite-line";function $(e,s){let a=y(s);if(a==="typescript")return J(e,s,Q)?.key??null;let i=X(e,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:N(e.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(e){try{return JSON.parse(e)}catch{return null}}var W=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(e,s){return W.get(e,s,()=>{let i=[...B(e).get(s)??[]].sort().map(o=>`${o}:${g(e,o,d(e,o))}`);return v(i.join("|"))})}export{ce as a,q as b};
|
|
2
|
-
//# sourceMappingURL=chunk-IXESDH3J.js.map
|
package/dist/chunk-JJ62MTQH.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-TAYD3AE7.js";import{b as f}from"./chunk-5H5WTJSD.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,h as b,p,q as g}from"./chunk-TD7VKJ2Y.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${e.shortName} (${e.file}:${e.startLine+1})
|
|
11
|
-
* ${e.signature??"(signature unavailable)"}
|
|
12
|
-
* ${i}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${s}';
|
|
19
|
-
import { ${e.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-JJ62MTQH.js.map
|
package/dist/chunk-JT6XX7QY.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as ee,b as P,d as v}from"./chunk-SB25YMEQ.js";import{e as Q,g as Z,h as F,u as q,w as te,x as h,y as f,z as p}from"./chunk-AK3PYTIK.js";function lt(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}import{randomUUID as Le}from"crypto";import{closeSync as Ne,existsSync as Oe,fsyncSync as ke,linkSync as Pe,mkdirSync as qe,openSync as $e,renameSync as Ce,unlinkSync as Te,writeSync as _e}from"fs";import{dirname as ie}from"path";import{chmodSync as Ie,constants as Fe,copyFileSync as Re}from"fs";import{dirname as Ee}from"path";var ne=Object.freeze({...te,copyFile:(e,t)=>Re(e,t,Fe.COPYFILE_FICLONE),chmodFile:(e,t)=>Ie(e,t)});function ve(e,t,n={}){let i=n.runtime??ne,r=Ee(t),o=h(r,i);i.copyFile(e,t),n.mode!==void 0&&i.chmodFile(t,n.mode);let s=i.openFile(t,"r");try{i.syncFile(s)}finally{i.closeFile(s)}return p(o,f(r,i))}var re=Object.freeze({platform:process.platform,randomToken:()=>Le(),pathExists:e=>Oe(e),makeDirectory:e=>qe(e,{recursive:!0}),openFile:(e,t,n)=>$e(e,t,n),writeFile:(e,t,n,i)=>_e(e,t,n,i),syncFile:e=>ke(e),closeFile:e=>Ne(e),renameFile:(e,t)=>Ce(e,t),linkFile:(e,t)=>Pe(e,t),removeFile:e=>Te(e)});function $(e,t,n={}){let i=n.durability??"visibility",r=n.runtime??re,o=ie(e),s=i==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,c=typeof t=="string"?Buffer.from(t):t,d,l=!1;try{d=r.openFile(a,"wx",n.mode??384),l=!0,q(d,c,r,"atomic file"),i==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.renameFile(a,e),l=!1;let m=i==="durable"?p(s,f(o,r)):"not-requested";return oe(i,m)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(l)try{r.removeFile(a)}catch{}}}function L(e,t,n={}){let i=n.durability??"visibility",r=n.runtime??re;if(!r.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ie(e),s=i==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,c=typeof t=="string"?Buffer.from(t):t,d,l=!1;try{d=r.openFile(a,"wx",n.mode??384),l=!0,q(d,c,r,"exclusive atomic file"),i==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.linkFile(a,e);let m=i==="durable"?f(o,r):"not-requested";r.removeFile(a),l=!1;let b=i==="durable"?p(s,m,f(o,r)):"not-requested";return oe(i,b)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(l)try{r.removeFile(a)}catch{}}}function oe(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function se(e,t,n={}){$(e,ae(t,n),{durability:"visibility",runtime:n.runtime})}function C(e,t,n={}){return $(e,ae(t,n),{durability:"durable",runtime:n.runtime})}function ae(e,t){let n=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${n}
|
|
2
|
-
`:n}import{createHash as T,randomUUID as pe}from"crypto";import{closeSync as Ue,existsSync as w,fstatSync as We,lstatSync as B,mkdirSync as Ke,openSync as ze,readdirSync as D,readSync as Xe,renameSync as _,rmSync as g}from"fs";import{basename as S,dirname as J,join as y}from"path";function de(e){return N(e,Je)}function It(e){return N(e,je)}function N(e,t){return Array.isArray(e)?`[${e.map(n=>N(n,t)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([n],[i])=>t(n,i)).map(([n,i])=>`${JSON.stringify(n)}:${N(i,t)}`).join(",")}}`:JSON.stringify(e)}function Je(e,t){return e.localeCompare(t)}function je(e,t){return e<t?-1:e>t?1:0}var j=1,He=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),x=class extends Error{constructor(n,i,r,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${r.maxItemBytes}`:n==="item-capacity"?`mailbox has ${i.totalItems} retained items; limit is ${r.maxItems}`:n==="byte-capacity"?`mailbox retains ${i.totalBytes} bytes and the request adds ${o}; limit is ${r.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=i;this.limits=r;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},ge=".owner.json",U={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function $t(e){return{rootDir:e,pendingDir:y(e,"pending"),inflightDir:y(e,"inflight"),responseDir:y(e,"responses"),deadLetterDir:y(e,"dead-letter"),legacyRequestDir:y(e,"requests")}}function I(e={}){let t={...He,...e};for(let[n,i]of Object.entries(t))if(!Number.isFinite(i)||i<=0||!Number.isInteger(i))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return t}function k(e){let t=[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir].map(n=>h(n));return p(...t)}function Ct(e,t){return T("sha256").update(de({namespace:e,payload:t})).digest("hex")}function xe(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${e}`}function Tt(e,t,n={}){let i=I(n.limits),r=n.nowMs??Date.now(),o=k(e);return st(t),K(e,i,n.admissionLockTimeoutMs??2e3,n.monotonicNow??v,n.durability??"durable",()=>{W(e,r,i);let s=y(e.pendingDir,`${t.id}.json`),a=y(e.responseDir,`${t.id}.json`),c=le(e,t.id);if(c){let b=ue(c,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:b.deadlineAtMs??t.deadlineAtMs}}let d=`${JSON.stringify(t)}
|
|
3
|
-
`,l=Buffer.byteLength(d),m=R(e);if(l>i.maxItemBytes)throw new x("item-too-large",m,i,l);if(m.totalItems+1>i.maxItems)throw new x("item-capacity",m,i,l);if(m.totalBytes+l>i.maxBytes)throw new x("byte-capacity",m,i,l);n.onBeforePublish?.();try{let b=n.durability??"durable",u=L(s,d,{durability:b}),M=b==="durable"?p(o,u.directorySync):"not-requested";return{disposition:"accepted",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:t.deadlineAtMs,achievedDurability:u.achievedDurability,directorySync:M}}catch(b){if(b.code!=="EEXIST")throw b;let u=le(e,t.id);if(!u)throw b;let M=ue(u,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:M.deadlineAtMs??t.deadlineAtMs}}})}function Ve(e,t){if(!t.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");if(t.owner&&(!Number.isSafeInteger(t.owner.pid)||t.owner.pid<=0||t.owner.processIdentity!==void 0&&t.owner.processIdentity.pid!==t.owner.pid))throw new Error("Mailbox claim process identity is invalid.");let n=t.nowMs??Date.now(),i=I(t.limits),r=k(e);try{return K(e,i,2e3,t.monotonicNow??v,t.durability??"durable",()=>Ye(e,t.ownerId,n,i,t.liveness??U,t.owner??{pid:process.pid},r,t.durability??"durable",t.onClaimStage))}catch(o){if(o instanceof x&&o.code==="admission-busy")return[];throw o}}function _t(e,t){return!be(e.pendingDir)&&!be(e.legacyRequestDir)?[]:Ve(e,t)}function Ye(e,t,n,i,r,o,s,a,c){W(e,n,i,r);let d=y(e.inflightDir,O(t)),l=[...me(e.pendingDir,!1),...me(e.legacyRequestDir,!0)].sort((u,M)=>u.orderAtMs-M.orderAtMs||u.header.id.localeCompare(M.header.id)||u.path.localeCompare(M.path)),m=a==="durable"?s:"not-requested";l.length>0&&(a==="durable"?m=p(m,h(d)):Ke(d,{recursive:!0}),c?.("after-owner-directory-durable"),rt(d,t,o,a),c?.("after-owner-record-published"));let b=[];for(let u of l){if(b.length>=i.maxBatch)break;let M=y(e.responseDir,`${u.header.id}.json`);if(w(M)){g(u.path,{force:!0});continue}let H=Math.max(n+i.claimLeaseMs,(u.header.deadlineAtMs??n)+5e3),De=`${O(u.originalFile)}.${H}.claim`,V=y(d,De);try{_(u.path,V)}catch(Y){let G=Y.code;if(G==="ENOENT"||G==="EEXIST")continue;throw Y}c?.("after-claim-renamed");let Ae=a==="durable"?f(J(u.path)):"not-requested";c?.("after-source-directory-synced");let Se=a==="durable"?f(d):"not-requested";c?.("after-destination-directory-synced");let Be=p(m,Ae,Se);b.push({requestId:u.header.id,ownerId:t,path:V,originalFile:u.originalFile,claimedAtMs:n,claimExpiresAtMs:H,byteLength:u.byteLength,...u.header.operationKey?{operationKey:u.header.operationKey}:{},...u.header.clientId?{clientId:u.header.clientId}:{},...u.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.header.enqueuedAtMs},...u.header.deadlineAtMs===void 0?{}:{deadlineAtMs:u.header.deadlineAtMs},legacy:u.legacy,directorySync:Be})}return b}function Jt(e,t={}){let n=I(t);if(e.byteLength>n.maxItemBytes)throw new x("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:e.byteLength},n,e.byteLength);return Z(e.path,{maxBytes:n.maxItemBytes,inputKind:"bounded mailbox item"})}function Ge(e,t,n,i={}){let r=i.nowMs??Date.now(),o=I(i.limits),s=t.deadlineAtMs===void 0?r+o.responseRetentionMs:Math.min(r+o.responseRetentionMs,Math.max(t.deadlineAtMs,r)+Me),a={mailboxVersion:j,operationKey:t.operationKey??`legacy-${t.requestId}`,clientId:t.clientId??"legacy",...t.deadlineAtMs===void 0?{}:{deadlineAtMs:t.deadlineAtMs},completedAtMs:r,expiresAtMs:s},c={...a,...n,...a},d=Buffer.byteLength(`${JSON.stringify(c)}
|
|
4
|
-
`),l=R(e);if(d>o.maxItemBytes)throw new x("item-too-large",l,o,d);let m=Math.max(0,l.totalBytes-t.byteLength)+d;if(m>o.maxBytes&&m>l.totalBytes&&(Ze(e,r).removed>0&&(l=R(e),m=Math.max(0,l.totalBytes-t.byteLength)+d),m>o.maxBytes&&m>l.totalBytes))throw new x("byte-capacity",l,o,d);let b=i.durability??"durable";if(et(e,t,c,b),i.onAfterResponsePublished?.(),g(t.path,{force:!0}),b==="durable"){let u=J(t.path);f(w(u)?u:e.inflightDir)}}var Me=3e4,Qe=4096;function Ze(e,t){let n={removed:0,bytesFreed:0},i;try{i=D(e.responseDir)}catch{return n}for(let r of i){if(!r.endsWith(".json"))continue;let o=y(e.responseDir,r),s,a;try{let m=ze(o,"r");try{a=We(m).size;let b=Buffer.alloc(Math.min(Qe,a));Xe(m,b,0,b.length,0),s=b.toString("utf8")}finally{Ue(m)}}catch{continue}let c=ce(s,"expiresAtMs"),d=ce(s,"deadlineAtMs");if(c!==null&&c<=t||d!==null&&d+Me<=t)try{g(o,{force:!0}),n.removed+=1,n.bytesFreed+=a}catch{}}return n}function ce(e,t){let n=new RegExp(`"${t}":(\\d+)`).exec(e);if(!n)return null;let i=Number(n[1]);return Number.isSafeInteger(i)?i:null}function jt(e,t,n,i,r={}){let o=r.nowMs??Date.now(),s=I(r.limits);if(Ge(e,t,n,{...r,nowMs:o,limits:s}),!w(t.path)){let a=y(e.deadLetterDir,`${ct(t.requestId)}.${o}.${T("sha256").update(i).digest("hex").slice(0,12)}.json`),c={mailboxVersion:j,requestId:t.requestId,ownerId:t.ownerId,rejectedAtMs:o,reason:i,originalFile:t.originalFile},d=Buffer.byteLength(`${JSON.stringify(c,null,2)}
|
|
5
|
-
`),l=R(e);l.totalItems<s.maxItems&&l.totalBytes+d<=s.maxBytes&&C(a,c,{spacing:2,trailingNewline:!0})}}function Ut(e,t={}){let n=t.nowMs??Date.now(),i=I(t.limits);return k(e),K(e,i,2e3,t.monotonicNow??v,"durable",()=>W(e,n,i,t.liveness??U))}function W(e,t,n,i=U){let r={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of X(e.inflightDir)){if(o<=0)break;let a=y(e.responseDir,`${s.requestId}.json`);if(w(a)){g(s.path,{force:!0}),r.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>t||ot(e,s.ownerId,i)!=="dead")continue;let c=y(e.pendingDir,s.originalFile);try{_(s.path,c),r.reclaimed++}catch(d){if(d.code!=="EEXIST")throw d;g(s.path,{force:!0})}f(J(s.path)),f(e.pendingDir),o--}o=ye(e.responseDir,o,(s,a)=>a+n.responseRetentionMs,t,()=>{r.responsesRemoved++}),o=ye(e.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,t,()=>{r.deadLettersRemoved++});for(let s of[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir]){if(o<=0)break;for(let a of we(s)){if(o<=0)break;if(!S(a).includes(".tmp-"))continue;let c;try{c=B(a).mtimeMs}catch(d){if(d.code==="ENOENT")continue;throw d}c+n.temporaryRetentionMs>t||(g(a,{force:!0}),r.temporaryFilesRemoved++,o--)}}return at(e.inflightDir),r}function R(e){k(e);let t=[...A(e.pendingDir).map(c=>({path:c,pending:!0})),...A(e.legacyRequestDir).map(c=>({path:c,pending:!0}))],n=X(e.inflightDir).map(c=>({path:c.path,pending:!1})),i=A(e.responseDir).map(c=>({path:c,pending:!1})),r=A(e.deadLetterDir).map(c=>({path:c,pending:!1})),o=[...t,...n,...i,...r],s=0,a;for(let c of t){let d=E(c.path);if(!d){s++;continue}let l=d.enqueuedAtMs;if(l===void 0)try{l=B(c.path).mtimeMs}catch(m){if(m.code==="ENOENT")continue;throw m}a=a===void 0?l:Math.min(a,l)}return{pending:t.length,inflight:n.length,responses:i.length,deadLetters:r.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((c,d)=>c+dt(d.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function et(e,t,n,i){let r=y(e.responseDir,`${t.requestId}.json`),o=`${JSON.stringify(n)}
|
|
6
|
-
`;try{L(r,o,{durability:i})}catch(s){if(s.code!=="EEXIST")throw s;let a=E(r),c=t.operationKey??`legacy-${t.requestId}`;if(a?.operationKey!==c)throw new Error(`Mailbox completion ${t.requestId} conflicts with an existing operation.`,{cause:s})}}function K(e,t,n,i,r,o){let s=y(e.rootDir,".admission.lock"),a=`${process.pid}-${pe()}`,c=i()+Math.max(0,n);for(;!tt(e.rootDir,s,a,r);){if(nt(s),i()>=c)throw new x("admission-busy",R(e),t,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{z(s).ownerToken===a&&(g(s,{recursive:!0,force:!0}),r==="durable"&&f(e.rootDir))}catch{}}}function tt(e,t,n,i){let r=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
7
|
-
`;try{return L(t,r,{durability:i}),!0}catch(o){if(o.code==="EEXIST")return!1;try{z(t).ownerToken===n&&(g(t,{force:!0}),i==="durable"&&f(e))}catch{}throw o}}function nt(e){let t=null;try{let i=z(e);typeof i.ownerToken=="string"&&Number.isSafeInteger(i.pid)&&Number(i.pid)>0&&(t=Number(i.pid))}catch{}if(t===null||it(t))return;let n=`${e}.stale-${pe()}`;try{_(e,n)}catch(i){let r=i.code;if(r==="ENOENT"||r==="EEXIST")return;throw i}g(n,{recursive:!0,force:!0})}function z(e){try{return JSON.parse(F(e,"mailbox lock record"))}catch(t){if(t.code!=="EISDIR"&&!(t instanceof Q&&t.reason==="not-regular"))throw t;return JSON.parse(F(y(e,"owner.json"),"mailbox lock owner record"))}}function it(e){try{return process.kill(e,0),!0}catch(t){let n=t.code;return n==="EPERM"||n!=="ESRCH"}}function rt(e,t,n,i){let r=y(e,ge),o=n.processIdentity,s=he(r);if(s&&s.ownerId===t&&s.pid===n.pid&&(!s.processIdentity&&!o||s.processIdentity&&o&&P(s.processIdentity,o)))return;if(A(e).some(c=>c.endsWith(".claim")))throw new Error(`Mailbox owner identity ${t} collides with retained work from another process instance.`);let a={version:1,ownerId:t,pid:n.pid,...o?{processIdentity:o}:{}};i==="durable"?C(r,a):se(r,a)}function ot(e,t,n){let i=he(y(e.inflightDir,O(t),ge));if(!i)return"unknown";if(!n.isProcessAlive(i.pid))return"dead";if(!i.processIdentity)return"live";let r=n.readProcessIdentity(i.pid);return r?P(i.processIdentity,r)?"live":"dead":"unknown"}function he(e){try{let t=JSON.parse(F(e,"mailbox owner record"));if(t.version!==1||typeof t.ownerId!="string"||!t.ownerId||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0)return null;let n=t.processIdentity===void 0?null:ee(t.processIdentity);return t.processIdentity!==void 0&&(!n||n.pid!==t.pid)?null:{version:1,ownerId:t.ownerId,pid:t.pid,...n?{processIdentity:n}:{}}}catch{return null}}function le(e,t){for(let n of[y(e.pendingDir,`${t}.json`),y(e.legacyRequestDir,`${t}.json`),y(e.responseDir,`${t}.json`)])if(w(n))return n;for(let n of X(e.inflightDir))if(n.requestId===t)return n.path;return null}function ue(e,t,n){let i=E(e);if(i?.operationKey===t)return i;if(S(e)===`${xe(t)}.json`)return{id:n,operationKey:t};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function st(e){if(e.mailboxVersion!==j||e.id!==xe(e.operationKey)||!e.clientId.trim()||!Number.isFinite(e.enqueuedAtMs)||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function me(e,t){return A(e).filter(n=>n.endsWith(".json")).map(n=>{let i=B(n),r=S(n,".json"),o=E(n)??{id:r};return{path:n,originalFile:S(n),header:o,byteLength:i.size,orderAtMs:o.enqueuedAtMs??i.mtimeMs,legacy:t}})}function X(e){if(!w(e))return[];let t=[];for(let n of D(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let i=fe(n.name);if(i===null)continue;let r=y(e,n.name);for(let o of D(r,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=fe(s[1]),c=Number(s[2]);if(a===null||S(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(c))continue;let d=y(r,o.name),l=E(d)??{id:S(a,".json")},m;try{m=B(d)}catch(b){if(b.code==="ENOENT")continue;throw b}t.push({requestId:l.id,ownerId:i,path:d,originalFile:a,claimedAtMs:m.mtimeMs,claimExpiresAtMs:c,byteLength:m.size,...l.operationKey?{operationKey:l.operationKey}:{},...l.clientId?{clientId:l.clientId}:{},...l.enqueuedAtMs===void 0?{}:{enqueuedAtMs:l.enqueuedAtMs},...l.deadlineAtMs===void 0?{}:{deadlineAtMs:l.deadlineAtMs},legacy:l.operationKey===void 0})}}return t.sort((n,i)=>n.claimedAtMs-i.claimedAtMs||n.path.localeCompare(i.path))}function E(e){try{let t=JSON.parse(F(e,"mailbox record"));return typeof t.id!="string"||!t.id?null:{id:t.id,...typeof t.operationKey=="string"?{operationKey:t.operationKey}:{},...typeof t.clientId=="string"?{clientId:t.clientId}:{},...typeof t.enqueuedAtMs=="number"?{enqueuedAtMs:t.enqueuedAtMs}:{},...typeof t.deadlineAtMs=="number"?{deadlineAtMs:t.deadlineAtMs}:{}}}catch{return null}}function ye(e,t,n,i,r){for(let o of A(e)){if(t<=0)break;let s;try{s=B(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>i||(g(o,{force:!0}),r(),t--)}return t}function A(e){return w(e)?D(e,{withFileTypes:!0}).filter(t=>t.isFile()).map(t=>y(e,t.name)).sort():[]}function be(e){try{return D(e).some(t=>t.endsWith(".json"))}catch{return!1}}function we(e){if(!w(e))return[];let t=[];for(let n of D(e,{withFileTypes:!0})){let i=y(e,n.name);n.isFile()?t.push(i):n.isDirectory()&&t.push(...we(i))}return t.sort()}function at(e){if(w(e))for(let t of D(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let n=y(e,t.name);D(n).some(i=>i.endsWith(".claim"))||g(n,{recursive:!0,force:!0})}}function dt(e){try{return B(e).size}catch{return 0}}function O(e){return Buffer.from(e,"utf8").toString("base64url")}function fe(e){try{let t=Buffer.from(e,"base64url").toString("utf8");return O(t)===e?t:null}catch{return null}}function ct(e){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)?e:`invalid-${T("sha256").update(e).digest("hex")}`}export{lt as a,ve as b,se as c,C as d,de as e,It as f,j as g,x as h,$t as i,k as j,Ct as k,xe as l,Tt as m,_t as n,Jt as o,Ge as p,jt as q,Ut as r,R as s};
|
|
8
|
-
//# sourceMappingURL=chunk-JT6XX7QY.js.map
|
package/dist/chunk-KFOYCQAJ.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var be=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]),Rt=6500,At=8e3,It=6500,Lt=3500;function Se(e,t={}){let r=t.allowNewlines??!0,n=t.allowTabs??!0,i="";for(let o=0;o<e.length;){let s=e.charCodeAt(o);if(s===27){o=Fe(e,o);continue}if(s===155){o=U(e,o+1);continue}if(s===144||s===152||s===157||s===158||s===159){o=q(e,o+1);continue}if(we(s)){s===10&&r?i+=`
|
|
2
|
-
`:s===9&&n?i+=" ":i+=be.get(s)??"\uFFFD",o+=1;continue}if(he(s)){i+="\uFFFD",o+=1;continue}i+=e[o],o+=1}return i}function Tt(e){return Se(e,{allowNewlines:!1,allowTabs:!1})}function Dt(e,t=r=>process.stdout.write(r)){t(`${e}
|
|
3
|
-
`)}function Fe(e,t){let r=e.charCodeAt(t+1);if(Number.isNaN(r))return e.length;if(r===91)return U(e,t+2);if(r===80||r===88||r===93||r===94||r===95)return q(e,t+2);let n=t+1;for(;n<e.length&&xe(e.charCodeAt(n));)n+=1;return n<e.length&&ke(e.charCodeAt(n))?n+1:t+1}function U(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(r+=1,n>=64&&n<=126)return r}return e.length}function q(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(n===7||n===156)return r+1;if(n===27&&e.charCodeAt(r+1)===92)return r+2;r+=1}return e.length}function xe(e){return e>=32&&e<=47}function ke(e){return e>=48&&e<=126}function we(e){return e<=31||e>=127&&e<=159}function he(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}import{closeSync as W,fstatSync as $,openSync as z,readFileSync as Ee,readSync as Pe}from"fs";import{createHash as _t}from"crypto";var J=8*1024*1024,Re=64*1024*1024,Ae=512*1024*1024,Ie=256*1024*1024,m=class extends Error{constructor(r,n,i,o,s){let c=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${c}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function j(e,t){K(t.maxBytes);let r=String(e),n=z(e,"r");try{let i=$(n);Le(i,t,r);let o=Ee(n),s=$(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new m(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{W(n)}}function Y(e,t,r="utf8"){return j(e,t).toString(r)}function b(e,t){return Y(e,{maxBytes:J,inputKind:t})}function G(e,t){K(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=Pe(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new m(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function X(e,t){let r=z(e,"r");try{return G(r,t)}finally{W(r)}}function P(e,t,r="utf8"){return X(e,t).toString(r)}function Le(e,t,r){if(!e.isFile())throw new m(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new m(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function K(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function Jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Yt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Gt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Te=/^[a-f0-9]{64}$/u;function Xt(e){return typeof e=="string"&&Te.test(e)}function Kt(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Vt(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var De=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function R(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!De.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function x(e,t){return e.version===t.version&&e.pid===t.pid&&e.platform===t.platform&&e.startToken===t.startToken}import{execFileSync as Oe}from"child_process";import{platform as Ne}from"os";var ve=1e3,V=16*1024,A;function Z(e,t=Q){if(!Number.isSafeInteger(e)||e<=0)return null;let r=e===process.pid&&t===Q;if(r&&A)return{...A};try{let n=_e(e,t);if(!n)return null;let i={version:1,pid:e,platform:t.platform,startToken:n};return r&&(A=i),{...i}}catch{return null}}function _e(e,t){if(t.platform==="linux"||t.platform==="android")return Ce(t.readFile(`/proc/${e}/stat`));if(t.platform==="win32"){let r=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return H(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",r]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?H(t.run("ps",["-p",String(e),"-o","lstart="])):null}function Ce(e){let t=e.lastIndexOf(")");if(t<0)return null;let n=e.slice(t+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function H(e){let t=e.trim();return t===""?null:t}var Q={platform:Ne(),readFile(e){return P(e,{maxBytes:V,inputKind:"process identity pseudo-file"})},run(e,t){return Oe(e,[...t],{encoding:"utf8",timeout:ve,maxBuffer:V,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function ee(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}import{randomUUID as Me}from"crypto";import{closeSync as Be,fsyncSync as Ue,linkSync as qe,mkdirSync as $e,openSync as We,statSync as ze,unlinkSync as Je,writeSync as je}from"fs";import{dirname as O}from"path";function S(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function p(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var L="scip-query-process-lock",T=1,k=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:ee,readProcessIdentity:Z,randomToken:()=>Me(),makeDirectory:e=>$e(e,{recursive:!0}),openFile:(e,t,r)=>We(e,t,r),writeFile:(e,t,r,n)=>je(e,t,r,n),syncFile:e=>Ue(e),closeFile:e=>Be(e),linkFile:(e,t)=>qe(e,t),readFile:e=>b(e,"process lock record"),statFile:e=>{let t=ze(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>Je(e)});function te(e,t){let r=t.runtime??k;r.makeDirectory(O(e));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:re(e,t,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=y(e,{parseLegacy:t.parseLegacy,runtime:r});if(i===0&&Ge(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:y(e,{parseLegacy:t.parseLegacy,runtime:r})}}function y(e,t={}){let r=t.runtime??k,n,i;try{n=r.statFile(e),i=r.readFile(e)}catch(l){return l.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=Ye(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Ve(s),parsed:o};let c=t.parseLegacy?.(o)??null;return c?{state:"legacy",raw:i,identity:n,owner:c,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function Ye(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.protocol!==L||t.version!==T||typeof t.kind!="string"||t.kind.trim()===""||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.token!="string"||t.token.trim()===""||typeof t.startedAt!="string"||!Number.isFinite(Date.parse(t.startedAt))||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||Array.isArray(t.detail)))return null;let r=t.processIdentity===void 0?null:R(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{protocol:L,version:T,kind:t.kind,pid:t.pid,token:t.token,...r?{processIdentity:r}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function Ge(e,t,r={}){let n=r.runtime??k;if(!D(t,n))return!1;let i=Ke(`${e}.reclaim`,n);if(!i)return!1;try{let o=y(e,{parseLegacy:r.parseLegacy,runtime:n});return!ie(t,o)||!D(o,n)?!1:N(e,n)}finally{i.release()}}function re(e,t,r){let n=t.directoryDurability??"durable",i=t.pid??process.pid,o=r.randomToken(),s=t.processIdentity===void 0?r.readProcessIdentity(i):t.processIdentity,c={protocol:L,version:T,kind:t.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},l=`${e}.${o}.candidate`,a=r.openFile(l,"wx",384),u;try{S(a,Buffer.from(`${JSON.stringify(c)}
|
|
4
|
-
`),r,"process lock"),r.syncFile(a)}catch(d){u=d}try{r.closeFile(a)}catch(d){u??=d}if(u!==void 0)throw I(l,r),u;try{r.linkFile(l,e)}catch(d){throw I(l,r),d}if(I(l,r),n==="durable")try{oe(O(e),r)}catch(d){throw Xe(e,c,r),d}let f=!1;return{path:e,record:c,release:()=>f?!1:(f=!0,ne(e,c,r,n))}}function Xe(e,t,r=k){return ne(e,t,r,"durable")}function ne(e,t,r,n){let i=y(e,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==t.pid||i.record.token!==t.token||t.processIdentity&&(!i.record.processIdentity||!x(t.processIdentity,i.record.processIdentity))?!1:N(e,r,n)}function Ke(e,t){for(let r=0;r<2;r+=1)try{return re(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST")return null;let i=y(e,{runtime:t});if(r>0||!D(i,t))return null;let o=y(e,{runtime:t});if(!ie(i,o)||!N(e,t))return null}return null}function D(e,t){if(e.state==="missing")return!1;if(e.owner){if(!t.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let r=t.readProcessIdentity(e.owner.pid);return r!==null&&!x(e.owner.processIdentity,r)}return!1}function ie(e,t){return e.state===t.state&&e.raw===t.raw&&e.identity!==void 0&&t.identity!==void 0&&e.identity.dev===t.identity.dev&&e.identity.ino===t.identity.ino&&e.identity.size===t.identity.size&&e.identity.mtimeMs===t.identity.mtimeMs}function Ve(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function oe(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!p(n,process.platform))throw n}finally{t.closeFile(r)}}function N(e,t,r="durable"){try{return t.removeFile(e),r==="durable"&&oe(O(e),t),!0}catch{return!1}}function I(e,t){try{t.removeFile(e)}catch{}}import{randomUUID as rt}from"crypto";import{closeSync as nt,existsSync as it,fsyncSync as ot,linkSync as st,mkdirSync as ct,openSync as at,renameSync as lt,unlinkSync as ut,writeSync as dt}from"fs";import{dirname as ae}from"path";import{closeSync as He,existsSync as Qe,fsyncSync as Ze,mkdirSync as et,openSync as tt}from"fs";import{dirname as se}from"path";var ce=Object.freeze({platform:process.platform,pathExists:e=>Qe(e),makeDirectory:e=>et(e,{recursive:!0}),openFile:(e,t,r)=>tt(e,t,r),syncFile:e=>Ze(e),closeFile:e=>He(e)});function w(e,t=ce){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=se(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=F(i,g(se(o),t));return i}function g(e,t=ce){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(p(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function F(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}var le=Object.freeze({platform:process.platform,randomToken:()=>rt(),pathExists:e=>it(e),makeDirectory:e=>ct(e,{recursive:!0}),openFile:(e,t,r)=>at(e,t,r),writeFile:(e,t,r,n)=>dt(e,t,r,n),syncFile:e=>ot(e),closeFile:e=>nt(e),renameFile:(e,t)=>lt(e,t),linkFile:(e,t)=>st(e,t),removeFile:e=>ut(e)});function ue(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le,o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.renameFile(c,e),u=!1;let f=n==="durable"?F(s,g(o,i)):"not-requested";return de(n,f)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function hr(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le;if(!i.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"exclusive atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.linkFile(c,e);let f=n==="durable"?g(o,i):"not-requested";i.removeFile(c),u=!1;let d=n==="durable"?F(s,f,g(o,i)):"not-requested";return de(n,d)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function de(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function h(e,t,r={}){ue(e,mt(t,r),{durability:"visibility",runtime:r.runtime})}function mt(e,t){let r=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${r}
|
|
5
|
-
`:r}import{createHash as ft}from"crypto";import{existsSync as _,mkdirSync as pt,rmSync as yt}from"fs";import{tmpdir as gt}from"os";import{isAbsolute as bt,join as pe,resolve as E}from"path";var ye=1,St="SCIP_QUERY_SESSION",me="SCIP_QUERY_SESSION_DIR",Ft=128,xt=8,kt=32768,fe=new Map;function _r(e,t,r,n=!0,i){if(!n||e!=="anchors"&&e!=="system-map")return;let o=B();if(!o)return;let s=ge(t),c=M(s,o);if(e==="system-map"){r?yt(c,{force:!0}):_(c)&&i&&v(c,()=>{let l=C(c,s,o);l&&h(c,{...l,pendingMapContinuation:i,mapExecution:void 0,updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})});return}v(c,()=>{let l=wt(s,o),a={version:ye,projectRoot:s,sessionIdentity:o,mapRequired:!0,...l.length>0?{recommendedMapCommands:l}:{},updatedAt:new Date().toISOString()};h(c,a,{spacing:2,trailingNewline:!0})})}function Cr(e,t=!0){if(!t)return;let r=B();if(!r)return;let n=ge(e),i=M(n,r);_(i)&&v(i,()=>{let o=C(i,n,r);if(o){if(o.pendingMapContinuation)throw new Error(["MAP TRANSPORT INCOMPLETE","The selected system map has already been computed. Restarting it would repeat the same repository work.",`Continue exactly: ${o.pendingMapContinuation}`].join(`
|
|
6
|
-
`));if(o.mapExecution&&Et(o.mapExecution.processId))throw new Error(["NAVIGATION MAP ALREADY RUNNING","A selected system map is already computing in this SCIP_QUERY_SESSION.","Poll the existing terminal execution. Do not launch a duplicate map or inspect in parallel."].join(`
|
|
7
|
-
`));h(i,{...o,mapExecution:{processId:process.pid,startedAt:new Date().toISOString()},updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})}})}function Mr(e,t,r=!0){if(!r)return;let n=B();if(!n)return;let i=M(E(e),n);if(!_(i))return;let o=C(i,E(e),n);if(!o?.mapRequired)return;let s=o.recommendedMapCommands?.length?["This refusal is a recoverable protocol step, not evidence that the requested code cannot be explored.","Run exactly one of the ranked map commands below, then finish every emitted continuation:",...o.recommendedMapCommands.map((c,l)=>` [${l+1}] ${c}`)]:[`Do not retry ${t}. Run one printed next-abstraction system-map command and finish every emitted continuation first.`];throw new Error(["NAVIGATION MAP REQUIRED","An anchors locator completed in this SCIP_QUERY_SESSION, but its selected system map has not reached transport completion.",`Do not retry ${t}.`,...s,"The map must complete before the agent can choose source detail; map and detail exploration cannot run concurrently."].join(`
|
|
8
|
-
`))}function C(e,t,r){try{let n=JSON.parse(b(e,"navigation session state"));return n.version===ye&&n.projectRoot===t&&n.sessionIdentity===r&&n.mapRequired===!0&&(n.recommendedMapCommands===void 0||Array.isArray(n.recommendedMapCommands)&&n.recommendedMapCommands.length<=xt&&n.recommendedMapCommands.every(i=>typeof i=="string"&&i.startsWith("scip-query system-map ")&&i.length<=kt))&&(n.pendingMapContinuation===void 0||typeof n.pendingMapContinuation=="string")&&(n.mapExecution===void 0||typeof n.mapExecution=="object"&&n.mapExecution!==null&&Number.isSafeInteger(n.mapExecution.processId)&&typeof n.mapExecution.startedAt=="string")?n:null}catch{return null}}function wt(e,t){let r=ht(e,t),n=fe.get(r)??[];return fe.delete(r),n}function ht(e,t){return`${e}\0${t}`}function Et(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function M(e,t){let r=Pt();pt(r,{recursive:!0,mode:448});let n=ft("sha256").update(e).update("\0").update(t).digest("hex");return pe(r,`navigation-${n}.json`)}function Pt(){let e=process.env[me];if(!e)return pe(gt(),`scip-query-source-sessions-${process.getuid?.()??"user"}`);if(!bt(e))throw new Error(`${me} must be an absolute path.`);return E(e)}function ge(e){let t=process.env.SCIP_QUERY_PROJECT_ROOT?.trim();return E(t||e)}function B(){let e=process.env[St]?.trim();if(e&&!(e.length>Ft||!/^[A-Za-z0-9._:-]+$/u.test(e)))return`explicit:${e}`}function v(e,t){let r=te(`${e}.lock`,{kind:"navigation-session",detail:{state:e.slice(-17,-5)}});if(r.kind!=="acquired")throw new Error("Navigation session state is busy. Retry the completed command.");try{t()}finally{r.lock.release()}}export{Rt as a,At as b,It as c,Lt as d,Tt as e,Dt as f,S as g,ce as h,w as i,g as j,F as k,J as l,m,Y as n,b as o,Jt as p,jt as q,Yt as r,Gt as s,Xt as t,Kt as u,Vt as v,R as w,x,Z as y,ee as z,te as A,y as B,hr as C,h as D,_r as E,Cr as F,Mr as G};
|
|
9
|
-
//# sourceMappingURL=chunk-KFOYCQAJ.js.map
|
package/dist/chunk-LRI5OMPE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as x}from"./chunk-OJNK5ALA.js";import{f,g as p}from"./chunk-QLBSG7U5.js";import{a as L}from"./chunk-VXJJTQYE.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as v}from"./chunk-PLYUVM4F.js";import{a as E}from"./chunk-BGBBVSH4.js";import{a as C}from"./chunk-Z2AWCTN6.js";import{a as y}from"./chunk-BWVQP3LB.js";import{b}from"./chunk-5H5WTJSD.js";import{d as m,t as g}from"./chunk-TD7VKJ2Y.js";import{c as u,m as h}from"./chunk-42W3LFUK.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,k=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,I=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,_=/\.(?:addIssue|push)\s*\(/;function M(e,t={}){let{scope:n,limit:i=30,scanLimit:l}=t,a=new v(e),r=D(a.productionCallableDefinitions({scope:n,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),s=[];for(let o of r){let c=P(e,o);c&&s.push({symbol:o.symbol,shortName:m(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:E(o),...c})}return s.sort((o,c)=>o.file.localeCompare(c.file)||o.startLine-c.startLine||o.loc-c.loc),i?s.slice(0,i):s}function w(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function P(e,t){let n=w(t.leaf);if(!n||L(e,t))return null;let i=f(e,t);if(!i||!I.test(i))return null;let l=h(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine);if(n==="predicate"&&l?.paramCount===0)return null;if(x(i)){let r=O(e,t);return!r||S(r.body,T(r.snippet))||R(r.body)?null:{nameKind:n,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let a=p(i);return S(a,T(i))||R(a)?null:{nameKind:n,resolvedVia:"direct"}}var F=new Set(["if","for","while","switch","catch","function"]);function R(e){let t=u(e);for(let n of t.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!F.has(n[1]))return!0;return!1}function T(e){let t=e.indexOf("=>");return t===-1?!1:!/^\s*\{/.test(e.slice(t+2))}function S(e,t){let n=u(e);if(/\bthrow\b/.test(n)||/\.reject\s*\(/.test(n)||k.test(n)||_.test(n))return!0;let i=K(n);if(t&&i.length===0){let l=n.trim();return l!==""&&l!=="true"}for(let l of i)if(l!==""&&l!=="true")return!0;return!1}function K(e){let t=[];d.lastIndex=0;let n;for(;n=d.exec(e);){let i=n.index+n[0].length,l=0,a=e.length;for(let r=i;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")l+=1;else if(s===")"||s==="]"||s==="}"){if(l===0){a=r;break}l-=1}else if(s===";"&&l===0){a=r;break}}t.push(e.slice(i,a).trim()),d.lastIndex=a}return t}function O(e,t){let n=y(e,t,{callableOnly:!0,limit:3,semanticEvidence:C}),i=[...new Set(n.map(o=>o.symbol))].filter(o=>o!==t.symbol);if(i.length!==1)return null;let a=b(e,i[0]).match;if(!a)return null;let r=g(e,a.relativePath).find(o=>o.symbolId===a.symbolId);if(!r)return null;let s=f(e,r);return s?{body:p(s),snippet:s,shortName:m(r.symbol)}:null}export{M as a};
|
|
2
|
-
//# sourceMappingURL=chunk-LRI5OMPE.js.map
|