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
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-B3PYOSCX.js";import{a as v,b as f,c as O}from"./chunk-JFMEXGFE.js";import{h as I,n as R,o as p}from"./chunk-7F45LJKI.js";import{randomUUID as N}from"crypto";import{closeSync as _,fsyncSync as T,linkSync as C,mkdirSync as q,openSync as M,statSync as h,unlinkSync as z,writeSync as G}from"fs";import{dirname as b}from"path";var F="scip-query-process-lock",L=1,y=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:S,readProcessIdentity:O,randomToken:()=>N(),makeDirectory:r=>q(r,{recursive:!0}),openFile:(r,e,t)=>M(r,e,t),writeFile:(r,e,t,i)=>G(r,e,t,i),syncFile:r=>T(r),closeFile:r=>_(r),linkFile:(r,e)=>C(r,e),readFile:r=>I(r,"process lock record"),statFile:r=>{let e=h(r);return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs}},removeFile:r=>z(r)});function Z(r,e){let t=e.runtime??y;t.makeDirectory(b(r));let i;for(let o=0;o<2;o+=1)try{return{kind:"acquired",lock:D(r,e,t),...i?{reclaimed:i}:{}}}catch(n){if(n.code!=="EEXIST")throw n;let s=d(r,{parseLegacy:e.parseLegacy,runtime:t});if(o===0&&K(r,s,{creationGraceMs:e.creationGraceMs,parseLegacy:e.parseLegacy,runtime:t})){i=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:d(r,{parseLegacy:e.parseLegacy,runtime:t})}}function d(r,e={}){let t=e.runtime??y,i,o;try{i=t.statFile(r),o=t.readFile(r)}catch(l){return l.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let n;try{n=JSON.parse(o)}catch{return{state:"malformed",raw:o,identity:i}}let s=J(n);if(s)return{state:"valid",raw:o,identity:i,record:s,owner:j(s),parsed:n};let c=e.parseLegacy?.(n)??null;return c?{state:"legacy",raw:o,identity:i,owner:c,parsed:n}:{state:"malformed",raw:o,identity:i,parsed:n}}function J(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r;if(e.protocol!==F||e.version!==L||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 t=e.processIdentity===void 0?null:v(e.processIdentity);return e.processIdentity!==void 0&&(!t||t.pid!==e.pid)?null:{protocol:F,version:L,kind:e.kind,pid:e.pid,token:e.token,...t?{processIdentity:t}:{},startedAt:e.startedAt,...e.detail?{detail:e.detail}:{}}}function K(r,e,t={}){let i=t.runtime??y;if(!P(e,i))return!1;let o=$(`${r}.reclaim`,i);if(!o)return!1;try{let n=d(r,{parseLegacy:t.parseLegacy,runtime:i});return!x(e,n)||!P(n,i)?!1:g(r,i)}finally{o.release()}}function D(r,e,t){let i=e.directoryDurability??"durable",o=e.pid??process.pid,n=t.randomToken(),s=e.processIdentity===void 0?t.readProcessIdentity(o):e.processIdentity,c={protocol:F,version:L,kind:e.kind,pid:o,token:n,...s?{processIdentity:s}:{},startedAt:new Date(t.wallNow()).toISOString(),...e.detail?{detail:e.detail}:{}},l=`${r}.${n}.candidate`,k=t.openFile(l,"wx",384),u;try{R(k,Buffer.from(`${JSON.stringify(c)}
|
|
2
2
|
`),t,"process lock"),t.syncFile(k)}catch(a){u=a}try{t.closeFile(k)}catch(a){u??=a}if(u!==void 0)throw m(l,t),u;try{t.linkFile(l,r)}catch(a){throw m(l,t),a}if(m(l,t),i==="durable")try{A(b(r),t)}catch(a){throw U(r,c,t),a}let w=!1;return{path:r,record:c,release:()=>w?!1:(w=!0,E(r,c,t,i))}}function U(r,e,t=y){return E(r,e,t,"durable")}function E(r,e,t,i){let o=d(r,{runtime:t});return o.state!=="valid"||!o.record||o.record.pid!==e.pid||o.record.token!==e.token||e.processIdentity&&(!o.record.processIdentity||!f(e.processIdentity,o.record.processIdentity))?!1:g(r,t,i)}function $(r,e){for(let t=0;t<2;t+=1)try{return D(r,{kind:"reclaim-guard",runtime:e},e)}catch(i){if(i.code!=="EEXIST")return null;let o=d(r,{runtime:e});if(t>0||!P(o,e))return null;let n=d(r,{runtime:e});if(!x(o,n)||!g(r,e))return null}return null}function P(r,e){if(r.state==="missing")return!1;if(r.owner){if(!e.isProcessAlive(r.owner.pid))return!0;if(!r.owner.processIdentity)return!1;let t=e.readProcessIdentity(r.owner.pid);return t!==null&&!f(r.owner.processIdentity,t)}return!1}function x(r,e){return r.state===e.state&&r.raw===e.raw&&r.identity!==void 0&&e.identity!==void 0&&r.identity.dev===e.identity.dev&&r.identity.ino===e.identity.ino&&r.identity.size===e.identity.size&&r.identity.mtimeMs===e.identity.mtimeMs}function j(r){return{pid:r.pid,...r.processIdentity?{processIdentity:r.processIdentity}:{}}}function A(r,e){let t;try{t=e.openFile(r,"r")}catch(i){if(p(i,process.platform))return;throw i}try{e.syncFile(t)}catch(i){if(!p(i,process.platform))throw i}finally{e.closeFile(t)}}function g(r,e,t="durable"){try{return e.removeFile(r),t==="durable"&&A(b(r),e),!0}catch{return!1}}function m(r,e){try{e.removeFile(r)}catch{}}export{y as a,Z as b,d as c,K as d};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-3AF4TUFK.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{Nb as V,Ob as B,Pb as it,Qb as D,Sb as ut,mc as ct,oc as T,tc as x,uc as _}from"./chunk-NWLVNU66.js";import{Da as I,Ne as at,Qd as rt,Rd as st,Sd as ot,Td as j,_d as q,u as L}from"./chunk-2XWIUW5Z.js";import{createHash as A,randomBytes as yt}from"crypto";import{chmodSync as Xt,closeSync as N,fstatSync as J,lstatSync as Yt,mkdirSync as wt,openSync as Y,readSync as Qt,readdirSync as Ot,renameSync as St,rmSync as Q,statSync as Zt,writeSync as vt}from"fs";import{tmpdir as Kt}from"os";import{dirname as te,join as U,resolve as ee}from"path";import{StringDecoder as Z}from"string_decoder";import{InvalidArgumentError as ht}from"commander";var Wt=/^[A-Za-z0-9_@%+=:,./-]+$/u;function pt(t,e={}){return e.omitSafeQuotes&&Wt.test(t)?t:(e.platform??process.platform)==="win32"?`"${t.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${t.replaceAll("'",`'"'"'`)}'`}var bt="scip-query-output-page",Ct=1,ne="continue",S=256,E=1e5,$=4096,m=32e6,Pt=64*1024*1024,re=256*1024*1024,se=32,It=32768,Et=16,oe=D*Et,R=4096,dt=Pt,Tt=3600*1e3,ae="scip-query-json-export",ie=1,xt=3;function _t(){return U(Kt(),`scip-query-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var K=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,At=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,ue=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,ce=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,Nt=1,pe="quota.lock",he=2e3,de=5,gt=1024*1024,ge=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),F,fe=Object.freeze({maxSnapshotBytes:Pt,maxAggregateBytes:re,maxSnapshotCount:se});var Ut={writeStdout:t=>{process.stdout.write(t)},writeStderr:t=>{process.stderr.write(t)},stdoutIsRegularFile:()=>{try{return J(1).isFile()}catch{return!1}}};async function le(t,e,n=Ut){return ct({command:t.command,cwd:t.cwd,argv:t.argv,json:t.json,sessionEnabled:t.sourceSession,reemit:t.reemitSource},async()=>{try{await me(t,e,n)}finally{T(!1)}})}async function me(t,e,n){let s=t.pageSize??V,r=t.snapshotRoot??_t(),a=Ie(t.snapshotLimits),o=t.maxOutputCharacters??m;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let i=Math.min(o,m,t.agentOutput?oe:m);if(Lt(s),t.cursor!==void 0&&t.cursor.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit. Run the command again without --output-cursor.`);if(t.jsonOutputPath!==void 0){if(!t.json)throw new Error("--json-output requires --json.");if(t.agentOutput||t.pageSize!==void 0||t.cursor!==void 0)throw new Error("--json-output cannot be combined with --agent-output or output pagination.");t.command==="system-map"&&_(t.cwd,t.sourceSession!==!1),await ye(t,e,n,i);return}if(t.json&&!t.agentOutput&&t.pageSize===void 0&&t.cursor===void 0){t.command==="system-map"&&_(t.cwd,t.sourceSession!==!1),await Oe(t,e,n);return}if(!t.json&&t.cursor===void 0&&t.pageSize===void 0&&n.stdoutIsRegularFile?.()===!0){t.command==="system-map"&&_(t.cwd,t.sourceSession!==!1),await Se(t,e,i);return}let c=qt(t.argv),h=Ft(t.invocationPrefix),d=jt(t.command,t.cwd,h,c),g=t.cursor===void 0?void 0:$e(t.cursor,d);t.command==="system-map"&&!g&&_(t.cwd,t.sourceSession!==!1);let p=g?.snapshotId,u;if(g)try{u=ve(g,d,s,i,r,t.onSnapshotRead)}catch(y){let k=y instanceof Error?y.message:String(y);throw new Error(`${k} Restart with: ${Vt(h,c,s)}`,{cause:y})}else{let y=new W(d,h,t.command,t.cwd,c,s,i,Be(t,h),r,a,t.agentOutput?Et:It,!t.json,H(i,t.agentOutput===!0)),k=Bt(z=>y.write(z)),nt=!1;try{await e(),nt=!0}finally{k(),nt||y.abort()}let P;try{P=y.complete()}catch(z){throw y.abort(),z}p=P.snapshotId,u={content:P.content,offset:0,pageIndex:0,pageCount:P.pageCount,totalCharacters:P.totalCharacters,outputHash:P.outputHash}}let O=u.offset+u.content.length,f=u.pageIndex+1>=u.pageCount,l=f?void 0:Le({invocationPrefix:h,nextPageIndex:u.pageIndex+1,snapshotId:Ne(p)});if(x(t.command,t.cwd,f,t.sourceSession!==!1,l?.command),u.offset===0&&f&&t.cursor===void 0){n.writeStdout(u.content),T(!0),p&&b(p,r);return}let C={kind:bt,schemaVersion:Ct,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:t.json?"application/json":"text/plain",agentInstruction:l?"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.":"OUTPUT COMPLETE: all rendered characters have been retrieved. Evaluate the command result's own coverage separately.",page:l?{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-O,complete:!1,outputHash:u.outputHash,continuation:l}:{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-O,complete:!0,outputHash:u.outputHash},content:u.content};if(t.json){n.writeStdout(`${JSON.stringify(C)}
|
|
3
|
+
`),f&&p&&b(p,r);return}n.writeStdout(qe(C)),f&&p&&b(p,r)}async function cn(t,e,n=_t(),s=Ut){if(t.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit.`);let r=zt(t);if(!r)throw new Error("Invalid output cursor. Run the original command again.");let a=$t(r.snapshotId,n);await le({command:a.command,producerVersion:e,invocationPrefix:a.invocationPrefix,argv:[...a.argv,"--output-page-size",String(a.pageSize),"--output-cursor",t],cwd:a.cwd,json:a.argv.some(o=>o==="--json"||o.startsWith("--json=")),sourceSession:!a.argv.some(o=>o==="--no-session"),agentOutput:a.argv.some(o=>o==="--agent-output"),pageSize:a.pageSize,cursor:t,snapshotRoot:n},()=>{throw new Error("Output continuation attempted to rerun the original command.")},s)}async function ye(t,e,n,s){let r=t.jsonOutputPath;if(r===void 0||r.length===0||Buffer.byteLength(r)>R||r.includes("\0"))throw new Error(`--json-output requires a path from 1 through ${R} UTF-8 bytes.`);let a=ee(t.cwd,r);if(Buffer.byteLength(a)>R)throw new Error(`The resolved --json-output path exceeds ${R} UTF-8 bytes.`);let o=new Z("utf8"),i=A("sha256"),c=0,h=0,d=l=>{if(h+=l.length,!Number.isSafeInteger(h)||h>s)throw new Error(H(s,!1))};wt(te(a),{recursive:!0});let g=`${a}.tmp-${yt(12).toString("hex")}`,p=Y(g,"wx",384),u=!0,O=Bt(l=>{let C=c+l.length;if(!Number.isSafeInteger(C)||C>dt)throw new Error(`JSON export exceeds the ${dt}-byte file safety limit. Narrow the query before retrying.`);if(d(o.write(l)),p===void 0)throw new Error("JSON export writer is closed.");we(p,l),i.update(l),c=C});try{await e(),d(o.end()),O(),N(p),p=void 0,St(g,a),u=!1}finally{if(O(),p!==void 0)try{N(p)}catch{}u&&Q(g,{force:!0})}let f={kind:ae,schemaVersion:ie,producer:{name:"scip-query",version:t.producerVersion},command:t.command,path:a,bytes:c,sha256:i.digest("hex")};n.writeStdout(`${JSON.stringify(f)}
|
|
4
|
+
`),x(t.command,t.cwd,!0,t.sourceSession!==!1),T(!0)}function we(t,e){let n=0;for(;n<e.length;){let s=vt(t,e,n,e.length-n);if(s<=0)throw new Error("JSON export write made no forward progress.");n+=s}}function H(t,e){let n=`Command output exceeds the ${t}-character safety limit. Narrow the query before retrying.`;return e?`${n} For the complete machine result, use --json --json-output <path> and inspect the file programmatically.`:n}function pn(t){if(!/^\d+$/u.test(t))throw new ht(`Output page size must be an integer from ${S} through ${E}.`);let e=Number(t);try{Lt(e)}catch{throw new ht(`Output page size must be an integer from ${S} through ${E}.`)}return e}function Lt(t){if(!Number.isSafeInteger(t)||t<S||t>E)throw new Error(`Output page size must be an integer from ${S} through ${E}.`)}async function Oe(t,e,n){let s=new G(B,t.maxOutputCharacters??m),r=process.stdout.write,a=!1,o=`${ut(`scip-query: JSON output exceeds the ${B}-byte client-safe budget and may be truncated by the client. Do not use possibly partial client output as evidence. Read every page with: ${Vt(Ft(t.invocationPrefix),ze(qt(t.argv)),V)}`)}
|
|
5
|
+
`;process.stdout.write=((i,c,h)=>{let d=s.push(i,c);return d!==void 0&&(a||(a=!0,n.writeStderr(o)),r.call(process.stdout,d)),tt(c,h),!0});try{await e();let i=s.finish();i.crossedPageBoundary&&!a&&(a=!0,n.writeStderr(o)),i.bytes.length>0&&r.call(process.stdout,i.bytes),a&&n.writeStderr(o),x(t.command,t.cwd,!0,t.sourceSession!==!1)}finally{process.stdout.write=r}}async function Se(t,e,n){let s=process.stdout.write,r=0;process.stdout.write=((a,o,i)=>{let c=Rt(a,o);if(r+=c.length,r>n)throw new Error(H(n,!1));return s.call(process.stdout,c),tt(o,i),!0});try{await e()}finally{process.stdout.write=s}x(t.command,t.cwd,!0,t.sourceSession!==!1),T(!0)}function Bt(t){let e=process.stdout.write;return process.stdout.write=((n,s,r)=>{let a=Rt(n,s);return t(a),tt(s,r),!0}),()=>{process.stdout.write=e}}function Rt(t,e){return typeof t=="string"?Buffer.from(t,typeof e=="string"?e:"utf8"):Buffer.from(t)}function tt(t,e){let n=typeof t=="function"?t:e;typeof n=="function"&&n()}var G=class{constructor(e,n){this.byteLimit=e;this.maxOutputCharacters=n}byteLimit;maxOutputCharacters;decoder=new Z("utf8");chunks=[];overflowed=!1;totalCharacters=0;totalBytes=0;push(e,n){let s=typeof e=="string"?Buffer.from(e,typeof n=="string"?n:"utf8"):Buffer.from(e);if(this.totalBytes+=s.length,this.addCharacters(this.decoder.write(s)),this.overflowed)return s;if(this.chunks.push(s),this.totalBytes<=this.byteLimit)return;this.overflowed=!0;let r=Buffer.concat(this.chunks);return this.chunks.length=0,r}finish(){this.addCharacters(this.decoder.end());let e=this.totalBytes>this.byteLimit,n=Buffer.concat(this.chunks);return this.chunks.length=0,{bytes:n,crossedPageBoundary:e}}addCharacters(e){if(this.totalCharacters+=e.length,!Number.isSafeInteger(this.totalCharacters)||this.totalCharacters>this.maxOutputCharacters)throw new Error(`Command output exceeds the ${this.maxOutputCharacters}-character safety limit. Narrow the query before retrying.`)}},W=class{constructor(e,n,s,r,a,o,i,c,h,d,g,p,u=H(i,!1)){this.invocationHash=e;this.invocationPrefix=n;this.command=s;this.cwd=r;this.argv=a;this.pageSize=o;this.maxOutputCharacters=i;this.pageContentByteLimit=c;this.snapshotRoot=h;this.limits=d;this.maxPages=g;this.preferLineBoundaries=p;this.overflowMessage=u;et(h);do this.snapshotId=yt(9).toString("base64url");while(this.snapshotId.startsWith("-"));this.temporaryPath=w(h,this.snapshotId,"tmp")}invocationHash;invocationPrefix;command;cwd;argv;pageSize;maxOutputCharacters;pageContentByteLimit;snapshotRoot;limits;maxPages;preferLineBoundaries;overflowMessage;snapshotId;temporaryPath;decoder=new Z("utf8");hash=A("sha256");pages=[];descriptor=null;pending="";firstPageContent="";totalCharacters=0;pageCharacterOffset=0;byteLength=0;reservedBytes=0;opened=!1;finished=!1;write(e){if(this.finished)throw new Error("Output snapshot writer is closed.");this.appendDecoded(this.decoder.write(e))}complete(){if(this.finished)throw new Error("Output snapshot writer is closed.");if(this.appendDecoded(this.decoder.end()),this.finished=!0,!this.opened){let r=this.pending,a=Buffer.from(r);return this.assertWithinByteLimit(a.length),this.hash.update(a),this.pending="",{content:r,totalCharacters:this.totalCharacters,outputHash:this.hash.digest("hex"),pageCount:1}}if((this.pending.length>0||this.pages.length===0)&&(this.flushPage(this.pending),this.pending=""),this.descriptor===null)throw new Error("Output snapshot writer is not open.");N(this.descriptor),this.descriptor=null;let e=this.hash.digest("hex"),n=w(this.snapshotRoot,this.snapshotId,"output"),s=w(this.snapshotRoot,this.snapshotId,"json");try{St(this.temporaryPath,n);let r={version:xt,snapshotId:this.snapshotId,invocationHash:this.invocationHash,invocationPrefix:[...this.invocationPrefix],command:this.command,cwd:this.cwd,argv:[...this.argv],outputHash:e,pageSize:this.pageSize,pages:this.pages,totalCharacters:this.totalCharacters,byteLength:this.byteLength,createdAtMs:Date.now()};return q(s,r),ft(this.snapshotRoot,this.snapshotId,this.byteLength,"complete",this.limits),this.reservedBytes=this.byteLength,{content:this.firstPageContent,totalCharacters:this.totalCharacters,outputHash:e,pageCount:this.pages.length,snapshotId:this.snapshotId}}catch(r){throw b(this.snapshotId,this.snapshotRoot),r}}abort(){this.descriptor!==null&&(N(this.descriptor),this.descriptor=null),this.finished=!0,b(this.snapshotId,this.snapshotRoot)}appendDecoded(e){if(e.length===0)return;let n=this.totalCharacters+e.length;if(!Number.isSafeInteger(n)||n>this.maxOutputCharacters)throw new Error(this.overflowMessage);for(this.totalCharacters=n,this.pending+=e,this.assertWithinByteLimit(this.byteLength+Buffer.byteLength(this.pending));this.pending.length>this.pageSize||Buffer.byteLength(this.pending)>this.pageContentByteLimit;){this.open();let s=Ue(this.pending,this.pageSize,this.pageContentByteLimit,this.preferLineBoundaries),r=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.flushPage(r)}}open(){if(!this.opened){Ee(this.snapshotRoot,this.snapshotId,0,this.limits);try{this.descriptor=Y(this.temporaryPath,"wx",384),this.opened=!0}catch(e){throw Te(this.snapshotRoot,this.snapshotId),e}}}flushPage(e){if(this.descriptor===null)throw new Error("Output snapshot writer is not open.");if(this.pages.length>=this.maxPages)throw new Error(`Command output requires more than ${this.maxPages} snapshot pages. Retry with a larger --output-page-size, narrow the query, or use --json --json-output <path>.`);let n=Buffer.from(e),s=this.byteLength+n.length;if(this.assertWithinByteLimit(s),s>this.reservedBytes){let o=Math.min(this.limits.maxSnapshotBytes,Math.ceil(s/gt)*gt);ft(this.snapshotRoot,this.snapshotId,o,"active",this.limits),this.reservedBytes=o}let r=0;for(;r<n.length;){let o=vt(this.descriptor,n,r,n.length-r);if(o<=0)throw new Error("Output snapshot write made no progress.");r+=o}let a={characterOffset:this.pageCharacterOffset,characterLength:e.length,byteOffset:this.byteLength,byteLength:n.length,hash:A("sha256").update(n).digest("hex")};this.pages.length===0&&(this.firstPageContent=e),this.pages.push(a),this.hash.update(n),this.pageCharacterOffset+=e.length,this.byteLength=s}assertWithinByteLimit(e){if(!Number.isSafeInteger(e)||e>this.limits.maxSnapshotBytes)throw new Error(`Command output exceeds the ${this.limits.maxSnapshotBytes}-byte snapshot limit. Narrow the query before retrying.`)}};function ve(t,e,n,s,r,a){et(r);let o=$t(t.snapshotId,r);if(o.invocationHash!==e)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");if(o.snapshotId!==t.snapshotId||t.version===3&&(o.invocationHash!==t.invocationHash||o.outputHash!==t.outputHash))throw new Error("Output snapshot identity does not match this cursor.");if(o.pageSize!==n||t.version===3&&t.pageSize!==n)throw new Error(`Output page size changed after this cursor was issued; use ${o.pageSize}.`);let i=o.pages[t.pageIndex];if(!i)throw new Error("Output cursor points past the current result.");if(o.totalCharacters>s)throw new Error(`Output snapshot exceeds the ${s}-character safety limit.`);if(Date.now()-o.createdAtMs>Tt)throw b(t.snapshotId,r),new Error("Output snapshot expired before all pages were read.");let c=w(r,t.snapshotId,"output"),h=Y(c,"r");try{let d=J(h);if(!d.isFile()||d.size!==o.byteLength)throw new Error("Output snapshot size or type changed.");let g=Buffer.allocUnsafe(i.byteLength),p=0;for(;p<g.length;){let f=Qt(h,g,p,g.length-p,i.byteOffset+p);if(f===0)break;p+=f,a?.(f)}let u=J(h);if(u.dev!==d.dev||u.ino!==d.ino||u.size!==d.size||p!==i.byteLength)throw new Error("Output snapshot changed while it was being read.");if(A("sha256").update(g).digest("hex")!==i.hash)throw new Error("Output snapshot page no longer matches its metadata.");let O=g.toString("utf8");if(O.length!==i.characterLength)throw new Error("Output snapshot page character count changed.");return{content:O,offset:i.characterOffset,pageIndex:t.pageIndex,pageCount:o.pages.length,totalCharacters:o.totalCharacters,outputHash:o.outputHash}}catch(d){throw b(t.snapshotId,r),d}finally{N(h)}}function $t(t,e){if(!v(t))throw new Error("Output snapshot identifier is invalid.");let n;try{n=JSON.parse(L(w(e,t,"json"),"output snapshot metadata"))}catch(s){throw new Error("Output snapshot is unavailable.",{cause:s})}if(!be(n))throw new Error("Output snapshot metadata is invalid.");return n}function be(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===xt&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&I(e.invocationHash)&&Jt(e.invocationPrefix)&&typeof e.command=="string"&&e.command.length>0&&e.command.length<=256&&typeof e.cwd=="string"&&e.cwd.length>0&&e.cwd.length<=8192&&je(e.argv)&&jt(e.command,e.cwd,e.invocationPrefix,e.argv)===e.invocationHash&&I(e.outputHash)&&Number.isSafeInteger(e.pageSize)&&(e.pageSize??0)>=S&&(e.pageSize??0)<=E&&Array.isArray(e.pages)&&e.pages.length>1&&e.pages.length<=It&&e.pages.every(Ce)&&Pe(e.pages)&&Number.isSafeInteger(e.totalCharacters)&&(e.totalCharacters??-1)>=0&&e.pages.reduce((n,s)=>n+s.characterLength,0)===e.totalCharacters&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??-1)>=0&&e.pages.reduce((n,s)=>n+s.byteLength,0)===e.byteLength&&Number.isSafeInteger(e.createdAtMs)&&(e.createdAtMs??-1)>=0}function Ce(t){if(!t||typeof t!="object")return!1;let e=t;return Number.isSafeInteger(e.characterOffset)&&(e.characterOffset??-1)>=0&&Number.isSafeInteger(e.characterLength)&&(e.characterLength??0)>0&&Number.isSafeInteger(e.byteOffset)&&(e.byteOffset??-1)>=0&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??0)>0&&I(e.hash)}function Pe(t){let e=0,n=0;for(let s of t){if(s.characterOffset!==e||s.byteOffset!==n)return!1;e+=s.characterLength,n+=s.byteLength}return!0}function et(t){wt(t,{recursive:!0,mode:448});let e=Yt(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Output snapshot root is not a private directory: ${t}`);if(typeof process.getuid=="function"&&e.uid!==process.getuid())throw new Error(`Output snapshot root is not owned by the current user: ${t}`);process.platform!=="win32"&&Xt(t,448)}function Ie(t){let e={...fe,...t};for(let[n,s]of Object.entries(e))if(!Number.isSafeInteger(s)||s<=0)throw new Error(`Output snapshot ${n} must be a positive integer.`);if(e.maxSnapshotBytes>e.maxAggregateBytes)throw new Error("Output snapshot maxSnapshotBytes cannot exceed maxAggregateBytes.");return e}function Ee(t,e,n,s){M(t,()=>{_e(t),Ht(t,e,n,"active",s)})}function ft(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);M(t,()=>{Ht(t,e,n,s,r)})}function Ht(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);let a=xe(t),o=a.find(g=>g.snapshotId===e),i=a.reduce((g,p)=>g+p.reservedBytes,0)-(o?.reservedBytes??0)+n,c=a.length+(o?0:1);if(c>r.maxSnapshotCount||i>r.maxAggregateBytes)throw new Error(`Output snapshot capacity is full (${c}/${r.maxSnapshotCount} snapshots, ${i}/${r.maxAggregateBytes} bytes). Narrow the query or finish an existing pagination sequence before retrying.`);let h=Date.now(),d={version:Nt,snapshotId:e,pid:process.pid,...X()?{processIdentity:X()}:{},reservedBytes:n,state:s,createdAtMs:o?.createdAtMs??h,updatedAtMs:h};q(w(t,e,"reserve"),d)}function Te(t,e){M(t,()=>{Q(w(t,e,"reserve"),{force:!0})})}function xe(t){let e=[];for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(v(s))try{let r=JSON.parse(L(U(t,n.name),"output snapshot reservation"));if(!Mt(r)||r.snapshotId!==s)throw new Error("reservation identity is invalid");e.push(r)}catch(r){throw new Error(`Output snapshot reservation ${n.name} is invalid; retry after its owning process or snapshot expires.`,{cause:r})}}return e}function Mt(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===Nt&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&Number.isSafeInteger(e.pid)&&(e.pid??0)>0&&(e.processIdentity===void 0||st(e.processIdentity)!==null&&e.processIdentity.pid===e.pid)&&Number.isSafeInteger(e.reservedBytes)&&(e.reservedBytes??-1)>=0&&(e.state==="active"||e.state==="complete")&&Number.isSafeInteger(e.createdAtMs)&&Number.isSafeInteger(e.updatedAtMs)}function _e(t){let e=Date.now();for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(!v(s))continue;let r=null;try{let c=JSON.parse(L(U(t,n.name),"output snapshot reservation"));r=Mt(c)?c:null}catch{r=null}let a=Ae(w(t,s,"json")),o=r?.state==="active"&&rt(r.pid)&&(r.processIdentity===void 0||(()=>{let c=j(r.pid);return c!==null&&ot(r.processIdentity,c)})()),i=r?e-r.updatedAtMs>Tt:!1;o||a&&!i||!a&&r&&!i&&r.state==="complete"||kt(s,t)}}function Ae(t){try{return Zt(t),!0}catch{return!1}}function M(t,e){et(t);let n=U(t,pe),s=Date.now()+he;for(;;){let r=at(n,{kind:"output-snapshot-quota",processIdentity:X()});if(r.kind==="acquired")try{return e()}finally{r.lock.release()}if(Date.now()>=s)throw new Error("Output snapshot quota is busy. Retry the command.");Atomics.wait(ge,0,0,de)}}function X(){return F===void 0&&(F=j(process.pid)),F}function b(t,e){v(t)&&M(e,()=>kt(t,e))}function kt(t,e){for(let n of["json","output","tmp","reserve"])Q(w(e,t,n),{force:!0})}function w(t,e,n){if(!v(e))throw new Error("Output snapshot identifier is invalid.");return U(t,`${e}.${n}`)}function Ne(t){if(!t)throw new Error("Incomplete output did not create a resumable snapshot.");return t}function lt(t){return t>=55296&&t<=56319}function Ue(t,e,n,s){let r=Math.min(t.length,e);if(lt(t.charCodeAt(r-1))&&(r-=1),Buffer.byteLength(t.slice(0,r))>n){let a=0,o=r;for(;a<o;){let i=Math.ceil((a+o)/2);Buffer.byteLength(t.slice(0,i))<=n?a=i:o=i-1}r=a,lt(t.charCodeAt(r-1))&&(r-=1)}if(r<=0)throw new Error("Output page byte limit cannot contain one UTF-8 character.");if(s){let a=t.lastIndexOf(`
|
|
6
|
+
`,r-1);if(a>=0)return a+1}return r}function Le(t){let e=Re({pageIndex:t.nextPageIndex,snapshotId:t.snapshotId});return{cursor:e,command:Dt(t.invocationPrefix,e)}}function Be(t,e){let n="c".repeat(64),s={cursor:n,command:Dt(e,n)};if(!t.json){let o="9".repeat(String(m).length),i=`[scip-query output page: characters ${o}-${o} of ${o}]
|
|
7
|
+
|
|
8
|
+
[Incomplete: ${o} characters remain. Continue exactly:
|
|
9
|
+
${s.command}]
|
|
10
|
+
`;return mt(it,Buffer.byteLength(i),1)}let r={kind:bt,schemaVersion:Ct,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:"application/json",agentInstruction:"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.",page:{offset:m,returnedCharacters:m,totalCharacters:m,omittedCharacters:m,remainingCharacters:m,complete:!1,outputHash:"f".repeat(64),continuation:s},content:""},a=Buffer.byteLength(`${JSON.stringify(r)}
|
|
11
|
+
`);return mt(D,a,2)}function mt(t,e,n){let s=Math.floor((B-e)/n);if(s<S)throw new Error(`The command invocation leaves fewer than ${S} bytes for client-safe output content. Use a shorter executable path.`);return Math.min(t,s)}function Re(t){return At.test(t.snapshotId)?t.pageIndex===1?t.snapshotId:`${t.snapshotId}.${t.pageIndex.toString(36)}`:`4.${Me(t.snapshotId)}.${t.pageIndex.toString(36)}`}function $e(t,e){let n=zt(t);if(!n)throw new Error("Invalid output cursor. Run the command again without --output-cursor.");if(n.version===3&&n.invocationHash!==e)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");return n}function zt(t){let e=ce.exec(t);if(e){let s=e[2]??"1",r=Number.parseInt(s,36);return Number.isSafeInteger(r)&&r>=1&&r.toString(36)===s?{version:4,pageIndex:r,snapshotId:e[1]}:null}let n=ue.exec(t);if(n){let s=ke(n[1]),r=Number.parseInt(n[2],36);return s&&Number.isSafeInteger(r)&&r>=1&&r.toString(36)===n[2]?{version:4,pageIndex:r,snapshotId:s}:null}try{let s=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return He(s)?s:null}catch{return null}}function He(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===3&&I(e.invocationHash)&&Number.isSafeInteger(e.pageIndex)&&(e.pageIndex??-1)>=1&&Number.isSafeInteger(e.pageSize)&&(e.pageSize??0)>=S&&(e.pageSize??0)<=E&&I(e.outputHash)&&typeof e.snapshotId=="string"&&v(e.snapshotId)}function Me(t){if(!K.test(t))throw new Error("Output snapshot identifier is invalid.");return Buffer.from(t.replaceAll("-",""),"hex").toString("base64url")}function ke(t){let e=Buffer.from(t,"base64url");if(e.length!==16)return null;let n=e.toString("hex"),s=`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`;return K.test(s)?s:null}function v(t){return typeof t=="string"&&(At.test(t)||K.test(t))}function jt(t,e,n,s){return A("sha256").update(JSON.stringify({command:t,cwd:e,invocationPrefix:n,argv:s})).digest("hex")}function qt(t){let e=[];for(let n=0;n<t.length;n+=1){let s=t[n];if(s==="--output-page-size"||s==="--output-cursor"){n+=1;continue}s.startsWith("--output-page-size=")||s.startsWith("--output-cursor=")||e.push(s)}return e}function ze(t){return t.filter(e=>e!=="--raw-json"&&e!=="--raw-json=true")}function Vt(t,e,n){return Gt([...t,...e,"--output-page-size",String(n)])}function Dt(t,e){return Gt([...t,ne,e])}function Ft(t){let e=t===void 0?["scip-query"]:[...t];if(!Jt(e))throw new Error("Output pagination invocation prefix must contain one to sixteen non-empty shell arguments.");return e}function Jt(t){return Array.isArray(t)&&t.length>0&&t.length<=16&&t.every(e=>typeof e=="string"&&e.length>0&&e.length<=2048&&!e.includes("\0")&&!e.includes("\r")&&!e.includes(`
|
|
12
|
+
`))}function je(t){return Array.isArray(t)&&t.length>0&&t.length<=256&&t.every(e=>typeof e=="string"&&e.length<=8192&&!e.includes("\0")&&!e.includes("\r")&&!e.includes(`
|
|
13
|
+
`))}function Gt(t){return t.map(e=>pt(e,{omitSafeQuotes:!0})).join(" ")}function qe(t){let e=t.page.continuation,n=Math.max(t.page.offset,t.page.offset+t.page.returnedCharacters-1),s=`[scip-query output page: characters ${t.page.offset}-${n} of ${t.page.totalCharacters}]
|
|
14
|
+
`,r=e?`
|
|
15
|
+
[Incomplete: ${t.page.remainingCharacters} characters remain. Continue exactly:
|
|
16
|
+
${e.command}]
|
|
17
|
+
`:`
|
|
18
|
+
[scip-query transport complete; evaluate command coverage separately]
|
|
19
|
+
`;return`${s}${t.content}${r}`}export{ne as a,le as b,cn as c,pn as d};
|
|
20
|
+
//# sourceMappingURL=chunk-3D4BOXW6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V,b as C}from"./chunk-BJT7LSPK.js";import{a as I}from"./chunk-
|
|
1
|
+
import{a as V,b as C}from"./chunk-BJT7LSPK.js";import{a as I}from"./chunk-MWN53KRN.js";import{$ as k}from"./chunk-7HXT6YLU.js";import{a as v,b,g as m}from"./chunk-7F45LJKI.js";import Re from"better-sqlite3";import{existsSync as tn}from"fs";import{dirname as on,join as sn,resolve as Se}from"path";import H from"better-sqlite3";import{execFileSync as W}from"child_process";import{existsSync as B,readdirSync as G}from"fs";import{extname as R,join as U}from"path";function De(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>K({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function K(e){let n=new Set((e.extensions??V).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!B(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=I(e.projectRoot),t=J(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new H(e.dbPath);try{let i=Y(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let f of l){if(i.has(f))continue;let p=k(e.projectRoot,f,{inputKind:"auxiliary source file"}),$=s.run(q(f),f,p);d+=Number($.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function J(e,n){let r=X(e,n);if(r)return r;let t=[],o=i=>{let s=i?U(e,i):e,a;try{a=G(s,{withFileTypes:!0})}catch{return}for(let u of a){if(C.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(R(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function X(e,n){try{return W("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
3
3
|
`).filter(t=>t&&n.has(R(t).toLowerCase())).sort()}catch{return null}}function Y(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function q(e){return R(e).toLowerCase()===".vue"?"vue":R(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as _e}from"fs";function je(e,n){let r=performance.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}async function $e(e,n){let r=performance.now(),t=await e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}function z(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:z(),skippedReferenceSamples:[]}}function F(e,n){e.skippedReferences+=n.skippedReferences;for(let r of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[r]+=n.skippedReferenceReasons[r];for(let t of n.skippedReferenceSamples.filter(o=>o.reason===r))e.skippedReferenceSamples.filter(i=>i.reason===r&&i.sourceFile===t.sourceFile).length<2&&e.skippedReferenceSamples.push(t)}}import{createRequire as Q}from"module";import{existsSync as Z}from"fs";import{dirname as T,extname as ee,join as L,relative as ne,resolve as Ke}from"path";import{pathToFileURL as te}from"url";function E(e,n){let{vueCore:r,ts:t,volarTs:o}=re(e),{parsed:i,vueOptions:s}=oe(r,t,n),a=T(n),u=r.createVueLanguagePlugin(t,i.options,s,p=>p),c=ie(r,t,u),l=se(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,p=>p,l),f=t.createLanguageService(d);return{ts:t,language:c,languageService:f,fileNames:i.fileNames,configDir:a}}function re(e){let n=Q(te(L(e,"package.json")).href);return{vueCore:h(n,"@vue/language-core",e),ts:h(n,"typescript",e),volarTs:h(n,"@volar/typescript",e)}}function oe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,T(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function ie(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!Z(i))return;let s=m(i,{maxBytes:b,inputKind:"Vue language-service source file"});t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??le(i))});return t.current=o,o}function se(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function h(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function A(e,n,r){let t=ae(e);return o=>{if(!o.name)return null;let i=g(n,o.fileName),s=r.get(o.fileName);if(!s)return null;let a=r.positionAt(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.starts.find(d=>d.line===a.line&&d.displayName===o.name);if(c)return c.symbolId;let l=u.containingByLine.get(a.line);return l&&l.displayName===o.name?l.symbolId:ue(u.starts,a.line,2,o.name)}}function ae(e){let n=e.prepare(`
|
|
4
4
|
SELECT
|
|
@@ -13,4 +13,4 @@ import{a as V,b as C}from"./chunk-BJT7LSPK.js";import{a as I}from"./chunk-NRBNAE
|
|
|
13
13
|
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
14
14
|
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function ue(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function P(e,n){let r=ge(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=fe(t,r,n,i);return o.set(i,s),s}}}function O(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(y(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*w(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function D(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function y(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function ce(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function N(e,n){return g(e,n).startsWith("node_modules/")}function g(e,n){return ne(e,n).replaceAll("\\","/")}function le(e){switch(ee(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function M(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let r=m(n,{maxBytes:b,inputKind:"Vue source file"}),t={text:r,lineStarts:de(r)};return e.set(n,t),t}catch{return e.set(n,null),null}},positionAt:ce}}function de(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function ge(e){try{let n=JSON.parse(m(L(e,"package.json"),{maxBytes:v,inputKind:"project package manifest"}));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function fe(e,n,r,t){let o=g(r,t),i=pe(n.name,n.version,o);return e.get(i)?.id??null}function pe(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}function cn(e){let n=Se(e.projectRoot,e.tsconfig),r=new Re(e.dbPath,{readonly:!0});try{let t=be({db:r,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:P(r,e.projectRoot)});return he({vueFiles:e.vueFiles??[],tasks:e.tasks,...t})}finally{r.close()}}function be(e){let n=M();return{projectRoot:e.projectRoot,context:E(e.projectRoot,e.configPath),symbolLookup:A(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function he(e){let n=[],r=S(),t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=ye(e,o);n.push(...i.occurrences),F(r,i)}return{occurrences:n,...r}}function ye(e,n){let r=e.sourceReader.get(n.fileName);if(!r)return _(e.projectRoot,n,"missing-source-file");let t=e.context.language.scripts.get(n.fileName),o=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!o)return _(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,t),s=g(e.projectRoot,n.fileName),a=[...w(r.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Ce(a),processedStarts:new Set};return xe({...e,fileName:n.fileName,sourceInfo:r,sourceFile:s,map:i,tokenContext:u})}function xe(e){let n=[],r=S();for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start)||ve(e.sourceInfo.text,t.start))continue;let o=D(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!N(e.projectRoot,l.fileName));if(!s){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"no-definition");continue}let a=g(e.projectRoot,s.fileName),u=ke(e.sourceFile,t.text,a);if(u){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,u);continue}let c=O(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"unindexed-definition");continue}j(n,e.sourceReader,e.sourceInfo,e.sourceFile,t,a,c),e.tokenContext.processedStarts.add(t.start),Ve(n,e,t,o,a,c)}return{occurrences:n,...r}}function ve(e,n){let r=e.lastIndexOf(`
|
|
15
15
|
`,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function ke(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function _(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function x(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ve(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of Ie(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let a=n.tokenContext.tokenByStart.get(s);a&&(j(e,n.sourceReader,n.sourceInfo,n.sourceFile,a,o,i),n.tokenContext.processedStarts.add(s))}}function j(e,n,r,t,o,i,s){let a=n.positionAt(r,o.start);e.push({sourceFile:t,sourceLine:a.line,sourceStartChar:a.character,sourceEndChar:a.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Ce(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Ie(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Fe(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Fe(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=y(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}export{De as a,je as b,$e as c,cn as d};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-3LO4FST5.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as d}from"./chunk-ILMHV3KM.js";import{a as A,b as T,c as v,g as P,j as R}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-ILMHV3KM.js";import{a as A,b as T,c as v,g as P,j as R}from"./chunk-C4RHHCKL.js";import{d as g,e as L,f as p,g as M,h as k}from"./chunk-ODPDP7A4.js";import{$ as I,aa as z}from"./chunk-7HXT6YLU.js";import c from"process";import{existsSync as _}from"fs";import{dirname as h,join as J,resolve as b,sep as N}from"path";import{fileURLToPath as K}from"url";async function G(e){let n=e.includeReferences!==!1,r=e.includeCallees===!0,t=e.includeSignatures===!0,s={timeoutMs:e.requestTimeoutMs},o=Q(e),a=W(e),l=H(e),f=j(e),C=re(e.projectRoot,o),x=te(e.projectRoot,C),w=ne(C),u=new T(v(e.rustAnalyzerBinary,x),{requestTimeoutMs:e.requestTimeoutMs,configuration:w});try{let y=await u.initialize({processId:c.pid,rootUri:g(x,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:w});if(n&&!y.capabilities.referencesProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/references support.",references:a.map(i=>[i.symbolId,[]]),...r?{callees:l.map(i=>[i.symbolId,[]])}:{}};if(r&&!y.capabilities.callHierarchyProvider)return{available:!1,reason:"rust-analyzer initialized without call hierarchy support.",references:a.map(i=>[i.symbolId,[]]),callees:l.map(i=>[i.symbolId,[]]),...t?{signatures:f.map(i=>[i.symbolId,null])}:{}};if(t&&!y.capabilities.hoverProvider)return{available:!1,reason:"rust-analyzer initialized without hover support.",references:a.map(i=>[i.symbolId,[]]),...r?{callees:l.map(i=>[i.symbolId,[]])}:{},signatures:f.map(i=>[i.symbolId,null])};let $=ie(u,e.projectRoot,o);await se(u,$,e.diagnosticsTimeoutMs??1e4),await R(e.settleDelayMs??5e3);let S=n?await d(a,e.concurrency??8,async i=>{let D=await E(u,p(e.projectRoot,i,!1),{requestTimeoutMs:e.requestTimeoutMs,retryTimeoutMs:e.referenceRetryTimeoutMs});return{symbolId:i.symbolId,references:k(M(e.projectRoot,D.locations)),complete:D.complete}}):a.map(i=>({symbolId:i.symbolId,references:[],complete:!0})),B=r?await d(l,e.concurrency??8,async i=>({symbolId:i.symbolId,callees:await ae(u,e.projectRoot,i,s)})):[],U=t?await d(f,e.concurrency??8,async i=>({symbolId:i.symbolId,signature:await V(u,e.projectRoot,i,s)})):[];return{available:!0,references:S.filter(i=>i.complete).map(i=>[i.symbolId,i.references]),incompleteReferenceSymbolIds:S.filter(i=>!i.complete).map(i=>i.symbolId),...r?{callees:B.map(i=>[i.symbolId,i.callees])}:{},...t?{signatures:U.map(i=>[i.symbolId,i.signature])}:{}}}finally{await u.shutdown().catch(()=>{})}}function W(e){return e.referenceDefinitions??e.definitions}function H(e){return e.calleeDefinitions??e.definitions}function j(e){return e.signatureDefinitions??e.definitions}function Q(e){return[...e.includeReferences!==!1?W(e):[],...e.includeCallees===!0?H(e):[],...e.includeSignatures===!0?j(e):[]]}async function V(e,n,r,t={}){let s=p(n,r,!1),o=await X(e,{textDocument:s.textDocument,position:s.position},t);return Y(o)}async function X(e,n,r={}){try{return await e.hover(n,r)}catch(t){if(m(t),!(t instanceof Error?t.message:String(t)).includes("content modified"))return null;await F(r.deadlineMs);try{return await e.hover(n,r)}catch(o){return m(o),null}}}function Y(e){if(!e)return null;let n=Z(e.contents),r=/```(?:rust)?\s*([\s\S]*?)```/i.exec(n),t=r?r[1]:n;for(let s of t.split(/\r?\n/)){let o=s.replace(/^`+|`+$/g,"").trim();if(o&&ee(o))return o}return null}function Z(e){return typeof e=="string"?e:Array.isArray(e)?e.map(q).join(`
|
|
2
2
|
`):"value"in e?e.value:""}function q(e){return typeof e=="string"?e:e.value}function ee(e){return/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?(?:fn|struct|enum|trait|type|const|static|mod)\b/.test(e)}function ne(e){return{...e.length>0?{linkedProjects:e}:{},references:{excludeImports:!1,excludeTests:!1}}}function te(e,n){return n.length===1?h(n[0]):b(e)}function re(e,n){let r=b(e),t=[],s=new Set;for(let o of n){let a=h(b(r,o.relativePath));for(;me(r,a);){let l=J(a,"Cargo.toml");if(_(l)){s.has(l)||(s.add(l),t.push(l));break}let f=h(a);if(f===a)break;a=f}}return t}function ie(e,n,r){let t=new Set,s=[];for(let o of r)if(!t.has(o.relativePath)){t.add(o.relativePath);try{let a=g(n,o.relativePath);e.didOpenTextDocument({uri:a,languageId:"rust",version:1,text:I(n,o.relativePath,{inputKind:"indexed Rust source file"})}),s.push(a)}catch(a){if(!z(a))throw a}}return s}async function se(e,n,r){await Promise.all(n.map(t=>e.waitForDiagnostics(t,r).catch(()=>!1)))}async function De(e,n){return(await E(e,n)).locations}async function E(e,n,r={}){try{return{locations:await e.references(n,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(t){m(t);let s=t instanceof Error?t.message:String(t);if(O(t))return{locations:[],complete:!1};if(!s.includes("content modified"))return{locations:[],complete:!0};await F(r.deadlineMs);try{return{locations:await e.references(n,oe(r)),complete:!0}}catch(o){return m(o),{locations:[],complete:!O(o)}}}}function oe(e){return{...e.retryTimeoutMs&&e.retryTimeoutMs>0?{timeoutMs:e.retryTimeoutMs}:{},...e.deadlineMs!==void 0?{deadlineMs:e.deadlineMs}:{}}}function O(e){let n=e instanceof Error?e.message:String(e);return n.includes("rust-analyzer LSP request")&&n.includes("timed out after")}async function ae(e,n,r,t={}){let s=p(n,r,!1),o=await le(e,{textDocument:s.textDocument,position:s.position},t),a=(await Promise.all(o.map(l=>ce(e,l,t)))).flat();return fe(ue(n,a))}async function le(e,n,r={}){try{return await e.prepareCallHierarchy(n,r)}catch(t){return m(t),[]}}async function ce(e,n,r={}){try{return await e.outgoingCalls(n,r)}catch(t){return m(t),[]}}async function F(e){if(e===void 0){await R(1e3);return}await P(1e3,e)}function m(e){if(e instanceof A)throw e}function ue(e,n){return n.map(r=>({symbol:r.to.name,file:L(e,r.to.uri),line:r.to.selectionRange.start.line,...r.fromRanges[0]===void 0?{}:{callsiteLine:r.fromRanges[0].start.line}}))}function fe(e){let n=new Set,r=[];for(let t of e){let s=`${t.symbol}\0${t.file}\0${t.line}\0${t.callsiteLine??""}`;n.has(s)||(n.add(s),r.push(t))}return r.sort((t,s)=>t.file.localeCompare(s.file)||t.line-s.line||t.symbol.localeCompare(s.symbol))}function me(e,n){return n===e||n.startsWith(`${e}${N}`)}async function de(){return new Promise((e,n)=>{let r=[];c.stdin.on("data",t=>r.push(t)),c.stdin.on("error",n),c.stdin.on("end",()=>e(Buffer.concat(r).toString("utf8")))})}async function pe(){try{let e=JSON.parse(await de()),n=await G(e);c.stdout.write(JSON.stringify(n))}catch(e){let n={available:!1,reason:e instanceof Error?e.message:String(e),references:[]};c.stdout.write(JSON.stringify(n)),c.exitCode=1}}c.argv[1]&&K(import.meta.url)===c.argv[1]&&pe();export{G as a,W as b,H as c,j as d,Q as e,V as f,X as g,Y as h,ne as i,te as j,re as k,ie as l,se as m,De as n,E as o,ae as p};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-3WTY4LP2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-NSM5IEVW.js";import{c as l}from"./chunk-2BMSSRBH.js";import{d as o,i}from"./chunk-C7C6AKAT.js";function _(e,t){let r=a(e,t);return r.length===0?[]:u([...c(e,r),...f(e,r)]).filter(s=>!e.isIgnored(s.relative_path)).map(d)}function R(e,t){let r=a(e,t);return r.length===0?[]:u(c(e,r)).filter(s=>!e.isIgnored(s.relative_path)).map(s=>({...d(s),basis:"external-reference"}))}function c(e,t){let r=t.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -26,4 +26,4 @@ import{b as a}from"./chunk-56NQAEPJ.js";import{d as l}from"./chunk-SVHTMVA4.js";
|
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
28
|
ORDER BY d1.relative_path`,...t,...t,...t)}function f(e,t){let r=new l(e);return t.flatMap(s=>r.definitionsForFile(s).filter(n=>i(n.symbol)).map(n=>({relative_path:s,symbol:n.symbol})))}function u(e){let t=new Set;return e.filter(r=>{let s=`${r.relative_path}|${r.symbol}`;return t.has(s)?!1:(t.add(s),!0)})}function d(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:o(e.symbol)}}export{_ as a,R as b};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-3Z5AMSK6.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as o}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{c as o}from"./chunk-3D4BOXW6.js";import{_ as n}from"./chunk-2XWIUW5Z.js";async function i(t){if(typeof t!="string"||t.length===0)throw new Error("Output continuation requires a cursor.");await o(t,n)}var u={id:"continue",command:"continue <cursor>",hidden:!0,description:"Continue an immutable output snapshot",renderShape:"custom",handler:i};export{u as a};
|
|
3
|
+
//# sourceMappingURL=chunk-44IETFOU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as t}from"./chunk-JZ2A7LDM.js";var e=/(?:^|\/)(?:migrations?\/meta\/|drizzle\/meta\/|prisma\/migrations\/|__generated__\/|generated\/)|(?:^|\/)(?:_journal\.json|migration_lock\.toml)$|(?:^|\/)[^/]*(?:snapshot|\.generated|\.gen)\.[a-z0-9]+$|(?:^|\/)(?:migrations?|drizzle)\/[^/]+\.sql$|(?:^|\/)(?:migrations?|drizzle)\/(?:schema|relations)\.[cm]?[jt]s$/i;function i(a){return e.test(t(a))}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4FR6GQIT.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as x,b as R,c as L}from"./chunk-ZMCQIHI4.js";import{d as C}from"./chunk-B3X6KU75.js";import{Q as g}from"./chunk-ZLMXIQLC.js";function j(n,e={}){return v(n,e).results}function v(n,e={}){let{minComponentLines:o=300,minFileLines:i=800,minJsxTokens:l=80,minBehaviorTokens:r=40,limit:s=20,scope:a,scanLimit:c,filePattern:p}=e,d=x(n),f=new R;return{results:g(n).reactProfiles({scope:a,scanLimit:c}).filter(t=>t.kind==="component").filter(t=>!p||t.file.includes(p)||t.name.includes(p)).map(t=>k(t,{minComponentLines:o,minFileLines:i,minJsxTokens:l,minBehaviorTokens:r})).filter(t=>t!==null).filter(t=>{let u=d.roleOf(t.file);return u==="test"?(f.record("test-files",L.testFiles),!1):u==="ui-kit"?(f.record("ui-kit-files",L.uiKitFiles),!1):!0}).sort((t,u)=>u.componentLines-t.componentLines||u.fileLines-t.fileLines||t.file.localeCompare(u.file)).slice(0,s),exclusions:f.list()}}function k(n,e){let o=Math.max(1,Math.floor(e.minComponentLines/2)),i=C(n,T({minComponentLines:e.minComponentLines,minFileLines:e.minFileLines,minJsxTokens:e.minJsxTokens,minBehaviorTokens:e.minBehaviorTokens,substantialComponentLines:o}),"component"),{reasons:l}=i;if(l.length===0)return null;let r=i.dominantPressure,s=i.pressureKinds,a=h(n),c=w(r,s,a);return{file:n.file,component:n.name,componentLines:n.loc,fileLines:n.fileLines,jsxTokens:n.jsxTokens.size,behaviorTokens:n.behaviorTokens.size,dominantPressure:r,pressureKinds:s,contextKind:a,recommendationKind:c,recommendation:S(c,a),reasons:l,loc:n.loc}}function T(n){return[{axis:"component",value:e=>e.loc,qualifies:(e,o)=>o>=n.minComponentLines,reason:(e,o)=>`${o} component line(s)`},{axis:"file",value:e=>e.fileLines,qualifies:(e,o)=>o>=n.minFileLines&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} file line(s)`},{axis:"jsx-structure",value:e=>e.jsxTokens.size,weightedValue:(e,o)=>o*3,qualifies:(e,o)=>o>=n.minJsxTokens&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} JSX structure token(s)`},{axis:"hook-behavior",value:e=>e.behaviorTokens.size,weightedValue:(e,o)=>o*4,qualifies:(e,o)=>o>=n.minBehaviorTokens&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} behavior token(s)`}]}function h(n){let e=n.file.split(/[\\/]+/).filter(Boolean),o=e.slice(0,-1).map(m=>m.toLowerCase()),i=(e.at(-1)??n.name).replace(/\.[^.]+$/,""),r=o.findIndex(m=>_.has(m))>=0,s=o.some(m=>O.has(m));if(b(i)||b(n.name))return"component";let c=E.has(i.toLowerCase()),p=/(?:Page|Route|Screen)$/.test(n.name),d=r&&/View$/.test(n.name),f=!s&&i.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()===n.name.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()&&/(?:Page|Route|Screen|View)$/.test(i);return c||p||d||f?"route-page":"component"}function b(n){let e=n.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return e.at(-1)&&P.has(e.at(-1))?!0:[...P].some(o=>n.endsWith(A(o)))}function w(n,e,o){return n==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":e.includes("hook-behavior")?"behavior-extraction":e.includes("jsx-structure")?"jsx-decomposition":e.includes("file")?"file-decomposition":n==="jsx-structure"?"jsx-decomposition":n==="file"&&!e.includes("component")?"file-decomposition":"component-decomposition"}function S(n,e){switch(n){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return e==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var O=new Set(["component","components","panel","panels","partial","partials"]),P=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),_=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),E=new Set(["page","route","screen"]);function A(n){return n.charAt(0).toUpperCase()+n.slice(1)}export{j as a,v as b};
|
|
2
|
+
//# sourceMappingURL=chunk-4KBTHJLP.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ie,i as De,j as W}from"./chunk-CZW5MZ5B.js";import{c as we,h as Ae}from"./chunk-ODPDP7A4.js";import{a as Me,e as he,i as Ee}from"./chunk-BL6DCHQP.js";import{d as A,f as k,h as ke,j as q,k as U,l as xe}from"./chunk-T3CZAZSI.js";import{a as be}from"./chunk-B3PYOSCX.js";import{a as S,c as ye,d as M,e as p,f as Q,g as J,i as Se}from"./chunk-H5EXS3HM.js";import{a as C,e as X,g as v}from"./chunk-HGFDYOVB.js";import{a as fe,b as Re,c as me,d as w}from"./chunk-JFMEXGFE.js";import{da as ge}from"./chunk-7HXT6YLU.js";import{a as ce,b as E,c as de,f as pe,g as x,l as $}from"./chunk-7F45LJKI.js";import{createHash as cn}from"crypto";import{resolve as dn}from"path";var b=3;function F(e){return cn("sha256").update(A({kind:"scip-query-durable-rust-mailbox",protocolVersion:b,sessionDir:dn(e)})).digest("hex")}function pn(e,n){if(!S(e)||typeof e.id!="string"||!e.id)return T("Durable Rust semantic helper received an invalid mailbox request.");if(e.id!==n.claimRequestId)return T("Durable Rust semantic request identity does not match its mailbox path.");if(e.protocolVersion===void 0){if(e.mailboxVersion!==void 0||e.operationKey!==void 0||e.clientId!==void 0||e.enqueuedAtMs!==void 0||e.deadlineAtMs!==void 0||e.sessionIdentity!==void 0)return T("Durable Rust semantic helper received a partially versioned request without a protocol version.");let s=_e(e.request);if(!s)return T("Durable Rust semantic helper received an invalid legacy request kind or payload.");let i=n.nowMs+Math.max(1,s.timeoutMs);return{ok:!0,compatibility:"legacy-v2",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:q("rust-semantic-v2",{id:e.id,request:s}),clientId:"legacy-v2",enqueuedAtMs:n.nowMs,deadlineAtMs:i,sessionIdentity:n.sessionIdentity,request:s}}}let t=fn(e,n);if(!t.ok)return t;if(e.protocolVersion!==b)return{ok:!1,code:"unsupported-protocol",error:`Durable Rust semantic helper does not support mailbox protocol ${String(e.protocolVersion)}.`,responseIdentity:t.responseIdentity};let r=_e(e.request);return r?t.operationKey!==q("rust-semantic-v3",r)?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a mismatched mailbox operation identity.",responseIdentity:t.responseIdentity}:t.deadlineAtMs-t.enqueuedAtMs!==r.timeoutMs?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a deadline that does not match the request timeout.",responseIdentity:t.responseIdentity}:t.deadlineAtMs<n.nowMs?{ok:!1,code:"expired-request",error:"Durable Rust semantic request expired before processing.",responseIdentity:t.responseIdentity}:{ok:!0,compatibility:t.priorSessionIdentity?"prior-v3":"current-v3",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:t.operationKey,clientId:t.clientId,enqueuedAtMs:t.enqueuedAtMs,deadlineAtMs:t.deadlineAtMs,sessionIdentity:n.sessionIdentity,request:r}}:{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received an invalid request kind or payload.",responseIdentity:t.responseIdentity}}function ne(e,n){return S(e)?e.protocolVersion!==b?ve(e.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(e.protocolVersion)}`):e.mailboxVersion!==k||e.id!==n.requestId||e.operationKey!==n.operationKey||e.sessionIdentity!==n.sessionIdentity||e.deadlineAtMs!==n.deadlineAtMs?ve("helper wrote an incompatible response identity"):typeof e.completedAtMs!="number"||!Number.isFinite(e.completedAtMs)||e.completedAtMs>n.deadlineAtMs||n.nowMs>n.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:e.ok===!1?typeof e.error!="string"||!In(e.errorCode)?Z("helper wrote an invalid rejection response"):{ok:!1,code:e.errorCode,error:e.error}:e.ok!==!0||e.session!=="created"&&e.session!=="reused"&&e.session!=="invalidated"||!Sn(e.response,n.requestKind)?Z("helper wrote an invalid success response"):{ok:!0,session:e.session,response:e.response}:Z("helper wrote an invalid response object")}function fn(e,n){if(e.mailboxVersion!==k||typeof e.protocolVersion!="number"||!Number.isInteger(e.protocolVersion)||typeof e.operationKey!="string"||!J(e.operationKey)||e.id!==U(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||!J(e.sessionIdentity))||e.sessionIdentity===void 0&&e.protocolVersion!==b)return T("Durable Rust semantic helper received an invalid mailbox lifecycle.");let t={id:n.claimRequestId,sessionIdentity:n.sessionIdentity,deadlineAtMs:e.deadlineAtMs};return e.sessionIdentity!==void 0&&e.sessionIdentity!==n.sessionIdentity?{ok:!1,code:"malformed-request",error:"Durable Rust semantic request belongs to a different mailbox session.",responseIdentity:t}:{ok:!0,responseIdentity:t,operationKey:e.operationKey,clientId:e.clientId,enqueuedAtMs:e.enqueuedAtMs,deadlineAtMs:e.deadlineAtMs,priorSessionIdentity:e.sessionIdentity===void 0}}function _e(e){return!S(e)||typeof e.identityKey!="string"||!e.identityKey||!Q(e.timeoutMs)||e.workerEnvironment!==void 0&&!ye(e.workerEnvironment)?null:e.kind==="semantic"&&Rn(e.request)?{kind:"semantic",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:e.kind==="import-definitions"&&mn(e.request)?{kind:"import-definitions",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:null}function Rn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!Te(e.definitions)?!1:G(e.referenceDefinitions)&&G(e.calleeDefinitions)&&G(e.signatureDefinitions)&&I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.referenceRetryTimeoutMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)&&ee(e.includeReferences)&&ee(e.includeCallees)&&ee(e.includeSignatures)}function mn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!M(e.file)||!Array.isArray(e.positions)||!e.positions.every(n=>S(n)&&M(n.id)&&M(n.file)&&p(n.line)&&p(n.column))?!1:I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)}function Te(e){return Array.isArray(e)&&e.every(yn)}function G(e){return e===void 0||Te(e)}function yn(e){return S(e)&&p(e.symbolId)&&p(e.documentId)&&p(e.startLine)&&qe(e.startChar)&&p(e.endLine)&&qe(e.endChar)&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&(e.parentTypeName===null||typeof e.parentTypeName=="string")&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(e.kind===null||Number.isSafeInteger(e.kind))&&(e.documentation===null||typeof e.documentation=="string")&&(e.enclosingSymbol===null||typeof e.enclosingSymbol=="string")}function Sn(e,n){return!S(e)||typeof e.available!="boolean"||e.available===!1&&(typeof e.reason!="string"||e.reason.length===0)||e.available===!0&&e.reason!==void 0?!1:n==="import-definitions"?Array.isArray(e.sourcePaths)&&e.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):Ce(e.references,bn)&&(e.incompleteReferenceSymbolIds===void 0||Array.isArray(e.incompleteReferenceSymbolIds)&&e.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(e.callees===void 0||Ce(e.callees,gn))&&(e.signatures===void 0||Array.isArray(e.signatures)&&e.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function Ce(e,n){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(n))}function bn(e){return S(e)&&typeof e.file=="string"&&p(e.line)&&p(e.column)}function gn(e){return S(e)&&typeof e.symbol=="string"&&typeof e.file=="string"&&p(e.line)&&(e.callsiteLine===void 0||p(e.callsiteLine))}function In(e){return e==="unsupported-protocol"||e==="malformed-request"||e==="expired-request"||e==="handler-error"}function T(e){return{ok:!1,code:"malformed-request",error:e}}function Z(e){return{ok:!1,code:"malformed-response",error:e}}function ve(e){return{ok:!1,code:"incompatible-response",error:e}}function Pe(e){return e===void 0||Q(e)}function qe(e){return e===void 0||p(e)}function I(e){return e===void 0||Se(e)}function ee(e){return e===void 0||typeof e=="boolean"}import{spawn as Tn}from"child_process";import{createHash as Pn,randomUUID as Bn}from"crypto";import{existsSync as He,realpathSync as Nn,rmSync as On}from"fs";import{tmpdir as Un}from"os";import{resolve as _}from"path";import{execFileSync as An}from"child_process";import{existsSync as Dn}from"fs";import{deserializeSCIP as Mn,SymbolRole as hn}from"@c4312/scip";var te=new WeakMap,En="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function kt(e,n){let t=new Map,r=L(),s=n.filter(u=>Ne(u,r));if(s.length===0)return t;let i=Oe(e);if(!i)return t;for(let u of s){let l=Be(i,u);l!==null&&t.set(u.symbolId,l)}return t}function xt(e,n){if(!Ne(n,L()))return null;let t=Oe(e);return t?Be(t,n):null}function Be(e,n){return e.referencesBySymbol.get(n.symbol)??[]}function Ne(e,n="safe"){if(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||Ee(e.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(e.symbol))return!1;if(n==="all")return!0;let t=he(e.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Me(e.symbol);return"kind"in r?!1:!kn(r)}function kn(e){for(let n=0;n<e.descriptors.length-1;n+=1)if(e.descriptors[n]?.suffix==="type")return!0;return!1}function Oe(e){if(te.has(e))return te.get(e)??null;let n=xn(e);return te.set(e,n),n}function xn(e){if(!e.generation.indexPath||!Dn(e.generation.indexPath))return null;try{let n=Mn(pe(e.generation.indexPath,{inputKind:"SCIP occurrence-reference index",maxBytes:de})),t=new Map;for(let r of n.documents??[]){let s=r.relativePath;if(!(!s||e.isIgnored(s)))for(let i of r.occurrences??[]){if(!i.symbol||(i.symbolRoles&hn.Definition)!==0)continue;let u=wn(s,i.range);if(!u)continue;let l=t.get(i.symbol)??[];l.push(u),t.set(i.symbol,l)}}for(let[r,s]of t)t.set(r,Ae(s));return{referencesBySymbol:t}}catch{return null}}function wn(e,n){if(n.length<3)return null;let t=n[0],r=n[1];return!Number.isInteger(t)||!Number.isInteger(r)?null:{file:e,line:t,column:r}}function L(){return process.env[En]==="all"?"all":"safe"}function Ue(e){let n=De(Ie,e),t=n.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}var We=new Map;function re(e){let t=Ue(e).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?_n(e,t):"unavailable"}}function Tt(e){return{...re(e),scipOccurrenceReferenceMode:L()}}function _n(e,n){let t=`${e}\0${n}`,r=We.get(t);if(r)return r;let s;try{s=An(n,["--version"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim()}catch{s="unknown"}return We.set(t,s),s}import{createHash as Cn}from"crypto";var vn=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function Fe(e){let n=ge(e,{includePath:qn});return Cn("sha256").update(JSON.stringify(n)).digest("hex")}function qn(e){let n=e.replaceAll("\\","/"),t=n.split("/").at(-1)??n;return n.endsWith(".rs")||vn.has(t)?!0:n===".cargo/config"||n===".cargo/config.toml"||n.endsWith("/.cargo/config")||n.endsWith("/.cargo/config.toml")}var Wn=5e3,$e=10,Fn=3e4;function Le(e,n,t,r=en){let s=r.engineIdentity(e),i={protocolVersion:b,projectRoot:r.canonicalProjectRoot(e),projectFingerprint:r.projectFingerprint(e),engine:{engine:s.engine,resolvedBinary:s.resolvedBinary,version:s.version},workerFingerprint:r.fileFingerprint(n),environment:Je(r.environment())};return{key:se(A(i)),...i}}var je=class{constructor(n,t=Kn){this.createRequester=n;this.applyEnvironment=t}createRequester;applyEnvironment;requester=null;identityKey=null;semanticResponseCache=null;handle(n){this.applyEnvironment(n.workerEnvironment??{});let t;if(this.requester?this.identityKey!==n.identityKey?(this.semanticResponseCache=null,this.requester.shutdown(),this.requester=this.createRequester(),this.identityKey=n.identityKey,t="invalidated"):t="reused":(this.requester=this.createRequester(),this.identityKey=n.identityKey,t="created"),n.kind==="semantic"){let r=Ln(n.request),s=t==="reused"&&r!==null&&this.semanticResponseCache?.identityKey===n.identityKey&&this.semanticResponseCache.requestKey===r?this.semanticResponseCache.response:null;if(s)return Ke(!0,n.request.definitions.length),{session:t,response:s};let i=this.requester.requestSemantic(n.request,n.timeoutMs);return r!==null&&jn(i)&&(this.semanticResponseCache={identityKey:n.identityKey,requestKey:r,response:i}),Ke(!1,n.request.definitions.length),{session:t,response:i}}return{session:t,response:this.requester.requestImportDefinitions(n.request,n.timeoutMs)}}shutdown(){this.requester?.shutdown(),this.requester=null,this.identityKey=null,this.semanticResponseCache=null}};function Ln(e){if(e.includeReferences===!1||e.includeCallees!==!0||e.includeSignatures===!0||(e.referenceDefinitions?.length??0)===0||(e.calleeDefinitions?.length??0)===0)return null;let{readinessDeadlineMs:n,...t}=e;return se(A(t))}function jn(e){return e.available&&Array.isArray(e.callees)&&(e.incompleteReferenceSymbolIds?.length??0)===0}function Ke(e,n){C()&&v({type:"span",name:"rust.semantic.durable-session.response-cache",durationMs:0,ok:!0,hit:e,definitions:n})}function j(e,n,t,r){if(e.protocolVersion!==b||!t(e.pid))return!1;if(!e.processIdentity)return!0;let s=r?.(e.pid);return s!=null&&Re(e.processIdentity,s)}function Qe(e,n,t){let r;try{r=$(n,{maxBytes:E,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let s=se(A({projectRoot:_(e),serverPath:_(n),serverFingerprint:r})).slice(0,20);return _(t,`scip-query-rust-session-${s}`)}function ze(e){let n=e===void 0?Number.NaN:Number(e);return Number.isInteger(n)&&n>=0?n:0}function Je(e){return Object.fromEntries(Object.entries(e).filter(([n])=>Ge(n)).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>[n,t??null]))}function Xe(e,n){let t=n.runtime??$n,r=n.identityRuntime??en,s=Qe(e,n.serverPath,n.tempRoot??Un()),i=!1,u=(l,d)=>{if(i)throw new Error("Durable Rust semantic session was already disposed.");return Vn(s,n.serverPath,n.semanticWorkerPath,l,d,t,n.mailboxLimits)};return{requestSemantic(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"semantic",identityKey:R.key,workerEnvironment:Ye(),request:{...o,referenceRetryTimeoutMs:zn(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,l.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},requestImportDefinitions(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"import-definitions",identityKey:R.key,workerEnvironment:Ye(),request:{...o,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},shutdown(){i=!0}}}function Kn(e){for(let n of Object.keys(process.env))Ze(n)&&delete process.env[n];for(let[n,t]of Object.entries(e))t!==null&&(process.env[n]=t)}function zn(e,n){return n!==void 0?n:e===void 0?Fn:void 0}function Vn(e,n,t,r,s,i,u={}){let l=i.now(),d=l+s,R=(i.monotonicNow??w)(),c=R+s,o=q("rust-semantic-v3",r),a=U(o),f=ke(e),m=F(e),y=xe(f,{mailboxVersion:k,protocolVersion:b,id:a,operationKey:o,clientId:i.randomId(),enqueuedAtMs:l,deadlineAtMs:d,sessionIdentity:m,request:r},{nowMs:l,limits:u});for(Ve(e,n,t,c,i);(i.monotonicNow??w)()<=c;){if(He(y.responsePath)){let D=Yn(x(y.responsePath,{maxBytes:u.maxItemBytes??E,inputKind:"durable Rust semantic mailbox response"}),{requestId:a,operationKey:o,sessionIdentity:m,deadlineAtMs:y.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:i.now()});if(!D.ok)throw new Error(D.error);return C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:(i.monotonicNow??w)()-R,ok:!0,session:D.session,kind:r.kind}),D.response}let h=K(e);(!h||!j(h,i.now(),i.isProcessAlive,i.readProcessIdentity))&&Ve(e,n,t,c,i),i.sleep($e)}throw new Error(`Durable Rust semantic session timed out after ${(s/1e3).toFixed(0)}s.`)}function Ve(e,n,t,r,s){let i=K(e);if(i&&j(i,s.now(),s.isProcessAlive,s.readProcessIdentity))return;On(_(e,"server.json"),{force:!0}),s.spawnServer(n,e,t);let u=s.monotonicNow??w,l=Math.min(r,u()+Wn);for(;u()<=l;){let d=K(e);if(d&&j(d,s.now(),s.isProcessAlive,s.readProcessIdentity))return;s.sleep($e)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function K(e){try{let n=JSON.parse(x(_(e,"server.json"),{maxBytes:ce,inputKind:"durable Rust session state"}));if(typeof n.protocolVersion!="number"||n.sessionIdentity!==void 0&&(typeof n.sessionIdentity!="string"||n.sessionIdentity!==F(e))||typeof n.pid!="number"||typeof n.heartbeatAtMs!="number"||n.busyUntilMs!==void 0&&typeof n.busyUntilMs!="number"||n.mailbox!==void 0&&!Hn(n.mailbox))return null;let t=n.processIdentity===void 0?null:fe(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{protocolVersion:n.protocolVersion,...n.sessionIdentity===void 0?{}:{sessionIdentity:n.sessionIdentity},pid:n.pid,...t?{processIdentity:t}:{},heartbeatAtMs:n.heartbeatAtMs,...n.busyUntilMs===void 0?{}:{busyUntilMs:n.busyUntilMs},...n.mailbox===void 0?{}:{mailbox:n.mailbox}}}catch{return null}}function Yn(e,n){try{return ne(JSON.parse(e),n)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function Hn(e){if(!e||typeof e!="object")return!1;let n=e;return p(n.pending)&&p(n.inflight)&&p(n.responses)&&p(n.deadLetters)&&p(n.invalid)&&p(n.totalItems)&&typeof n.totalBytes=="number"&&Number.isFinite(n.totalBytes)&&n.totalBytes>=0&&(n.oldestPendingAt===void 0||Number.isFinite(Date.parse(n.oldestPendingAt)))}function Ye(){return Object.fromEntries(Object.entries(process.env).filter(([e])=>Ze(e)).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,n??null]))}function Ge(e){return e==="HOME"||e==="PATH"||e.startsWith("CARGO_")||e.startsWith("RA_")||e.startsWith("RUST")}function Ze(e){return Ge(e)||e.startsWith("SCIP_RUST_")||e==="SCIP_QUERY_PROFILE"||e==="SCIP_QUERY_PROFILE_CACHE_STATE"||e==="SCIP_QUERY_PROFILE_COMMAND"||e==="SCIP_QUERY_PROFILE_OUT"||e==="SCIP_QUERY_PROFILE_RUN_ID"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND"||e==="SCIP_QUERY_PROFILE_MIN_MS"}var en={canonicalProjectRoot(e){try{return Nn(e)}catch{return _(e)}},projectFingerprint(e){return Fe(e)},engineIdentity:re,fileFingerprint(e){return $(e,{maxBytes:E,inputKind:"Rust semantic engine artifact"})},environment(){return Je(process.env)}},$n={now:Date.now,monotonicNow:w,randomId:Bn,isProcessAlive:be,readProcessIdentity:me,spawnServer(e,n,t){if(!He(e))throw new Error(`Durable Rust semantic session helper was not found at ${e}. Run npm run build first.`);Tn(process.execPath,[e,n,t],{detached:!0,stdio:"ignore"}).unref()},sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)}};function se(e){return Pn("sha256").update(e).digest("hex")}import{existsSync as Qn,mkdtempSync as nn,rmSync as oe}from"fs";import{tmpdir as tn}from"os";import{join as ae}from"path";import{fileURLToPath as H,pathToFileURL as Jn}from"url";import{SHARE_ENV as Xn,Worker as Gn}from"worker_threads";function z(e,n,t=new Set){let r=new Map;for(let s of e)t.has(s.symbolId)||r.set(s.symbolId,n.get(s.symbolId)??[]);return r}function ie(e,n,t){let r=W(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let s=Math.max(1,Math.ceil(e/Math.max(1,t)));return Math.max(12e4,3e4+s*n)}var rn=15e3,sn=8,an=5e3,Zn=64,et=96,le=class{constructor(n,t,r={}){this.projectRoot=n;this.status=t;this.opts=r;this.requester=r.requester??it(n,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),references:N(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!0});return{...P(r),resolvedBinary:t.resolvedBinary,references:z(n,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:N(n)}}}calleesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),callees:O(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!0});return{...P(r),resolvedBinary:t.resolvedBinary,callees:ue(n,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:O(n)}}}referencesAndCalleesForDefinitions(n,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),references:N(n),callees:O(t)};let s=[...n,...t];try{let i=this.requestSession(r.resolvedBinary,s,{includeReferences:n.length>0,includeCallees:t.length>0,referenceDefinitions:n,calleeDefinitions:t});return{...P(i),resolvedBinary:r.resolvedBinary,references:z(n,new Map(i.references),new Set(i.incompleteReferenceSymbolIds??[])),callees:ue(t,new Map(i.callees??[]))}}catch(i){return this.fallbackReferencesAndCallees(r,n,t,i)}}signaturesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),signatures:on(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...P(r),resolvedBinary:t.resolvedBinary,signatures:ct(n,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:on(n)}}}importDefinitionsForFile(n,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),sourcePaths:new Map(t.map(s=>[s.id,null]))};try{let s=this.requestImportDefinitions(r.resolvedBinary,n,t);return{...P(s),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(s.sourcePaths)}}catch(s){return{available:!1,resolvedBinary:r.resolvedBinary,reason:s instanceof Error?s.message:String(s),sourcePaths:new Map(t.map(i=>[i.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=Y(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),u=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),l=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),d=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,R=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,c=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,o=nt(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),a={projectRoot:this.projectRoot,rustAnalyzerBinary:n,definitions:[...t],...d?{referenceDefinitions:d}:{},...R?{calleeDefinitions:R}:{},...c?{signatureDefinitions:c}:{},requestTimeoutMs:s,...r.includeReferences!==!1&&i>0?{referenceRetryTimeoutMs:i}:{},diagnosticsTimeoutMs:l,settleDelayMs:o,concurrency:u,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},f=dt(a);return X("rust.semantic.session.request",()=>this.requester.requestSemantic(a,ie(f,pt(s,a.referenceRetryTimeoutMs),u)),()=>({definitions:t.length,operationDefinitions:f,referenceDefinitions:a.referenceDefinitions?.length,calleeDefinitions:a.calleeDefinitions?.length,signatureDefinitions:a.signatureDefinitions?.length,references:a.includeReferences!==!1,callees:a.includeCallees===!0,signatures:a.includeSignatures===!0,referenceRetryTimeoutMs:a.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(n,t,r,s){let i=t.length===0?{available:!0,resolvedBinary:n.resolvedBinary,references:N(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),u=r.length===0?{available:!0,resolvedBinary:n.resolvedBinary,callees:O(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(i&&u){let l={resolvedBinary:i.resolvedBinary??u.resolvedBinary??n.resolvedBinary,references:z(t,i.references),callees:ue(r,u.callees)};return i.available&&u.available?{available:!0,...l}:{available:!1,reason:(i.available?void 0:i.reason)??(u.available?void 0:u.reason)??"Rust semantic fallback was unavailable.",...l}}return{available:!1,resolvedBinary:n.resolvedBinary,reason:s instanceof Error?s.message:String(s),references:N(t),callees:O(r)}}requestImportDefinitions(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),u=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Y(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,an),d={projectRoot:this.projectRoot,rustAnalyzerBinary:n,file:t,positions:[...r],requestTimeoutMs:s,diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:i};return X("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(d,ie(r.length,s,i)),()=>({file:t,positions:r.length}))}};function P(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function B(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function mr(e,n,t={}){return new le(e,n,t)}function nt(e,n){let t=ln(e);if(t!==null)return t;let r=n.includeReferences!==!1;return r&&n.includeCallees!==!0&&n.includeSignatures!==!0&&n.definitionCount<=Zn||r&&n.includeCallees===!0&&n.includeSignatures!==!0&&n.definitionCount<=et?0:an}function tt(e){let n=e?.trim().toLowerCase(),t=n==="0"||n==="false"||n==="off"||n==="worker",r=n==="1"||n==="true"||n==="on"||n==="durable",s=n===void 0||n==="";return{transport:t||!s&&!r?"worker":"durable",source:s?"default":"environment",fallback:"worker",valid:s||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function rt(e){return tt(e).transport}function st(e,n){let t=null,r=!1,s=!1,i=!1,u=()=>t??=n(),l=()=>{s||(e.shutdown(),s=!0)},d=(c,o,a)=>{let f=lt(c);r=!0;try{l()}catch{}C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:a,ok:!1,kind:o,session:"worker-fallback",reason:f})},R=(c,o,a)=>{if(i)throw new Error("Rust semantic failover session was already disposed.");if(r)return a(u());let f=performance.now();try{return o(e)}catch(m){d(m,c,performance.now()-f)}return a(u())};return{requestSemantic(c,o){return R("semantic",a=>a.requestSemantic(c,o),a=>a.requestSemantic(c,o))},requestImportDefinitions(c,o){return R("import-definitions",a=>a.requestImportDefinitions(c,o),a=>a.requestImportDefinitions(c,o))},shutdown(){if(i)return;i=!0;let c=[];try{l()}catch(o){c.push(o)}try{t?.shutdown()}catch(o){c.push(o)}if(c.length>0)throw c[0]}}}function it(e,n,t={worker:()=>ot(),durable:()=>Xe(e,{serverPath:H(ft()),semanticWorkerPath:H(un())})}){return rt(n)==="durable"?st(t.durable(),t.worker):t.worker()}function ot(e={}){let n=null,t=null,r=1,s=!1,i=null,u=null,l=o=>{o&&oe(o,{recursive:!0,force:!0})},d=()=>{if(i)return;let o=n,a=t;n=null,t=null;let f=o?o.terminate():Promise.resolve(0);i=Promise.allSettled([f,we(a,{gracefulMs:1e3,forceMs:1e3})]).then(([m,y])=>{let D=(y.status==="fulfilled"?y.value:[{reaped:!1,detail:String(y.reason)}]).filter(g=>!g.reaped);if(m.status==="rejected"||D.length>0){u=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${a??"unknown"}.`);return}l(a)}).finally(()=>{i=null})},R=()=>{if(n)return n;if(i)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(u)throw u;let o=e.semanticWorkerPath?Jn(e.semanticWorkerPath):un();if(!Qn(H(o)))throw new Error(`Rust semantic session worker was not found at ${H(o)}. Run npm run build before using built semantic Rust queries.`);return t=nn(ae(tn(),"scip-query-rust-session-")),n=new Gn(o,e.shareEnvironment?{env:Xn}:void 0),n.unref(),n},c=()=>{let o=t??nn(ae(tn(),"scip-query-rust-session-"));return t=o,ae(o,`${r++}.json`)};return{requestSemantic(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"semantic",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=at(x(m,{maxBytes:E,inputKind:"Rust semantic worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},requestImportDefinitions(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"import-definitions",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic import-definition session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=ut(x(m,{maxBytes:E,inputKind:"Rust import-definition worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},shutdown(){if(s)return;if(s=!0,!n){l(t),t=null;return}let o=c(),a=new SharedArrayBuffer(4),f=new Int32Array(a);n.postMessage({kind:"shutdown",responsePath:o,sharedBuffer:a}),Atomics.wait(f,0,0,5e3),d()}}}function at(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function ut(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function lt(e){let n=e instanceof Error?`${e.name} ${e.message}`.toLowerCase():String(e).toLowerCase();return n.includes("readiness")?"readiness":n.includes("timeout")||n.includes("timed out")?"timeout":n.includes("helper")?"helper":"request"}function N(e){return new Map(e.map(n=>[n.symbolId,[]]))}function O(e){return new Map(e.map(n=>[n.symbolId,[]]))}function on(e){return new Map(e.map(n=>[n.symbolId,null]))}function ue(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??[]]))}function ct(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function dt(e){let n=0;return e.includeReferences!==!1&&(n+=(e.referenceDefinitions??e.definitions).length),e.includeCallees===!0&&(n+=(e.calleeDefinitions??e.definitions).length),e.includeSignatures===!0&&(n+=(e.signatureDefinitions??e.definitions).length),Math.max(1,n)}function pt(e,n){return n&&n>0?Math.max(e,n):e}function un(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function ft(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function V(e,n){return W(e)??n}function Y(e,n){return ln(e)??n}function ln(e){if(!e)return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}export{kt as a,xt as b,Ue as c,Tt as d,b as e,F as f,pn as g,je as h,z as i,ie as j,mr as k,nt as l,ot as m,pt as n};
|
|
2
|
+
//# sourceMappingURL=chunk-5BIKR67W.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as m}from"./chunk-VDGFWCQV.js";var v=/:\d+(?:-\d+)?$/u;function D(d,t,c={}){let p=c.direction??"backward",n=c.maxDepth??3;if(!Number.isSafeInteger(n)||n<0)throw new RangeError(`Dependence-slice depth must be a non-negative safe integer; received ${n}.`);let r=v.test(t),o=m(d,r?{locations:[t]}:{symbols:[t]},{families:["execution","runtime","dataflow","ownership"],maxDepth:n+1,maxEdges:c.maxEdges??200}),f=new Set(o.targets.flatMap(e=>e.nodeIds)),a=new Set(f),l=new Map;u(o.edges,a,l,0);for(let e=1;e<=n;e+=1){let s=[];for(let i of o.edges)if(p==="backward"?a.has(i.to.id):a.has(i.from.id)){let g=p==="backward"?i.from.id:i.to.id;if(a.has(g))continue;s.push(g),l.set(i.id,e)}if(s.length===0)break;for(let i of s)a.add(i);u(o.edges,a,l,e)}let h=o.edges.filter(e=>a.has(e.from.id)&&a.has(e.to.id)).filter(e=>l.has(e.id)||e.family==="ownership").map(e=>({...e,traversalDepth:l.get(e.id)??0,supporting:e.family!=="dataflow"&&!y(e)})).sort((e,s)=>e.traversalDepth-s.traversalDepth||e.family.localeCompare(s.family)||e.from.label.localeCompare(s.from.label)||e.to.label.localeCompare(s.to.label));return{kind:"dependence-slice",direction:p,criterion:t,targets:o.targets,nodeIds:[...a].sort(),edges:h,coverage:{status:o.coverage.status,criterionKind:r?"source-location-summary":"symbol-summary",basis:"partial-system-dependence-graph",analysisBasis:"typescript-cfg-reaching-definitions-plus-system-edges",providers:["typescript-local-dependence","bounded-static-value-flow"],graph:o.coverage,unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","unresolved dynamic dispatch"]}}}function u(d,t,c,p){let n=!0;for(;n;){n=!1;for(let r of d)r.family!=="ownership"||!t.has(r.from.id)||t.has(r.to.id)||(t.add(r.to.id),c.set(r.id,p),n=!0)}}function y(d){return d.semanticFamily==="control"&&d.sourceKind==="control-dependence"}export{D as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5PROPLHI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as y}from"./chunk-2BMSSRBH.js";import{b as h,e as b}from"./chunk-F5GSBHC6.js";import{d as u,e as i,i as c}from"./chunk-C7C6AKAT.js";import{n as m}from"./chunk-RBAD4GJ2.js";import{A as l}from"./chunk-ZLMXIQLC.js";import{basename as f}from"path";function g(t,o){let n=o.className,e=h(t,n);return e.match?e.total>1?{kind:"ambiguous",query:n,total:e.total,candidates:[p(e.match),...e.candidates]}:{kind:"matched",query:n,owner:L(e.match),methods:M(t,e.match)}:{kind:"missing",query:n,suggestions:b(t,n,5)}}function j(t,o){let n=g(t,{className:o});if(n.kind==="missing")throw new Error(`No class definition matched '${o}'.`);if(n.kind==="ambiguous"){let e=n.candidates.map(s=>`${s.relativePath}:${s.startLine+1}`).join(", ");throw new Error(`Class '${o}' is ambiguous across ${n.total} definitions (${e}). Qualify it with a path or exact SCIP symbol identity.`)}return n.methods}function M(t,o){let n=i(o.symbol),s=new y(t).definitionsForFile(o.relativePath).filter(r=>c(r.symbol)),a=s.filter(r=>r.parentTypeName===n||r.symbol.includes(n)),d=(a.length>0?a:S(f(o.relativePath))===n?s.filter(r=>r.symbol.includes("<invalid-global-code>")):[]).map(r=>({startLine:r.startLine,endLine:r.endLine,name:i(r.symbol)}));return l(o.relativePath)!=="clojure"?d:R(d,w(t,o))}function p(t){return{symbol:t.symbol,shortName:u(t.symbol),relativePath:t.relativePath,startLine:t.startLine}}function L(t){return{...p(t),endLine:t.endLine}}function S(t){return t.replace(/\.[^.]+$/,"")}function w(t,o){let n=i(o.symbol);return n?(m(t,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===n).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function R(t,o){let n=new Map;for(let e of[...t,...o])n.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...n.values()].sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine)}export{g as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-5V7EPTII.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-GHNPACNP.js";import{a as F,b as S,e as C}from"./chunk-JFMI5SGB.js";import{g as P}from"./chunk-AADQLOQ4.js";import{a as I}from"./chunk-WDSFQDPN.js";import{b as M}from"./chunk-2USA3S3P.js";import{c as g}from"./chunk-BL6DCHQP.js";function re(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||T(s).includes(l)).sort(G)}function ie(e,n,o={}){let t=M(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=$(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return F(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function $(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function T(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
|
|
2
2
|
`).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{re as a,ie as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-62LPZCBQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D}from"./chunk-35NLDRZC.js";import{b as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as D}from"./chunk-35NLDRZC.js";import{b as C}from"./chunk-BOW7SSQH.js";function v(t,n={}){let{limit:o=10,scope:s,minDepth:h=3,edgeBasis:c="symbol-references"}=n,u=C(t,s,c==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:p,componentOf:y}=D(u),m=new Map;for(let e=0;e<p.length;e++)m.set(e,new Set);for(let[e,a]of u){let i=y.get(e);for(let l of a){let r=y.get(l);r!==i&&m.get(i).add(r)}}let f=new Array(p.length),b=new Array(p.length);for(let e=0;e<p.length;e++){let a=[],i=0;for(let l of[...m.get(e)].sort((r,d)=>r-d)){let r=b[l];(r>i||r===i&&I(f[l],a,p)<0)&&(i=r,a=f[l])}f[e]=[e,...a],b[e]=1+i}function R(e){return f[e]}let w=p.map(e=>[...e].sort()),S=new Set,g=[];for(let e=0;e<p.length;e++){let i=R(e).map(d=>w[d]),l=i.map(d=>d[0]);if(i.length<h)continue;let r=l.join(" ");S.has(r)||(S.add(r),g.push(j(l,i,c)))}return g.sort((e,a)=>a.depth-e.depth||e.chain.join("\0").localeCompare(a.chain.join("\0"))),B(g).slice(0,o)}function K(t,n={}){return v(t,n)}function I(t,n,o){if(n.length===0)return-1;let s=t.map(c=>[...o[c]].sort()[0]??"").join("\0"),h=n.map(c=>[...o[c]].sort()[0]??"").join("\0");return s.localeCompare(h)}function j(t,n,o){let s=n.reduce((c,u)=>c+u.length,0),h=n.filter(c=>c.length>1).length;return{chain:t,components:n,depth:n.length,fileCount:s,edgeBasis:o,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${n.length} condensed dependency component(s) form the representative transitive path`,`${s} file(s) are represented; ${h} component(s) contain a dependency cycle`,`edge basis: ${o==="imports"?"resolved file imports":"cross-file symbol references plus resolved source imports"}`,"cycles count once toward depth and retain their full membership separately"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function B(t){let n=[];for(let o of t)n.some(s=>E(o.chain,s.chain))||n.push(o);return n}function E(t,n){if(t.length>=n.length)return!1;let o=n.length-t.length;for(let s=0;s<t.length;s++)if(t[s]!==n[o+s])return!1;return!0}export{v as a,K as b};
|
|
2
|
+
//# sourceMappingURL=chunk-64O2JHQA.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{a as F}from"./chunk-BJWFVAA5.js";import{h as E}from"./chunk-U3SXIMII.js";import{a as M,c as x}from"./chunk-F5GSBHC6.js";import{C as A,d as S,h as R,v as N}from"./chunk-C7C6AKAT.js";import{A as w}from"./chunk-ZLMXIQLC.js";function K(t,o,n={}){return _(t,o,n).rows}function q(t,o,n={}){return _(t,o,n)}function _(t,o,n){let{maxDepth:i=5,scope:a}=n,c=i===Number.MAX_SAFE_INTEGER,r=c?null:500,h=M(t,o);if(!h)return{rows:[],coverage:{status:"incomplete",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:0,perSymbolEvidenceLimit:r,remainingFrontierSymbols:0,reasons:["The requested symbol could not be resolved."]}};let m=[],u=new Set([h.symbolId]),s=new Set,e=[h],f=0,b=!1;for(let d=1;d<=i&&e.length!==0;d++){f=d;let p=[],C=E(t,e,{...c?{}:{limit:r+1},semanticEvidence:F});for(let v of e){let g=C.get(v.symbolId)??[];r!==null&&g.length>r&&(b=!0);let $=r===null?g:g.slice(0,r);for(let l of P(t,v,a,$)){let D=`${l.file}|${l.shortName}`;if(l.symbolId!==null){if(u.has(l.symbolId))continue;u.add(l.symbolId)}else if(s.has(D))continue;s.add(D),m.push({symbol:l.symbol,shortName:l.shortName,file:l.file,depth:d}),l.symbolId!==null&&l.symbolMatch&&p.push(l.symbolMatch)}}e=p}m.sort((d,p)=>d.depth-p.depth||d.file.localeCompare(p.file));let I=e.length>0,y=[];return I&&y.push(`${e.length} symbol(s) remain eligible beyond depth ${i}.`),b&&y.push(`At least one symbol had more than ${r} incoming evidence row(s).`),y.length===0&&y.push("The discovered reverse evidence frontier was exhausted."),{rows:m,coverage:{status:I||b?"bounded":"accounted",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:f,perSymbolEvidenceLimit:r,remainingFrontierSymbols:e.length,reasons:y}}}function P(t,o,n,i){let a=i.filter(s=>!t.isIgnored(s.file)).filter(s=>!n||s.file.includes(n)),c=new Set(a.map(s=>s.file)),r=[];for(let s of L(t,o,n)){if(c.has(s))continue;let e=N(t,s),f=e.length>0?A(e,e[0].startLine):null;r.push({symbol:f?.symbol??s,file:s})}let h=[...a,...r],m=[],u=new Set;for(let s of h){let e=x(t,s.symbol);if(!e){let b=`${s.file}|${s.symbol}`;if(u.has(b))continue;u.add(b),m.push({symbolId:null,symbol:s.symbol,shortName:S(s.symbol),file:s.file,symbolMatch:null});continue}if(e.symbolId===o.symbolId||t.isIgnored(e.relativePath)||!T(e))continue;let f=`${e.symbolId}|${e.relativePath}`;u.has(f)||(u.add(f),m.push({symbolId:e.symbolId,symbol:e.symbol,shortName:S(e.symbol),file:e.relativePath,symbolMatch:e}))}return m}function L(t,o,n){let i=n?"AND consumer_d.relative_path LIKE ?":"",a=[o.symbolId,o.documentId];return n&&a.push(`%${n}%`),new Set(t.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
+
WHERE m.symbol_id = ?
|
|
6
|
+
AND m.role != 1
|
|
7
|
+
AND c.document_id != ?
|
|
8
|
+
${t.pathExclusionsFor("consumer_d")}
|
|
9
|
+
${i}`,...a).map(c=>c.relative_path).filter(c=>!t.isIgnored(c)))}function T(t){if(t.symbol.startsWith("scip-clojure ")||w(t.relativePath)==="clojure")return!0;let o=R(t.symbol);return o==="method"||o==="type"||t.symbol.endsWith("().")}export{K as a,q as b};
|
|
10
|
+
//# sourceMappingURL=chunk-6D4F5VWG.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-XKXTR6ZI.js";import{b as y}from"./chunk-BOJ5SVE2.js";import{b as w}from"./chunk-FLMTCX5R.js";import{d as k}from"./chunk-RBAD4GJ2.js";import{O as R}from"./chunk-ZLMXIQLC.js";import{h as b}from"./chunk-ETC674NS.js";var C=60;function nt(t,s={}){let{scope:n,limit:e=30,scanLimit:i,rotDays:r=C}=s,c=y(R(t,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(a=>w(a)==="test").filter(a=>!n||a.includes(n)).filter(a=>!t.isIgnored(a)).sort(),i),o=[],l=[],p=[];for(let a of c){let d=b(t,a);if(!d)continue;let x=k(d),h=K(d);for(let u of j(x,h))h.add(u);let O=P(x);for(let u of O){if(u.skip){l.push(H(t,a,u,r));continue}if(u.kind==="describe")continue;let S=F(d,u.argsStart),m=x.slice(u.argsStart,u.callEnd),M=d.slice(u.argsStart,u.callEnd);_(m,h)||o.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,severity:/\bawait\b/.test(m)?"low":"high"});let A=B(m,M);A&&p.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,echoedValue:A})}}return{assertionFree:e?o.slice(0,e):o,skipped:e?l.slice(0,e):l,mockEcho:e?p.slice(0,e):p}}var E=/(?<!\.)\b(?:x(it|test|describe)|(it|test|describe)(?:\.\s*(skip|only|todo|each\s*\([^)]*\)))?)\s*\(/g;function P(t){let s=[];E.lastIndex=0;let n;for(;n=E.exec(t);){let e=n[1],i=e??n[2];if(!i)continue;let r=n[3]?.split(/\s*\(/)[0],c=n.index,o=n.index+n[0].length-1,l=g(t,o);E.lastIndex=o+1,r!=="each"&&s.push({kind:i,skip:e!==void 0||r==="skip"||r==="todo",skipKind:r==="todo"?"todo":"skip",callStart:c,argsStart:o+1,callEnd:l+1})}return s}function g(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return e}return t.length-1}function f(t,s){let n=0;for(let e=0;e<s&&e<t.length;e+=1)t[e]===`
|
|
2
2
|
`&&(n+=1);return n}function F(t,s){let n=t.slice(s,s+400),e=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return e?e[2]:"(anonymous)"}var D=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),L=/import\s+(?:\*\s+as\s+(\w+)|\{([^}]*)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;function K(t){let s=new Set(["expect","assert"]);L.lastIndex=0;let n;for(;n=L.exec(t);){let[,e,i,r,c]=n;if(!(!c||!D.has(c))&&(e&&s.add(e),r&&s.add(r),i))for(let o of i.split(",")){let l=o.trim().replace(/^type\s+/,"");if(!l)continue;let p=/^(\w+)\s+as\s+(\w+)$/.exec(l);s.add(p?p[2]:l)}}return s}function _(t,s){if(/\.should\b/.test(t)||/\bawait\s+(?:[\w$.]+\.)?findBy[A-Z]\w*\s*\(/.test(t)||/\bawait\s+\w*waitFor(?:Text|Value|Condition|Result|Event)\s*\(/.test(t)||/\bthrow\b/.test(t))return!0;for(let n of s){let e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${e}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(t))return!0}return!1}var v=/\bfunction\s+(\w+)\s*\(/g,V=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,$=60;function j(t,s){let n=new Set;for(let e of[v,V]){e.lastIndex=0;let i;for(;i=e.exec(t);){let r=i[1],c=i.index+i[0].length-1,o=g(t,c),l=t.indexOf("{",o+1);if(l===-1||l-o>$)continue;let p=Q(t,l),a=t.slice(l+1,p);_(a,s)&&n.add(r)}}return n}function Q(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return e}return t.length-1}var U=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,T=/\bexpect\s*\(/g,q=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,N=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function B(t,s){let n=G(t,s,U);if(n.length===0)return null;let e=Y(t,s);for(let i of e)if(n.includes(i))return i;return null}function G(t,s,n){let e=[];n.lastIndex=0;let i;for(;i=n.exec(t);){let r=i.index+i[0].length-1,c=g(t,r),o=s.slice(r+1,c).trim();N.test(o)&&e.push(o),n.lastIndex=c+1}return e}function Y(t,s){let n=[];T.lastIndex=0;let e;for(;e=T.exec(t);){let i=e.index+e[0].length-1,r=g(t,i),c=t.slice(r+1),o=q.exec(c);if(T.lastIndex=r+1,!o)continue;let l=r+1+o[0].length-1,p=g(t,l),a=s.slice(l+1,p).trim();N.test(a)&&n.push(a)}return n}function H(t,s,n,e){let i=b(t,s),r=F(i,n.argsStart),c=f(i,n.callStart),o=X(t.config.projectRoot,s,c),l=o===null?"unknown":o>=e?"rot":"workflow";return{file:s,startLine:c,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:o,rot:l}}function X(t,s,n){let e=n+1;try{let i=I(t,["blame","-L",`${e},${e}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let c=Number(r[1]);return Number.isFinite(c)?Math.max(0,Math.round((Date.now()/1e3-c)/86400)):null}catch{return null}}export{nt as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-6ERFBC3X.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-NSM5IEVW.js";var _=`SELECT COUNT(*) AS shared
|
|
2
2
|
FROM (
|
|
3
3
|
SELECT definition_m.symbol_id
|
|
4
4
|
FROM documents definition_d
|
|
@@ -46,4 +46,4 @@ import{a as s}from"./chunk-ERCYGVAM.js";var _=`SELECT COUNT(*) AS shared
|
|
|
46
46
|
GROUP BY file1, file2
|
|
47
47
|
ORDER BY shared DESC, file1, file2
|
|
48
48
|
LIMIT ?`,...o,n).filter(d=>!e.isIgnored(d.file1)&&!e.isIgnored(d.file2)).map(d=>c(d.file1,d.file2,d.shared))}function h(e,i={}){return f(e,i)}function c(e,i,n){return{file1:e,file2:i,sharedSymbols:n,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${n} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{l as a,N as b,f as c,h as d};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-6ILKOOGH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as T}from"./chunk-CKBUBRYD.js";import{V as x,Y as m,Z as P,_ as k,aa as b,ca as j,r as v}from"./chunk-7HXT6YLU.js";import{createHash as A}from"crypto";import{isUtf8 as K}from"buffer";import{TextDecoder as _}from"util";var O=new _("utf-8",{fatal:!0});function H(e){return j(e.config.projectRoot)}function Q(e,t){let a=v(t),r;try{r=m(e.config.projectRoot,a,{inputKind:"repository text file"})}catch(o){if(b(o)||o instanceof x)return null;throw o}let n=C(r);return n===null?null:w(a,r,n,E(e),L(e))}function V(e,t,a){let r=H(e).filter(i=>!t.scope||i.includes(t.scope)),n=E(e),o=L(e),u=[],S=[],B=[],f=0,d=0,h={aligned:0,stale:0,unavailable:0},l=t.literalBytes?Buffer.isBuffer(t.literalBytes)?[t.literalBytes]:[...t.literalBytes]:[],F=l.length>0?Buffer.allocUnsafe(1024*1024):void 0;for(let i of r){let c,p,g=[],y=o.has(i);try{if(l.length>0){let s=l.length===1?P(e.config.projectRoot,i,l[0],{inputKind:"repository text file",computeSha256:y,scratchBuffer:F}):k(e.config.projectRoot,i,l,{inputKind:"repository text file",computeSha256:y,scratchBuffer:F});if(!s.isUtf8Text){u.push(i);continue}f+=s.byteLength,d+=1,p=s.sha256;let z=R(i,p,n,o);if(h[z.state]+=1,g="matchedLiteralIndexes"in s?s.matchedLiteralIndexes:s.includesLiteral?[0]:[],g.length===0||!s.bytes)continue;c=s.bytes}else c=m(e.config.projectRoot,i,{inputKind:"repository text file"})}catch(s){if(s instanceof x){B.push(i);continue}if(b(s))continue;S.push(i);continue}if(l.length===0&&!I(c)){u.push(i);continue}if(l.length===0){f+=c.byteLength,d+=1,p=y?M(c):void 0;let s=R(i,p,n,o);h[s.state]+=1}if(t.includeBytes&&!t.includeBytes(i,c))continue;let U=O.decode(c);a(w(i,c,U,n,o,p),g)}return{candidateFiles:r.length,scannedTextFiles:d,semanticFiles:h,scannedBytes:f,skippedBinaryPaths:u,skippedUnreadablePaths:S,skippedOversizedPaths:B}}function w(e,t,a,r,n,o){let u=o??M(t);return{relativePath:e,text:a,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:u},semantic:R(e,u,r,n)}}}function R(e,t,a,r){if(!r.has(e))return{state:"unavailable",basis:"no-compiler-document"};let n=a.get(e);return!n||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:n===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function L(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function E(e){let t=new Map;if(!e.generation.metadataRaw)return t;let a=T(e.generation.metadataRaw);if(a.kind!=="legacy"&&a.kind!=="supported")return t;let r=a.metadata.fingerprint;if(!D(r)||!Array.isArray(r.files))return t;for(let n of r.files)!D(n)||typeof n.path!="string"||typeof n.hash!="string"||t.set(n.path,n.hash);return t}function C(e){return I(e)?O.decode(e):null}function I(e){return!e.includes(0)&&K(e)}function M(e){return A("sha256").update(e).digest("hex")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{H as a,Q as b,V as c};
|
|
2
|
+
//# sourceMappingURL=chunk-6MFXCMZC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as T,b as w}from"./chunk-V2RBODHL.js";import{a as S,b as A,c as v,d as E}from"./chunk-ZMCQIHI4.js";import{a as b,b as x,c as P,e as u,f as R}from"./chunk-B3X6KU75.js";import{a as C,b as H}from"./chunk-KMVGRIO2.js";import{Q as B}from"./chunk-ZLMXIQLC.js";function z(e,t={}){return F(e,t).results}function F(e,t={}){let{minSimilarity:a=.45,minSharedBehaviors:c=6,limit:i=20,scope:r,scanLimit:d,filePattern:l,focusFiles:f}=t,h=S(e),n=new A,m=B(e).reactProfiles({scope:r,minBehaviorTokens:Math.max(3,c),scanLimit:d}).filter(o=>h.roleOf(o.file)!=="test"?!0:(n.record("test-files",v.testFiles),!1)).map(o=>({file:o.file,component:o.name,tokens:o.behaviorTokens,profile:o})),k=T(m,o=>o.tokens);return{results:w({profiles:m,limit:i,filePattern:l,focusFiles:f,candidateIndex:k,profile:{name:"react-hook-candidates"},compare:(o,s)=>{let p=h.pairContext(o.file,s.file),y=V(o,s,a,c,p);return y?o.profile.kind!==s.profile.kind?(n.record("hook-component-pairs",v.hookComponentPairs),null):p==="ui-kit-pair"?(n.record("ui-kit-pairs",v.uiKitPairs),null):y:null},sort:(o,s)=>q(o.actionTier)-q(s.actionTier)||s.similarity-o.similarity||o.fileA.localeCompare(s.fileA)||o.componentA.localeCompare(s.componentA)||o.fileB.localeCompare(s.fileB)||o.componentB.localeCompare(s.componentB)}),exclusions:n.list()}}function q(e){return e==="signal"?0:1}function V(e,t,a,c,i){let r=C(e.tokens,t.tokens);if(r.size<c||!I(r))return null;let d=x(e.tokens,t.tokens);if(d<a)return null;let l=u(r,"hook:"),f=u(r,"react-hook:"),h=u(r,"effect:"),n=u(r,"state:"),m=u(r,"request:"),k=u(r,"handler:"),g=u(r,"handler-verb:"),o=O({sharedHooks:l,sharedReactHooks:f,sharedEffects:h,sharedState:n,sharedRequests:m,sharedHandlers:k,sharedHandlerVerbs:g}),s=E(i),p=j(i,o.actionTier,o.recommendation);return{fileA:e.file,componentA:e.component,fileB:t.file,componentB:t.component,similarity:d,tokenCountA:e.tokens.size,tokenCountB:t.tokens.size,sharedTokens:R(r),sharedHooks:l,sharedReactHooks:f,sharedEffects:h,sharedState:n,sharedRequests:m,sharedHandlers:k,sharedHandlerVerbs:g,evidenceClass:o.evidenceClass,actionTier:p.actionTier,evidenceClassReasons:s?[s,...o.reasons]:o.reasons,recommendation:p.recommendation,unitKind:e.profile.kind==="hook"&&t.profile.kind==="hook"?"hook":"component",pairContext:i,uniqueToA:R(H(e.tokens,t.tokens)).slice(0,25),uniqueToB:R(H(t.tokens,e.tokens)).slice(0,25),reason:_({sharedHooks:l,sharedReactHooks:f,sharedEffects:h,sharedState:n,sharedRequests:m,sharedHandlers:k,sharedHandlerVerbs:g}),locA:e.profile.loc,locB:t.profile.loc}}function j(e,t,a){switch(e){case"framework-route-pair":return{actionTier:t,recommendation:a};case"intercepting-route-pair":return{actionTier:t,recommendation:"Render one shared view component from both the intercepting route and its target route instead of repeating the behavior in each body."};case"ui-kit-pair":case"product":return{actionTier:t,recommendation:a}}}function O(e){return b({genericWords:$,stripPrefixes:D,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:W})}function W(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function I(e){let t=0,a=0,c=0,i=0,r=0,d=0,l=0;for(let n of e)n.startsWith("hook:")?t+=1:n.startsWith("react-hook:")?a+=1:n.startsWith("effect:")?c+=1:n.startsWith("request:")?i+=1:n.startsWith("handler:")||n.startsWith("handler-verb:")?r+=1:n.startsWith("state:")?d+=1:n.startsWith("state-hook:")&&(l+=1);let f=d+l,h=t+a+c+i+r+f;return P([{name:"requests",count:i},{name:"customHooks",count:t},{name:"namedStates",count:d},{name:"handlers",count:r},{name:"effects",count:c},{name:"reactHooks",count:a},{name:"namedBehavior",count:h}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function _(e){let t=[];return e.sharedHooks.length&&t.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&t.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&t.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&t.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&t.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&t.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&t.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),t.join("; ")||"shared React behavior profile"}var $=new Set(["add","apply","async","callback","cancel","change","clear","client","close","context","create","data","deferred","delete","dispatch","draft","edit","effect","error","fetch","field","filter","form","handle","has","id","infinite","is","item","items","load","loader","loading","memo","mutate","mutation","name","navigate","navigation","open","params","pathname","query","reducer","refresh","ref","remove","request","reset","resource","router","row","rows","save","saving","search","select","selected","selector","state","store","submit","suspense","toggle","transition","update","use","value"]),D=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{z as a,F as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6O7FACKB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-6MFXCMZC.js";import{r as o}from"./chunk-7HXT6YLU.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6TS3KOXR.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-F5GSBHC6.js";import{b as d,d as m}from"./chunk-C7C6AKAT.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
|
|
2
2
|
WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-76QOU4PK.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d,b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d,b as m}from"./chunk-V2RBODHL.js";import{c as u}from"./chunk-KMVGRIO2.js";import{b as c}from"./chunk-BOW7SSQH.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7DUI77BN.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{closeSync as c,fstatSync as u,openSync as m,readFileSync as L,readSync as x}from"fs";import{createHash as R}from"crypto";var B=8*1024*1024,p=64*1024*1024,b=512*1024*1024,E=256*1024*1024,d=class extends Error{constructor(i,o,r,n,a){let s=r==="too-large"?`is ${n} bytes; the safety limit is ${a} bytes`:r==="not-regular"?"is not a regular file":"changed while it was being read";super(`${i} ${JSON.stringify(o)} ${s}`);this.inputKind=i;this.inputPath=o;this.reason=r;this.observedBytes=n;this.limitBytes=a;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function y(t,e){g(e.maxBytes);let i=String(t),o=m(t,"r");try{let r=u(o);A(r,e,i);let n=L(o),a=u(o);if(a.dev!==r.dev||a.ino!==r.ino||a.size!==r.size||n.byteLength!==r.size)throw new d(e.inputKind,i,"changed-during-read",a.size,e.maxBytes);return n}finally{c(o)}}function h(t,e,i="utf8"){return y(t,e).toString(i)}function _(t,e){return h(t,{maxBytes:B,inputKind:e})}function w(t,e){return h(t,{maxBytes:p,inputKind:e})}function S(t,e){g(e.maxBytes);let i=[],o=Buffer.allocUnsafe(64*1024),r=0;for(;;){let n=x(t,o,0,o.length,null);if(n===0)break;if(r+=n,!Number.isSafeInteger(r)||r>e.maxBytes)throw new d(e.inputKind,`file descriptor ${t}`,"too-large",r,e.maxBytes);i.push(Buffer.from(o.subarray(0,n)))}return Buffer.concat(i,r)}function F(t,e){let i=m(t,"r");try{return S(i,e)}finally{c(i)}}function P(t,e,i="utf8"){return F(t,e).toString(i)}function T(t,e,i){g(e.maxBytes);let o=String(t),r=m(t,"r");try{let n=u(r);A(n,e,o);let a=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,n.size))),s=0;for(;s<n.size;){let l=x(r,a,0,Math.min(a.length,n.size-s),s);if(l===0)break;i(a.subarray(0,l)),s+=l}let f=u(r);if(f.dev!==n.dev||f.ino!==n.ino||f.size!==n.size||s!==n.size)throw new d(e.inputKind,o,"changed-during-read",f.size,e.maxBytes);return s}finally{c(r)}}function I(t,e){let i=R("sha256");return T(t,e,o=>i.update(o)),i.digest("hex")}function A(t,e,i){if(!t.isFile())throw new d(e.inputKind,i,"not-regular",Number(t.size),e.maxBytes);if(t.size>e.maxBytes)throw new d(e.inputKind,i,"too-large",Number(t.size),e.maxBytes)}function g(t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${t}`)}function N(t,e,i,o){let r=0;for(;r<e.length;){let n=i.writeFile(t,e,r,e.length-r);if(!Number.isSafeInteger(n)||n<=0||n>e.length-r)throw new Error(`${o} write did not make valid forward progress`);r+=n}}function D(t,e){if(e!=="win32")return!1;let i=t.code;return i==="EACCES"||i==="EBADF"||i==="EINVAL"||i==="EISDIR"||i==="EPERM"}export{B as a,p as b,b as c,E as d,d as e,y as f,h as g,_ as h,w as i,P as j,T as k,I as l,g as m,N as n,D as o};
|
|
2
|
+
//# sourceMappingURL=chunk-7F45LJKI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-BOW7SSQH.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7F7T6DCR.js.map
|