scip-query 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +500 -0
- package/README.md +13 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-H3P6BR5G.js +2 -0
- package/dist/call-graph-VTG2CUOQ.js +2 -0
- package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
- package/dist/chunk-2BMSSRBH.js +2 -0
- package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
- package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
- package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
- package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
- package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
- package/dist/chunk-2VAHDDLM.js +133 -0
- package/dist/chunk-2XWIUW5Z.js +455 -0
- package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
- package/dist/chunk-3D4BOXW6.js +20 -0
- package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
- package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
- package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
- package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
- package/dist/chunk-4FR6GQIT.js +2 -0
- package/dist/chunk-4KBTHJLP.js +2 -0
- package/dist/chunk-5BIKR67W.js +2 -0
- package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
- package/dist/chunk-5V7EPTII.js +2 -0
- package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
- package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
- package/dist/chunk-6D4F5VWG.js +10 -0
- package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
- package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
- package/dist/chunk-6MFXCMZC.js +2 -0
- package/dist/chunk-6O7FACKB.js +2 -0
- package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
- package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
- package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
- package/dist/chunk-7F45LJKI.js +2 -0
- package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
- package/dist/chunk-7H6VHWWJ.js +2 -0
- package/dist/chunk-7HXT6YLU.js +5 -0
- package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
- package/dist/chunk-7RIRIADH.js +7 -0
- package/dist/chunk-7ZLWLOGT.js +2 -0
- package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
- package/dist/chunk-AADQLOQ4.js +38 -0
- package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
- package/dist/chunk-ANLNLY66.js +2 -0
- package/dist/chunk-ATXPTSEI.js +81 -0
- package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
- package/dist/chunk-B3PYOSCX.js +2 -0
- package/dist/chunk-B7MPDEAK.js +3 -0
- package/dist/chunk-BBB5FBX4.js +2 -0
- package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
- package/dist/chunk-BJWFVAA5.js +2 -0
- package/dist/chunk-BKVWUP7Y.js +2 -0
- package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
- package/dist/chunk-BL6DCHQP.js +2 -0
- package/dist/chunk-BOW7SSQH.js +43 -0
- package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
- package/dist/chunk-C7C6AKAT.js +117 -0
- package/dist/chunk-CD6M6LS2.js +16 -0
- package/dist/chunk-CFE6PSG6.js +2 -0
- package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
- package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
- package/dist/chunk-CZW5MZ5B.js +2 -0
- package/dist/chunk-DBBZ63ZX.js +2 -0
- package/dist/chunk-DBN7DMJB.js +18 -0
- package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
- package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
- package/dist/chunk-DZOIKCTM.js +3 -0
- package/dist/chunk-E4PKTOL3.js +2 -0
- package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
- package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
- package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
- package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
- package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
- package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
- package/dist/chunk-EPX6NQN6.js +4 -0
- package/dist/chunk-ETC674NS.js +5 -0
- package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
- package/dist/chunk-FH3DGXC6.js +2 -0
- package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
- package/dist/chunk-FJF6VO2P.js +2 -0
- package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
- package/dist/chunk-FVFDOIM3.js +2 -0
- package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
- package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
- package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
- package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
- package/dist/chunk-GG45PK4S.js +4 -0
- package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
- package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
- package/dist/chunk-GTZZVLKJ.js +2 -0
- package/dist/chunk-GXXW5ZHH.js +2 -0
- package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
- package/dist/chunk-HEZWBAZY.js +2 -0
- package/dist/chunk-HMEWLMML.js +2 -0
- package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
- package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
- package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
- package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
- package/dist/chunk-IKQVBVQL.js +40 -0
- package/dist/chunk-J6GLBBRK.js +4 -0
- package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
- package/dist/chunk-JCSAZ35V.js +2 -0
- package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
- package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
- package/dist/chunk-JFMI5SGB.js +4 -0
- package/dist/chunk-JJP37RGX.js +57 -0
- package/dist/chunk-JZ2A7LDM.js +5 -0
- package/dist/chunk-KNLQGXVH.js +80 -0
- package/dist/chunk-KVQCECPR.js +2 -0
- package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
- package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
- package/dist/chunk-L6XHYJPZ.js +21 -0
- package/dist/chunk-L7KTFEAV.js +43 -0
- package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
- package/dist/chunk-LEECKFCJ.js +2 -0
- package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
- package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
- package/dist/chunk-MOKUWRHO.js +3 -0
- package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
- package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
- package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
- package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
- package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
- package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
- package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
- package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
- package/dist/chunk-NJQISBL4.js +8 -0
- package/dist/chunk-NJT3ZEKY.js +16 -0
- package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
- package/dist/chunk-NODFZ6ED.js +2 -0
- package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
- package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
- package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
- package/dist/chunk-NWLVNU66.js +557 -0
- package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
- package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
- package/dist/chunk-ODPDP7A4.js +3 -0
- package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
- package/dist/chunk-OIAPEKMT.js +3 -0
- package/dist/chunk-OIOC5EHF.js +3 -0
- package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
- package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
- package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
- package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
- package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
- package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
- package/dist/chunk-PXTRBKRK.js +3 -0
- package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
- package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
- package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
- package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
- package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
- package/dist/chunk-QXCKQTKR.js +60 -0
- package/dist/chunk-RBAD4GJ2.js +13 -0
- package/dist/chunk-RMDPFPNW.js +2 -0
- package/dist/chunk-ROPJDEJZ.js +4 -0
- package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
- package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
- package/dist/chunk-SCPMZ73U.js +2 -0
- package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
- package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
- package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
- package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
- package/dist/chunk-SYVJEEUJ.js +3 -0
- package/dist/chunk-T3CZAZSI.js +8 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
- package/dist/chunk-T6HRIROJ.js +7 -0
- package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
- package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
- package/dist/chunk-TULNMD5T.js +368 -0
- package/dist/chunk-U2FPY5XA.js +3 -0
- package/dist/chunk-U3SXIMII.js +38 -0
- package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
- package/dist/chunk-UH3XSKS5.js +9 -0
- package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
- package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
- package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
- package/dist/chunk-VBKUWB6N.js +2 -0
- package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
- package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
- package/dist/chunk-VDSDOEWF.js +2 -0
- package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
- package/dist/chunk-WDSFQDPN.js +2 -0
- package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
- package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
- package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
- package/dist/chunk-WYPL7GF7.js +2 -0
- package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
- package/dist/chunk-X6OGVFIT.js +2 -0
- package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
- package/dist/chunk-Y5DFAW5W.js +4 -0
- package/dist/chunk-YSYPDRD5.js +3 -0
- package/dist/chunk-ZFVPWH62.js +5 -0
- package/dist/chunk-ZGIHTH27.js +2 -0
- package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
- package/dist/chunk-ZHG4WAHR.js +12 -0
- package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
- package/dist/chunk-ZLMXIQLC.js +21 -0
- package/dist/chunk-ZMCQIHI4.js +2 -0
- package/dist/cli-main.js +2 -2
- package/dist/code-TAVIKWJI.js +2 -0
- package/dist/code-result-json-5FEFQCAQ.js +2 -0
- package/dist/command-descriptors-7BKH53Y3.js +343 -0
- package/dist/dataflow-GFBTVDH3.js +2 -0
- package/dist/dependence-slice-GWGQCODG.js +2 -0
- package/dist/deps-4QHVDPYA.js +2 -0
- package/dist/direct-navigation-4UBC6HNW.js +3 -0
- package/dist/entry-map-QCTF4RVY.js +2 -0
- package/dist/files-M2UBF5HJ.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
- package/dist/hierarchy-2UIHRLW4.js +2 -0
- package/dist/imports-WIE3YZOB.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/members-YKD636DA.js +2 -0
- package/dist/methods-VDF4IMYG.js +2 -0
- package/dist/output-continuation-command-4UMDOOLO.js +3 -0
- package/dist/output-pagination-2GME6OPY.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-XEQTRCV5.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -0
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +9 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +28 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +50 -23
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +4 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +7 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +22 -6
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +16 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +3 -3
- package/dist/refs-JNK5CLM7.js +2 -0
- package/dist/refs-pagination-6BLRYGMV.js +2 -0
- package/dist/reindex-worker.js +25 -25
- package/dist/reindex.d.ts +3 -2
- package/dist/reindex.js +35 -35
- package/dist/runtime.d.ts +34 -2
- package/dist/runtime.js +4 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
- package/dist/slice-PHPVNCWX.js +2 -0
- package/dist/surface-MQX5MPIV.js +2 -0
- package/dist/symbol-resolution-DBLVXLBC.js +2 -0
- package/dist/system-JOPKV4OG.js +2 -0
- package/dist/trace-I2P2YFH4.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-JJVMF7NP.js +2 -0
- package/dist/watch-server.js +3 -3
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/DETECTOR_GUIDE.md +51 -12
- package/docs/accuracy-audit-checklist.md +36 -13
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +2 -2
- package/skills/conductor/SKILL.md +110 -0
- package/skills/conductor/agents/openai.yaml +4 -0
- package/skills/principal-maintainability-review/SKILL.md +273 -0
- package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
- package/skills/scip-calibrate/SKILL.md +102 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-claim-audit/SKILL.md +113 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-probe-reachability/SKILL.md +93 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-root-cause/SKILL.md +160 -0
- package/skills/scip-root-cause/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/SKILL.md +252 -0
- package/skills/scip-system-compression/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/references/compression-atlas.md +116 -0
- package/skills/scip-system-compression/references/compression-patterns.md +87 -0
- package/skills/scip-twin-drift/SKILL.md +109 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/dist/by-kind-4IYG2SKW.js +0 -2
- package/dist/call-graph-WQNXMNNN.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-2BTJALUS.js +0 -454
- package/dist/chunk-3QXC54FQ.js +0 -3
- package/dist/chunk-3TJY6M3B.js +0 -7
- package/dist/chunk-42W3LFUK.js +0 -13
- package/dist/chunk-4GAQ6FI4.js +0 -43
- package/dist/chunk-6NC3YSPY.js +0 -38
- package/dist/chunk-6VEFRPTD.js +0 -5
- package/dist/chunk-7C26EKLZ.js +0 -4
- package/dist/chunk-7JYHQAH2.js +0 -22
- package/dist/chunk-7KSO2OAP.js +0 -2
- package/dist/chunk-7XZGZBSQ.js +0 -2
- package/dist/chunk-A77SCPW2.js +0 -3
- package/dist/chunk-AK3PYTIK.js +0 -5
- package/dist/chunk-AMIMMNA4.js +0 -11
- package/dist/chunk-AUY5BL74.js +0 -2
- package/dist/chunk-BDHFVH2M.js +0 -18
- package/dist/chunk-BECZLYNU.js +0 -8
- package/dist/chunk-BUTEIZKP.js +0 -10
- package/dist/chunk-BWVQP3LB.js +0 -38
- package/dist/chunk-BYDAFMSR.js +0 -57
- package/dist/chunk-BZYSGZRK.js +0 -2
- package/dist/chunk-C7IJMOFP.js +0 -134
- package/dist/chunk-CBBHFNLX.js +0 -2
- package/dist/chunk-D2MVJSP4.js +0 -21
- package/dist/chunk-D35XIZGN.js +0 -2
- package/dist/chunk-DKM723YF.js +0 -79
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-E44IVWIJ.js +0 -367
- package/dist/chunk-EDMB6SSO.js +0 -7
- package/dist/chunk-EETGXQY7.js +0 -3
- package/dist/chunk-FKGQOTKD.js +0 -2
- package/dist/chunk-GH5YSGZL.js +0 -5
- package/dist/chunk-GQIDEID3.js +0 -2
- package/dist/chunk-HCVJR2V4.js +0 -3
- package/dist/chunk-IMKZEXZG.js +0 -2
- package/dist/chunk-ISIQLPJ2.js +0 -61
- package/dist/chunk-IXESDH3J.js +0 -2
- package/dist/chunk-JJ62MTQH.js +0 -40
- package/dist/chunk-JT6XX7QY.js +0 -8
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-LRI5OMPE.js +0 -2
- package/dist/chunk-MHIEP7EG.js +0 -4
- package/dist/chunk-NK3JMP22.js +0 -2
- package/dist/chunk-NVSZNESQ.js +0 -2
- package/dist/chunk-OJNK5ALA.js +0 -2
- package/dist/chunk-OXYAWIEA.js +0 -2
- package/dist/chunk-OZETODHH.js +0 -2
- package/dist/chunk-PBUH2P5S.js +0 -3
- package/dist/chunk-PLJUQFQN.js +0 -2
- package/dist/chunk-PLYUVM4F.js +0 -2
- package/dist/chunk-PXXYQK55.js +0 -2
- package/dist/chunk-Q5TA4OY4.js +0 -20
- package/dist/chunk-Q7GBK5T7.js +0 -81
- package/dist/chunk-QLBSG7U5.js +0 -3
- package/dist/chunk-QWKHW6VZ.js +0 -2
- package/dist/chunk-RPL3ARU7.js +0 -16
- package/dist/chunk-SVHTMVA4.js +0 -4
- package/dist/chunk-T6QD2ZQB.js +0 -43
- package/dist/chunk-TD7VKJ2Y.js +0 -117
- package/dist/chunk-TKDNDQA7.js +0 -3
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TUSPIVZ3.js +0 -4
- package/dist/chunk-URSGGIZX.js +0 -2
- package/dist/chunk-UT7TADJX.js +0 -2
- package/dist/chunk-V4NG5OMS.js +0 -554
- package/dist/chunk-VTCIYFEK.js +0 -2
- package/dist/chunk-VU6LIWHT.js +0 -2
- package/dist/chunk-VUSKPCUB.js +0 -2
- package/dist/chunk-WN3TCGJ4.js +0 -2
- package/dist/chunk-WSLEJSFR.js +0 -2
- package/dist/chunk-WYZIHUPZ.js +0 -16
- package/dist/chunk-XE33FV5W.js +0 -2
- package/dist/chunk-XGGBK66W.js +0 -4
- package/dist/chunk-XSWYJCAK.js +0 -2
- package/dist/chunk-Y334QQU5.js +0 -3
- package/dist/chunk-Z2AWCTN6.js +0 -2
- package/dist/chunk-ZOXKSQQB.js +0 -2
- package/dist/chunk-ZPASRBLF.js +0 -2
- package/dist/chunk-ZZ3Z7D56.js +0 -2
- package/dist/code-EQJFDT6I.js +0 -2
- package/dist/code-result-json-7UWIWBOO.js +0 -2
- package/dist/command-descriptors-ORNTVNYV.js +0 -342
- package/dist/dataflow-6VL54GX5.js +0 -2
- package/dist/dependence-slice-DT2NUHD2.js +0 -2
- package/dist/deps-DB7H5IKC.js +0 -2
- package/dist/direct-navigation-O3LUAYWQ.js +0 -3
- package/dist/entry-map-6K62RV3D.js +0 -2
- package/dist/files-MSLD7MO6.js +0 -2
- package/dist/hierarchy-IVBXAKFA.js +0 -2
- package/dist/imports-FRAVZ3Y2.js +0 -2
- package/dist/members-KJOJDYGO.js +0 -2
- package/dist/methods-2AYABBT3.js +0 -2
- package/dist/output-continuation-command-JHMPH6NC.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-HYO4WD7Z.js +0 -3
- package/dist/refs-ARMA6XUJ.js +0 -2
- package/dist/refs-pagination-VUGIWN6U.js +0 -2
- package/dist/slice-YOB5YFAM.js +0 -2
- package/dist/surface-VY5EFWTW.js +0 -2
- package/dist/symbol-resolution-DGQN4XIV.js +0 -2
- package/dist/system-2KQ3QD2P.js +0 -2
- package/dist/trace-HTIPTXAE.js +0 -2
- package/dist/value-flow-5FV3VQI7.js +0 -2
package/dist/chunk-Q5TA4OY4.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{Mb as q,Nb as N,Ob as ot,Pb as V,Rb as at,lc as it,nc as U,sc as L,tc as B}from"./chunk-V4NG5OMS.js";import{Ad as z,Ca as I,Hd as j,u as A,xd as et,xe as st,yd as nt,zd as rt}from"./chunk-2BTJALUS.js";import{createHash as T,randomBytes as lt}from"crypto";import{chmodSync as Wt,closeSync as x,fstatSync as ct,lstatSync as Xt,mkdirSync as yt,openSync as W,readSync as Yt,readdirSync as Ot,renameSync as wt,rmSync as X,statSync as Qt,writeSync as St}from"fs";import{tmpdir as Zt}from"os";import{dirname as Kt,join as _,resolve as te}from"path";import{StringDecoder as Y}from"string_decoder";import{InvalidArgumentError as pt}from"commander";var Gt=/^[A-Za-z0-9_@%+=:,./-]+$/u;function ut(t,e={}){return e.omitSafeQuotes&&Gt.test(t)?t:(e.platform??process.platform)==="win32"?`"${t.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${t.replaceAll("'",`'"'"'`)}'`}var vt="scip-query-output-page",bt=1,ee="continue",S=256,E=1e5,$=4096,l=32e6,Ct=64*1024*1024,ne=256*1024*1024,re=32,Pt=32768,It=16,se=V*It,R=4096,ht=Ct,Et=3600*1e3,oe="scip-query-json-export",ae=1,Tt=3;function xt(){return _(Zt(),`scip-query-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var Q=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,_t=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,ie=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,ue=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,At=1,ce="quota.lock",pe=2e3,he=5,dt=1024*1024,de=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),D,ge=Object.freeze({maxSnapshotBytes:Ct,maxAggregateBytes:ne,maxSnapshotCount:re});var Nt={writeStdout:t=>{process.stdout.write(t)},writeStderr:t=>{process.stderr.write(t)}};async function fe(t,e,n=Nt){return it({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{U(!1)}})}async function me(t,e,n){let s=t.pageSize??q,r=t.snapshotRoot??xt(),a=Pe(t.snapshotLimits),o=t.maxOutputCharacters??l;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let i=Math.min(o,l,t.agentOutput?se:l);if(Ut(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"&&B(t.cwd,t.sourceSession!==!1),await le(t,e,n,i);return}if(t.json&&!t.agentOutput&&t.pageSize===void 0&&t.cursor===void 0){t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await Oe(t,e,n);return}let p=jt(t.argv),h=Dt(t.invocationPrefix),d=zt(t.command,t.cwd,h,p),g=t.cursor===void 0?void 0:Re(t.cursor,d);t.command==="system-map"&&!g&&B(t.cwd,t.sourceSession!==!1);let c=g?.snapshotId,u;if(g)try{u=Se(g,d,s,i,r,t.onSnapshotRead)}catch(y){let M=y instanceof Error?y.message:String(y);throw new Error(`${M} Restart with: ${qt(h,p,s)}`,{cause:y})}else{let y=new F(d,h,t.command,t.cwd,p,s,i,Le(t,h),r,a,t.agentOutput?It:Pt,!t.json,Z(i,t.agentOutput===!0)),M=Lt(k=>y.write(k)),tt=!1;try{await e(),tt=!0}finally{M(),tt||y.abort()}let P;try{P=y.complete()}catch(k){throw y.abort(),k}c=P.snapshotId,u={content:P.content,offset:0,pageIndex:0,pageCount:P.pageCount,totalCharacters:P.totalCharacters,outputHash:P.outputHash}}let w=u.offset+u.content.length,f=u.pageIndex+1>=u.pageCount,m=f?void 0:Ue({invocationPrefix:h,nextPageIndex:u.pageIndex+1,snapshotId:Ae(c)});if(L(t.command,t.cwd,f,t.sourceSession!==!1,m?.command),u.offset===0&&f&&t.cursor===void 0){n.writeStdout(u.content),U(!0),c&&b(c,r);return}let C={kind:vt,schemaVersion:bt,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:t.json?"application/json":"text/plain",agentInstruction:m?"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:m?{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!1,outputHash:u.outputHash,continuation:m}:{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!0,outputHash:u.outputHash},content:u.content};if(t.json){n.writeStdout(`${JSON.stringify(C)}
|
|
3
|
-
`),f&&c&&b(c,r);return}n.writeStdout(je(C)),f&&c&&b(c,r)}async function un(t,e,n=xt(),s=Nt){if(t.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit.`);let r=kt(t);if(!r)throw new Error("Invalid output cursor. Run the original command again.");let a=Rt(r.snapshotId,n);await fe({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 le(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=te(t.cwd,r);if(Buffer.byteLength(a)>R)throw new Error(`The resolved --json-output path exceeds ${R} UTF-8 bytes.`);let o=new Y("utf8"),i=T("sha256"),p=0,h=0,d=m=>{if(h+=m.length,!Number.isSafeInteger(h)||h>s)throw new Error(Z(s,!1))};yt(Kt(a),{recursive:!0});let g=`${a}.tmp-${lt(12).toString("hex")}`,c=W(g,"wx",384),u=!0,w=Lt(m=>{let C=p+m.length;if(!Number.isSafeInteger(C)||C>ht)throw new Error(`JSON export exceeds the ${ht}-byte file safety limit. Narrow the query before retrying.`);if(d(o.write(m)),c===void 0)throw new Error("JSON export writer is closed.");ye(c,m),i.update(m),p=C});try{await e(),d(o.end()),w(),x(c),c=void 0,wt(g,a),u=!1}finally{if(w(),c!==void 0)try{x(c)}catch{}u&&X(g,{force:!0})}let f={kind:oe,schemaVersion:ae,producer:{name:"scip-query",version:t.producerVersion},command:t.command,path:a,bytes:p,sha256:i.digest("hex")};n.writeStdout(`${JSON.stringify(f)}
|
|
4
|
-
`),L(t.command,t.cwd,!0,t.sourceSession!==!1),U(!0)}function ye(t,e){let n=0;for(;n<e.length;){let s=St(t,e,n,e.length-n);if(s<=0)throw new Error("JSON export write made no forward progress.");n+=s}}function Z(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 cn(t){if(!/^\d+$/u.test(t))throw new pt(`Output page size must be an integer from ${S} through ${E}.`);let e=Number(t);try{Ut(e)}catch{throw new pt(`Output page size must be an integer from ${S} through ${E}.`)}return e}function Ut(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 J(N,t.maxOutputCharacters??l),r=process.stdout.write,a=!1,o=`${at(`scip-query: JSON output exceeds the ${N}-byte client-safe budget and may be truncated by the client. Do not use possibly partial client output as evidence. Read every page with: ${qt(Dt(t.invocationPrefix),ke(jt(t.argv)),q)}`)}
|
|
5
|
-
`;process.stdout.write=((i,p,h)=>{let d=s.push(i,p);return d!==void 0&&(a||(a=!0,n.writeStderr(o)),r.call(process.stdout,d)),Bt(p,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),L(t.command,t.cwd,!0,t.sourceSession!==!1)}finally{process.stdout.write=r}}function Lt(t){let e=process.stdout.write;return process.stdout.write=((n,s,r)=>{let a=we(n,s);return t(a),Bt(s,r),!0}),()=>{process.stdout.write=e}}function we(t,e){return typeof t=="string"?Buffer.from(t,typeof e=="string"?e:"utf8"):Buffer.from(t)}function Bt(t,e){let n=typeof t=="function"?t:e;typeof n=="function"&&n()}var J=class{constructor(e,n){this.byteLimit=e;this.maxOutputCharacters=n}byteLimit;maxOutputCharacters;decoder=new Y("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.`)}},F=class{constructor(e,n,s,r,a,o,i,p,h,d,g,c,u=Z(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=p;this.snapshotRoot=h;this.limits=d;this.maxPages=g;this.preferLineBoundaries=c;this.overflowMessage=u;K(h);do this.snapshotId=lt(9).toString("base64url");while(this.snapshotId.startsWith("-"));this.temporaryPath=O(h,this.snapshotId,"tmp")}invocationHash;invocationPrefix;command;cwd;argv;pageSize;maxOutputCharacters;pageContentByteLimit;snapshotRoot;limits;maxPages;preferLineBoundaries;overflowMessage;snapshotId;temporaryPath;decoder=new Y("utf8");hash=T("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.");x(this.descriptor),this.descriptor=null;let e=this.hash.digest("hex"),n=O(this.snapshotRoot,this.snapshotId,"output"),s=O(this.snapshotRoot,this.snapshotId,"json");try{wt(this.temporaryPath,n);let r={version:Tt,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 j(s,r),gt(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&&(x(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=Ne(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){Ie(this.snapshotRoot,this.snapshotId,0,this.limits);try{this.descriptor=W(this.temporaryPath,"wx",384),this.opened=!0}catch(e){throw Ee(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/dt)*dt);gt(this.snapshotRoot,this.snapshotId,o,"active",this.limits),this.reservedBytes=o}let r=0;for(;r<n.length;){let o=St(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:T("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 Se(t,e,n,s,r,a){K(r);let o=Rt(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>Et)throw b(t.snapshotId,r),new Error("Output snapshot expired before all pages were read.");let p=O(r,t.snapshotId,"output"),h=W(p,"r");try{let d=ct(h);if(!d.isFile()||d.size!==o.byteLength)throw new Error("Output snapshot size or type changed.");let g=Buffer.allocUnsafe(i.byteLength),c=0;for(;c<g.length;){let f=Yt(h,g,c,g.length-c,i.byteOffset+c);if(f===0)break;c+=f,a?.(f)}let u=ct(h);if(u.dev!==d.dev||u.ino!==d.ino||u.size!==d.size||c!==i.byteLength)throw new Error("Output snapshot changed while it was being read.");if(T("sha256").update(g).digest("hex")!==i.hash)throw new Error("Output snapshot page no longer matches its metadata.");let w=g.toString("utf8");if(w.length!==i.characterLength)throw new Error("Output snapshot page character count changed.");return{content:w,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{x(h)}}function Rt(t,e){if(!v(t))throw new Error("Output snapshot identifier is invalid.");let n;try{n=JSON.parse(A(O(e,t,"json"),"output snapshot metadata"))}catch(s){throw new Error("Output snapshot is unavailable.",{cause:s})}if(!ve(n))throw new Error("Output snapshot metadata is invalid.");return n}function ve(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===Tt&&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&&ze(e.argv)&&zt(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<=Pt&&e.pages.every(be)&&Ce(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 be(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 Ce(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 K(t){yt(t,{recursive:!0,mode:448});let e=Xt(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"&&Wt(t,448)}function Pe(t){let e={...ge,...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 Ie(t,e,n,s){H(t,()=>{xe(t),$t(t,e,n,"active",s)})}function gt(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.`);H(t,()=>{$t(t,e,n,s,r)})}function $t(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=Te(t),o=a.find(g=>g.snapshotId===e),i=a.reduce((g,c)=>g+c.reservedBytes,0)-(o?.reservedBytes??0)+n,p=a.length+(o?0:1);if(p>r.maxSnapshotCount||i>r.maxAggregateBytes)throw new Error(`Output snapshot capacity is full (${p}/${r.maxSnapshotCount} snapshots, ${i}/${r.maxAggregateBytes} bytes). Narrow the query or finish an existing pagination sequence before retrying.`);let h=Date.now(),d={version:At,snapshotId:e,pid:process.pid,...G()?{processIdentity:G()}:{},reservedBytes:n,state:s,createdAtMs:o?.createdAtMs??h,updatedAtMs:h};j(O(t,e,"reserve"),d)}function Ee(t,e){H(t,()=>{X(O(t,e,"reserve"),{force:!0})})}function Te(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(A(_(t,n.name),"output snapshot reservation"));if(!Ht(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 Ht(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===At&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&Number.isSafeInteger(e.pid)&&(e.pid??0)>0&&(e.processIdentity===void 0||nt(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 xe(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 p=JSON.parse(A(_(t,n.name),"output snapshot reservation"));r=Ht(p)?p:null}catch{r=null}let a=_e(O(t,s,"json")),o=r?.state==="active"&&et(r.pid)&&(r.processIdentity===void 0||(()=>{let p=z(r.pid);return p!==null&&rt(r.processIdentity,p)})()),i=r?e-r.updatedAtMs>Et:!1;o||a&&!i||!a&&r&&!i&&r.state==="complete"||Mt(s,t)}}function _e(t){try{return Qt(t),!0}catch{return!1}}function H(t,e){K(t);let n=_(t,ce),s=Date.now()+pe;for(;;){let r=st(n,{kind:"output-snapshot-quota",processIdentity:G()});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(de,0,0,he)}}function G(){return D===void 0&&(D=z(process.pid)),D}function b(t,e){v(t)&&H(e,()=>Mt(t,e))}function Mt(t,e){for(let n of["json","output","tmp","reserve"])X(O(e,t,n),{force:!0})}function O(t,e,n){if(!v(e))throw new Error("Output snapshot identifier is invalid.");return _(t,`${e}.${n}`)}function Ae(t){if(!t)throw new Error("Incomplete output did not create a resumable snapshot.");return t}function ft(t){return t>=55296&&t<=56319}function Ne(t,e,n,s){let r=Math.min(t.length,e);if(ft(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,ft(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 Ue(t){let e=Be({pageIndex:t.nextPageIndex,snapshotId:t.snapshotId});return{cursor:e,command:Vt(t.invocationPrefix,e)}}function Le(t,e){let n="c".repeat(64),s={cursor:n,command:Vt(e,n)};if(!t.json){let o="9".repeat(String(l).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(ot,Buffer.byteLength(i),1)}let r={kind:vt,schemaVersion:bt,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:l,returnedCharacters:l,totalCharacters:l,omittedCharacters:l,remainingCharacters:l,complete:!1,outputHash:"f".repeat(64),continuation:s},content:""},a=Buffer.byteLength(`${JSON.stringify(r)}
|
|
11
|
-
`);return mt(V,a,2)}function mt(t,e,n){let s=Math.floor((N-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 Be(t){return _t.test(t.snapshotId)?t.pageIndex===1?t.snapshotId:`${t.snapshotId}.${t.pageIndex.toString(36)}`:`4.${He(t.snapshotId)}.${t.pageIndex.toString(36)}`}function Re(t,e){let n=kt(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 kt(t){let e=ue.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=ie.exec(t);if(n){let s=Me(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 $e(s)?s:null}catch{return null}}function $e(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 He(t){if(!Q.test(t))throw new Error("Output snapshot identifier is invalid.");return Buffer.from(t.replaceAll("-",""),"hex").toString("base64url")}function Me(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 Q.test(s)?s:null}function v(t){return typeof t=="string"&&(_t.test(t)||Q.test(t))}function zt(t,e,n,s){return T("sha256").update(JSON.stringify({command:t,cwd:e,invocationPrefix:n,argv:s})).digest("hex")}function jt(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 ke(t){return t.filter(e=>e!=="--raw-json"&&e!=="--raw-json=true")}function qt(t,e,n){return Ft([...t,...e,"--output-page-size",String(n)])}function Vt(t,e){return Ft([...t,ee,e])}function Dt(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 ze(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 Ft(t){return t.map(e=>ut(e,{omitSafeQuotes:!0})).join(" ")}function je(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{ee as a,fe as b,un as c,cn as d};
|
|
20
|
-
//# sourceMappingURL=chunk-Q5TA4OY4.js.map
|
package/dist/chunk-Q7GBK5T7.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{x,xa as j,ya as M}from"./chunk-GH5YSGZL.js";var V=[];function S(e){e.groups.length>0&&V.push(e)}function He(e,t){let n=new Set(t.groups);for(let i of V)i.groups.some(r=>n.has(r))&&(t.file!==void 0&&i.clearFile?i.clearFile(e,t.file):i.clearAll(e))}var K=256;function U(e){let t=e.maxEntries;if(t!==void 0){if(!Number.isSafeInteger(t)||t<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${t}.`);return t}return e.clearGroups.includes("source-file")?K:void 0}function H(e,t,n){e.delete(t),e.set(t,n)}function W(e,t){if(t!==void 0)for(;e.size>t;){let n=e.keys().next().value;if(n===void 0)return;e.delete(n)}}function X(){let e=new WeakMap;return{cache:e,ensure(t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}}}function v(e,t){let{cache:n,ensure:i}=X(),r=U(t),a={get(s,o,c){let l=i(s);if(l.has(o)){let h=l.get(o);return H(l,o,h),h}let g=c();return l.set(o,g),W(l,r),g},has(s,o){return n.get(s)?.has(o)??!1},invalidate(s,o){n.get(s)?.delete(o)},invalidateAll(s){n.delete(s)},size(s){return n.get(s)?.size??0}};return S({name:e,groups:t.clearGroups,clearAll:s=>a.invalidateAll(s),clearFile:(s,o)=>a.invalidate(s,o)}),a}function Be(e,t){let n=new WeakMap,i={get(r,a){let s=n.get(r);if(s)return s.value;let o=a();return n.set(r,{value:o}),o},invalidate(r){n.delete(r)},has(r){return n.has(r)}};return S({name:e,groups:t.clearGroups,clearAll:r=>i.invalidate(r)}),i}var fe={clearGroups:["whole-project","source-file"],maxEntries:K};function Ye(e){return Ee(e,fe)}function Ee(e,t){let{cache:n,ensure:i}=X(),r=U(t),a={get(s,o,c,l){let g=i(s),h=g.get(o);if(h&&h.source===c)return H(g,o,h),h.value;let A=l();return g.set(o,{source:c,value:A}),W(g,r),A},invalidate(s,o){n.get(s)?.delete(o)},invalidateAll(s){n.delete(s)}};return S({name:e,groups:t.clearGroups,clearAll:s=>a.invalidateAll(s),clearFile:(s,o)=>a.invalidate(s,o)}),a}import{createHash as ge}from"crypto";import{existsSync as Qe,mkdirSync as he}from"fs";import{dirname as B,join as ve}from"path";import Y from"better-sqlite3";var ye="evidence.db";var me=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],R=new Set(me);var tt=512*1024*1024,_e=6e4,D=new WeakMap,Te=v("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Se=v("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",y="version NOT LIKE 'evidence-%'";function $(e){return ge("sha256").update(e).digest("hex")}function nt(e,t,n){return Te.get(e,t,()=>$(n))}function G(e){return Se.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=x(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,i=[...n.indexedLanguages??[]].sort();return $(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:i,status:n.status}))}catch(t){return m("project fingerprint unavailable",t),null}})}function m(e,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function u(e){if(D.has(e))return D.get(e)??null;let t=null;try{let n=new Y(e.config.evidenceDbPath??ve(B(e.config.dbPath),ye));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
-
kind TEXT NOT NULL,
|
|
12
|
-
cache_key TEXT NOT NULL,
|
|
13
|
-
project_fingerprint TEXT NOT NULL,
|
|
14
|
-
version TEXT NOT NULL,
|
|
15
|
-
payload TEXT NOT NULL,
|
|
16
|
-
PRIMARY KEY (kind, cache_key)
|
|
17
|
-
);
|
|
18
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
-
relative_path TEXT NOT NULL,
|
|
20
|
-
symbol TEXT NOT NULL,
|
|
21
|
-
content_hash TEXT NOT NULL,
|
|
22
|
-
deps_digest TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
-
relative_path TEXT NOT NULL,
|
|
29
|
-
symbol TEXT NOT NULL,
|
|
30
|
-
project_fingerprint TEXT NOT NULL,
|
|
31
|
-
version TEXT NOT NULL,
|
|
32
|
-
payload TEXT NOT NULL,
|
|
33
|
-
PRIMARY KEY (relative_path, symbol)
|
|
34
|
-
);
|
|
35
|
-
`),t={evidence:n,shared:De(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
|
|
36
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${y}
|
|
37
|
-
ORDER BY version DESC
|
|
38
|
-
LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:n.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
|
|
39
|
-
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${y}
|
|
40
|
-
ORDER BY version DESC
|
|
41
|
-
LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:n.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
42
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
|
|
43
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${y}
|
|
44
|
-
ORDER BY version DESC
|
|
45
|
-
LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
46
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
47
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${y}
|
|
48
|
-
ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
49
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
50
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
|
|
51
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${y}
|
|
52
|
-
ORDER BY version DESC
|
|
53
|
-
LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
54
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
|
|
55
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND ${y}
|
|
56
|
-
ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
57
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){m("disabled (open failed)",n)}return D.set(e,t),t}function f(e,t,n){m(`disabled (${t})`,n),D.set(e,null)}function De(e){if(!e)return null;try{he(B(e),{recursive:!0});let t=new Y(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
|
|
58
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
59
|
-
kind TEXT NOT NULL,
|
|
60
|
-
relative_path TEXT NOT NULL,
|
|
61
|
-
content_hash TEXT NOT NULL,
|
|
62
|
-
version TEXT NOT NULL,
|
|
63
|
-
payload TEXT NOT NULL,
|
|
64
|
-
last_accessed_at INTEGER NOT NULL,
|
|
65
|
-
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
66
|
-
);
|
|
67
|
-
CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
68
|
-
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
|
|
69
|
-
`),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
70
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
71
|
-
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
72
|
-
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
|
|
73
|
-
SET last_accessed_at = ?
|
|
74
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
|
|
75
|
-
AND last_accessed_at < ?`)}}catch(t){return m("shared cache disabled (open failed)",t),null}}function w(e,t,n){m(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function z(e,t,n,i){let r=u(e);if(!r)return null;try{let a=r.readFileEvidence.get(t,n,i,p)??r.readLegacyFileEvidence.get(t,n,i);if(a?.payload!==void 0)return a.payload;if(!R.has(t)||!r.shared)return null;try{let s=r.shared.readFileEvidence.get(t,n,i,p);return s?.payload!==void 0&&be(r.shared,t,n,i),s?.payload??null}catch(s){return w(r,"file_evidence read",s),null}}catch(a){return f(e,"file_evidence read",a),null}}function be(e,t,n,i){let r=Date.now();try{e.touchFileEvidence.run(r,t,n,i,p,r-_e)}catch(a){m("shared file_evidence recency touch skipped",a)}}function Q(e,t,n,i,r){let a=u(e);if(a)try{if(a.writeFileEvidence.run(t,n,i,p,r),R.has(t)&&a.shared)try{a.shared.writeFileEvidence.run(t,n,i,p,r,Date.now())}catch(s){w(a,"file_evidence write",s)}}catch(s){f(e,"file_evidence write",s)}}function J(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{for(let r of t)n.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();try{n.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let i=t.filter(r=>R.has(r.kind));if(i.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let r of i)n.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){w(n,"file_evidence batch write",r)}}catch(i){f(e,"file_evidence batch write",i)}}function q(e,t,n,i){let r=u(e);if(!r)return null;try{return(r.readProjectEvidence.get(t,n,i,p)??r.readLegacyProjectEvidence.get(t,n,i))?.payload??null}catch(a){return f(e,"project_evidence read",a),null}}function Z(e,t,n,i,r){let a=u(e);if(a)try{a.writeProjectEvidence.run(t,n,i,p,r)}catch(s){f(e,"project_evidence write",s)}}function rt(e,t,n,i){if(n===i)return 0;let r=u(e);if(!r)return 0;try{return r.rekeyProjectEvidenceKind.run(i,p,t,n).changes}catch(a){return f(e,"project_evidence kind rekey",a),0}}function it(e,t,n,i){let r=u(e);if(!r)return new Map;try{let a=r.readCalleesForFile.all(t,n,i,p),s=r.readLegacyCalleesForFile.all(t,n,i);return ee([...s,...a])}catch(a){return f(e,"semantic_callees bulk read",a),new Map}}function at(e,t,n){let i=u(e);if(!i)return new Map;try{let r=i.readReferencesForFile.all(t,n,p),a=i.readLegacyReferencesForFile.all(t,n);return ee([...a,...r])}catch(r){return f(e,"semantic_references bulk read",r),new Map}}function ee(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function st(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),n.dropStaleCallees.run(r.relativePath,r.contentHash)),n.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(i){f(e,"semantic_callees write",i)}}function ot(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.projectFingerprint}`;i.has(a)||(i.add(a),n.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),n.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(i){f(e,"semantic_references write",i)}}function dt(e){return typeof e=="object"&&e!==null}function lt(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}import{appendFileSync as Ce,mkdirSync as Pe}from"fs";import{createHash as Ne,randomUUID as Re}from"crypto";import{dirname as we}from"path";import{performance as _}from"perf_hooks";var ie="SCIP_QUERY_PROFILE",ae="SCIP_QUERY_PROFILE_OUT",se="SCIP_QUERY_PROFILE_COMMAND",oe="SCIP_QUERY_PROFILE_CACHE_STATE",F="SCIP_QUERY_PROFILE_RUN_ID",O="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",k="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",ce=[ie,ae,se,oe,F,O,k],ht=new Set(ce),te=new Set,ne=new Map,re=!1;function E(){let e=process.env[ie];return e==="1"||e==="true"}function Fe(){return process.env[ae]}function de(){return process.env[se]}function Oe(){return process.env[oe]}function le(){let e=process.env[F];if(e)return e;if(!E())return;let t=Re();return process.env[F]=t,t}function pe(){return process.env[O]}function ke(e){let t=pe();if(t)return t;if(!E())return;let n=le();if(!n)return;let i=e.projectFingerprint?"published-project":"run-only",r=T(["profile-workload-v1",e.toolVersion,e.command,e.projectFingerprint??n]);return process.env[O]=r,process.env[k]=i,r}function T(e){return Ne("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function vt(){return Object.fromEntries(ce.flatMap(e=>{let t=process.env[e];return t===void 0?[]:[[e,t]]}))}function I(e,t,n){if(!E())return t();let i=_.now();try{let r=t();return b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}async function yt(e,t,n){if(!E())return t();let i=_.now();try{let r=await t();return b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}function b(e,t=Fe()){let n=Ie(e),i={timestamp:new Date().toISOString(),pid:process.pid,runId:le(),command:de(),cacheState:Oe(),...n,...e},r=`${JSON.stringify(i)}
|
|
76
|
-
`;if(t)try{let a=we(t);te.has(a)||(Pe(a,{recursive:!0}),te.add(a)),Ce(t,r);return}catch(a){re||(re=!0,process.stderr.write(`[profile] failed to write ${t}: ${a instanceof Error?a.message:String(a)}
|
|
77
|
-
`));return}E()&&process.stderr.write(r)}function Ie(e){let t=pe()??ke({command:de()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!t)return{};let n=process.env[k],i=typeof e.name=="string"?e.name:void 0;if(!i)return{workloadIdentity:t,workloadIdentityKind:n};let r=i.split(/[.:]/,1)[0]??i,a=`${t}\0${i}`,s=ne.get(a);return s||(s=T(["profile-subsystem-v1",t,i]),ne.set(a,s)),{workloadIdentity:t,workloadIdentityKind:n,subsystem:r,subsystemWorkIdentity:s}}function C(e){return typeof e=="function"?e():e}var Le=[d("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),d("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),d("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),d("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),d("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),d("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),d("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),d("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),d("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),d("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),d("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),d("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),d("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),d("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),d("runtime-boundary-http-roles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/http-summaries.ts"}),d("runtime-boundary-source-hashes",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/graph.ts"}),d("runtime-boundary-direct-extraction",{dependsOn:["content-hash","direct-deps-digest","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/graph.ts"}),P("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),P("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),P("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),P("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function bt(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(E()){let c=G(n);if(c){let l=`${c}\0${i}\0${r}`;o=t.get(l),o||(o=T(["evidence-product-file-read-v1",e.kind,c,i,r]),t.set(l,o))}}return I("evidence-product.file.read",()=>{let c=z(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return a=l!==null,l}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){Q(n,e.kind,i,r,e.serialize(a))},writeBatch(n,i){J(n,i.map(r=>({kind:e.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:e.serialize(r.value)})))}}}function Ct(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(E()){let c=`${r}\0${i}`;o=t.get(c),o||(o=T(["evidence-product-project-read-v1",e.kind,r,i]),t.set(c,o))}return I("evidence-product.project.read",()=>{let c=q(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return a=l!==null,l}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){Z(n,e.kind,i,r,e.serialize(a))}}}function Pt(e){let t=Le.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function d(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function P(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var N=null;function L(e){N?.(e)}function Rt(e,t){let n=N;N=e;try{return t()}finally{N=n}}var Ae=v("source-text",{clearGroups:["whole-project","source-file"]}),xe=v("source-lines",{clearGroups:["whole-project","source-file"]});function je(e,t){let n=t.replace(/\\/g,"/");return L(n),Ae.get(e,n,()=>Me(e,n))}function Me(e,t){let n=t.replace(/\\/g,"/");L(n);try{return j(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(i){if(M(i))return"";throw i}}function It(e){if(e.length===0)return[];let t=e.split(`
|
|
78
|
-
`);return e.endsWith(`
|
|
79
|
-
`)&&t.pop(),t}function Ve(e,t){let n=t.replace(/\\/g,"/");return xe.get(e,n,()=>{let i=je(e,n);return i?i.split(`
|
|
80
|
-
`):[]})}var Ke=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Ue(e){let t=Ke.exec(e);return t?t[1]??"":null}function Lt(e,t,n){return ue(e,t,n).length>0}function At(e,t,n,i){let r=i.toLowerCase();return ue(e,t,n).some(a=>a.toLowerCase()===r)}function ue(e,t,n){if(n<=0)return[];let i=Ve(e,t);if(i.length===0)return[];let r=[];for(let a=n-1;a>=0&&a>=n-5;a-=1){let s=(i[a]??"").trim();if(s==="")continue;let o=Ue(s);if(o!==null){r.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return r}return r}export{S as a,He as b,v as c,Be as d,Ye as e,Ee as f,ye as g,$ as h,nt as i,G as j,rt as k,it as l,at as m,st as n,ot as o,dt as p,lt as q,E as r,vt as s,I as t,yt as u,b as v,bt as w,Ct as x,Pt as y,L as z,Rt as A,je as B,Me as C,It as D,Ve as E,Ue as F,Lt as G,At as H};
|
|
81
|
-
//# sourceMappingURL=chunk-Q7GBK5T7.js.map
|
package/dist/chunk-QLBSG7U5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-ISWFRGJ6.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,u as B}from"./chunk-TD7VKJ2Y.js";import{b as f}from"./chunk-42W3LFUK.js";import{E as y,H as d}from"./chunk-Q7GBK5T7.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`)}function S(e){let t=e.indexOf("{"),o=e.lastIndexOf("}");if(t>=0&&o>t)return e.slice(t+1,o);let n=e.indexOf("=>");return n>=0?e.slice(n+2).replace(/;+\s*$/,""):e}function W(e){return S(e).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0).length}function F(e){return A("sha256").update(e).digest("hex").slice(0,16)}function z(e,t){let o=e.ageCommits??-1;return(t.ageCommits??-1)-o||e.file.localeCompare(t.file)||e.startLine-t.startLine}function b(e){return e.functions.reduce((t,o)=>t+o.loc,0)}export{H as a,M as b,I as c,v as d,P as e,E as f,S as g};
|
|
3
|
-
//# sourceMappingURL=chunk-QLBSG7U5.js.map
|
package/dist/chunk-QWKHW6VZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{B as I,i as Q,q as X,z as P}from"./chunk-WN3TCGJ4.js";import{a as L,b as G,d as R}from"./chunk-K3XFWJI2.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{F as U,U as H,V as W,a as V,fa as Y,g as F,h as S,o as O,pa as J,q,ra as K,ua as z}from"./chunk-AK3PYTIK.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
|
|
2
|
-
//# sourceMappingURL=chunk-QWKHW6VZ.js.map
|
package/dist/chunk-RPL3ARU7.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as g}from"./chunk-PLYUVM4F.js";import{a as y}from"./chunk-5H5WTJSD.js";import{d as p}from"./chunk-TD7VKJ2Y.js";import{b as h,g as l,i as d}from"./chunk-42W3LFUK.js";import{C as b}from"./chunk-7JYHQAH2.js";import{xa as u,ya as f}from"./chunk-GH5YSGZL.js";function T(t,e,s={}){let n=y(t,e);if(!n)return null;let o=new g(t),a=L(t,n),r=n.endLine-n.startLine+1,m=o.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(B=>B.symbol));return{symbol:n.symbol,shortName:p(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:a.branches,estimateBasis:a.estimateBasis,cyclomaticEstimate:a.branches+1,calleeCount:c.size,fanIn:N(t,n.symbolId),fanOut:w(m,n.relativePath)}}function L(t,e){let s=b(t,e.relativePath);if(s){let n=d(s.rootNode,e.startLine,e.endLine);if(n)return{branches:M(n),estimateBasis:"ast"}}return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function j(t,e){let s=new Map,n=new Map;for(let o of e){let a=n.get(o.relativePath)??[];a.push(o),n.set(o.relativePath,a)}for(let[o,a]of n){let r=b(t,o),i=r===null?[]:a.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});v(r.rootNode,i,s)}for(let c of a)m.has(c.symbolId)||s.set(c.symbolId,P(t,c))}return s}function P(t,e){return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function S(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function _(t,e,s,n){try{return u(t.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
|
|
2
|
-
`).slice(s,n+1).join(`
|
|
3
|
-
`)}catch(o){if(!f(o))throw o;return""}}function N(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = m.symbol_id
|
|
13
|
-
WHERE m.symbol_id = ?
|
|
14
|
-
AND m.role != 1
|
|
15
|
-
AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function M(t){let e=0;return l(t,s=>{e+=x(s)}),e}function v(t,e,s){let n=[...e].sort((o,a)=>o.startLine-a.startLine||a.endLine-o.endLine);l(t,o=>{let a=x(o);if(a===0)return;let r=o.startPosition.row,i=o.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=a)}})}var D=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function x(t){return D.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?I(t.text):0}function I(t){return(t.match(/&&|\|\|/g)??[]).length}function E(t,e){let s=h(t),n=0,o=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let a of o){let r=s.match(a);r&&(n+=r.length)}if(e==="python"){let a=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let a=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let a=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let a=[/\bselect\b/g,/\bdefer\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}return n}export{T as a,L as b,j as c,M as d};
|
|
16
|
-
//# sourceMappingURL=chunk-RPL3ARU7.js.map
|
package/dist/chunk-SVHTMVA4.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-BGBBVSH4.js";import{d as Pe}from"./chunk-6NC3YSPY.js";import{a as I}from"./chunk-IXESDH3J.js";import{b}from"./chunk-FELGD32K.js";import{b as pe,d as me,e as ge,f as be,g as Se,h as ye,i as K,j as he,m as Re}from"./chunk-2XCGSDIT.js";import{a as de}from"./chunk-WRQXLNYE.js";import{b as F}from"./chunk-T6QD2ZQB.js";import{c as ie}from"./chunk-BJT7LSPK.js";import{E as re,F as P,H as se,L as oe,R as E,S as le,T as ue,U as fe,V as B,h as ee,k as te,l as w,o as R,p as ne}from"./chunk-C7IJMOFP.js";import{a as h}from"./chunk-YXPUP5G2.js";import{d as k,f as $,g as V,i as ae,j as ce}from"./chunk-DRENNWRG.js";import{a as xe}from"./chunk-DHEQMPLW.js";import{d as g}from"./chunk-IW5XQG5G.js";import{e as J}from"./chunk-HGFDYOVB.js";import{C as x,ma as T,na as Q,oa as z}from"./chunk-AK3PYTIK.js";import{existsSync as A,readdirSync as Ee}from"fs";import{join as M}from"path";var ze={files:new Set,pathPrefixes:[]};var X=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,et=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,De=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],tt=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),nt=4,rt=g("package-surface",{clearGroups:["whole-project"]}),fn=g("package-operational-surface",{clearGroups:["whole-project"]});function Me(t){return rt.get(t,()=>it(t.config.projectRoot))}function G(t,e){let n=Me(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function ve(t,e){return Me(t).files.has(e)}function it(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of st(t))for(let i of ot(r))at(t,s,i,e,n);return e.size===0&&n.length===0?ze:{files:e,pathPrefixes:n}}function st(t){let e=[],n=Te(t,"");return n&&e.push({manifest:n,packageRoot:""}),Ce(t,"",e,0),e}function Ce(t,e,n,r){if(r>=nt)return;let s=M(t,e);if(A(s))for(let i of Ee(s,{withFileTypes:!0})){if(!i.isDirectory()||tt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name,a=Te(t,o);a&&n.push({manifest:a,packageRoot:o}),Ce(t,o,n,r+1)}}function Te(t,e){let n;try{n=T(t,M(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!Q(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function ot(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return we(t.exports,e),e}function we(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))we(n,e)}function at(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let o=i.indexOf("*");if(o>=0){let l=i.slice(0,o);for(let u of ke(l))u!==""&&s.push(S(e,u));return}let a=i.replace(et,"");for(let l of ke(a)){l===a&&l===i&&r.add(S(e,i));for(let u of De)ct(t,r,e,l+u)}r.add(S(e,i))}function ke(t){let e=[t];return X.test(t)&&(e.push(t.replace(X,"src/")),e.push(t.replace(X,""))),e}function ct(t,e,n,r){let s=S(n,r);if(e.add(s),!r.startsWith("src/")||A(M(t,s)))return;let i=De.find(c=>r.endsWith(c));if(!i)return;let o=r.slice(0,-i.length);lt(t,e,n,o,i);let a=o.lastIndexOf("/");if(a<=4)return;let l=o.slice(0,a),u=o.slice(a+1);for(let c of Fe(t,n,l,`${u}${i}`))e.add(c)}function lt(t,e,n,r,s){let i=S(n,`${r}/index${s}`);A(M(t,i))&&e.add(i)}function Fe(t,e,n,r){let s=M(t,e,n);if(!A(s))return[];let i=[];for(let o of Ee(s,{withFileTypes:!0})){let a=`${n}/${o.name}`;o.isDirectory()?i.push(...Fe(t,e,a,r)):o.isFile()&&o.name===r&&i.push(S(e,a))}return i}function S(t,e){return t?`${t}/${e}`:e}import{existsSync as q,readdirSync as ut}from"fs";import{dirname as ft,join as U}from"path";var dt={rootFiles:new Set,sourcePrefixes:[]},pt=new Set([".git",".scipquery","node_modules","target"]),mt=6,gt=g("rust-library-surface",{clearGroups:["whole-project"]});function Ie(t,e,n){if(!n.endsWith(".rs")||!yt(bt(t),n))return!1;let r=E(t,n).find(s=>s.symbol===e);return r?ht(te(t,n)[r.startLine]??""):!1}function bt(t){return gt.get(t,()=>St(t.config.projectRoot))}function St(t){let e=new Set,n=new Set;for(let r of Rt(t)){let s=T(t,U(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=xt(s),o=S(r,"src/lib.rs"),a=i?S(r,i):!Pt(s)&&z(t,o)?o:null;if(!a)continue;e.add(a);let l=ft(a).replaceAll("\\","/");n.add(l==="."?"":`${l}/`)}return e.size===0?dt:{rootFiles:e,sourcePrefixes:[...n].sort()}}function yt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:kt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function ht(t){return/^\s*pub\s+(?!\()/.test(t)}function Rt(t){if(!q(t))return[];let e=[];return Le(t,"",e,0),e}function Le(t,e,n,r){let s=U(t,e);if(q(s)&&(q(U(s,"Cargo.toml"))&&n.push(e),!(r>=mt)))for(let i of ut(s,{withFileTypes:!0})){if(!i.isDirectory()||pt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name;Le(t,o,n,r+1)}}function xt(t){let e=!1;for(let n of t.split(`
|
|
2
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Pt(t){let e=!1;for(let n of t.split(`
|
|
3
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function kt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Et(t){return Dt.get(t,()=>{let n=h(t,{includeIgnored:!1}).filter(o=>{let a=b(o);return a==="entry"||a==="worker"});if(n.length===0)return new Set;let r=F(t),s=new Set,i=new Set;for(;n.length>0;){let o=n.shift();if(!s.has(o)){s.add(o),b(o)==="barrel"&&i.add(o);for(let a of r.get(o)??[])s.has(a)||n.push(a)}}return i})}var Dt=g("live-barrels",{clearGroups:["whole-project"]});function Mt(t,e){return Et(t).has(x(e))}function Ne(t,e){let n=x(e),r=b(e);return r==="entry"||r==="worker"||Gt(n)||Mt(t,n)}function vt(t,e,n){let r=x(n),s=[];G(t,r)&&s.push("package-surface-file"),wt(t,e,r)&&s.push("transitive-package-surface"),Ie(t,e,r)&&s.push("rust-public-library"),Xt(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(o=>x(o)===r)&&s.push("configured-file"),i.pathPrefixes?.some(o=>r.startsWith(x(o)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(o=>Ut(e,o))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(o=>{try{return xe(o,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function _e(t,e,n){return vt(t,e,n).length>0}var Ct=g("package-surface-reachability",{clearGroups:["whole-project"]}),Tt=g("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function wt(t,e,n){let r=Ft(t).get(n);return r===void 0?!1:r===null||r.has(k(e))}function In(t,e,n){let r=It(t).get(n);return r===void 0?!1:r===null||r.has(k(e))}function Ft(t){return Ct.get(t,()=>je(t,e=>G(t,e)))}function It(t){return Tt.get(t,()=>je(t,e=>ve(t,e)))}function je(t,e){let n=new Map,r=[];for(let s of h(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let o of se(t,s)){if(!o.sourcePath||t.isIgnored(o.sourcePath))continue;let a=Lt(i,o);a!==void 0&&At(n,o.sourcePath,a)&&r.push(o.sourcePath)}}return n}function Lt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function At(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Oe=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Nt=new Set(["default","generateMetadata","generateStaticParams"]),_t=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),jt=new Set(["default","middleware","config"]),Ot=new Set(["register","onRequestError"]),$t=new Set(["onRouterTransitionStart"]),Vt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Bt=new Set(["load","actions","entries",...Oe]),Kt=new Set(["default"]);function Xt(t,e){let n=k(t);return n===""?!1:$e(e)?Oe.has(n):Ve(e)?Nt.has(n):Be(e)?_t.has(n):Ke(e)?jt.has(n):Xe(e)?Ot.has(n):Ge(e)?$t.has(n):qe(e)?Vt.has(n):Ue(e)?Bt.has(n):qt(e)?Kt.has(n):!1}function Gt(t){return $e(t)||Ve(t)||Be(t)||Ke(t)||Xe(t)||Ge(t)||qe(t)||Ue(t)}function $e(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ve(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Be(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ke(t){return W(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function Xe(t){return W(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function Ge(t){return W(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function W(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function qe(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ue(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function qt(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Ut(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(Ae(r)+"/")&&t.includes(Ae(s)+".")}function Ae(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function We(t,e,n={}){let r=new Map;if(e&&e.length===0)return r;let s=h(t,{includeIgnored:!1}),i=be(t),o=e??le(t),a=new Set(o.map(u=>u.symbolId)),l=zt(o);return Wt(t,r,s,i,a,l),Ht(t,r,o,a),Qt(t,r,s,i,a,l),n.semantic!==!1&&n.semanticEvidence&&tn(r,n.semanticEvidence.callerMap(t,en(o))),r}function Wt(t,e,n,r,s,i){for(let o of n){if(!R(o))continue;let a=re(t,o);if(a)for(let l of a){if(i&&!i.has(l.calleeLeaf))continue;let u=me(o,r.get(l.calleeLeaf)??[]);if(!u||u.length===0)continue;let c=ge(t,o,u,l.memberAccess,l.calleeQualifier);c&&s.has(c.symbolId)&&c.file!==o&&H(e,c.symbolId,o)}}}function Ht(t,e,n,r){let s=Zt(n);for(let i of Yt(t,r))t.isIgnored(i.relative_path)||Jt(i,s.get(i.symbol_id))||H(e,i.symbol_id,i.relative_path)}function Yt(t,e){return de(t,e?[...e]:void 0)}function Zt(t){let e=new Map;for(let n of t)e.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return e}function Jt(t,e){return!!e&&e.docId===t.document_id&&t.chunk_start>=e.startLine&&t.chunk_end<=e.endLine}function Qt(t,e,n,r,s,i){for(let o of n){if(R(o)!=="rust")continue;let a=P(t,o,{includeRustAttributeNames:!0});if(a.length!==0)for(let{name:l}of a){if(i&&!i.has(l))continue;let u=r.get(l);if(u)for(let c of u)s.has(c.symbolId)&&c.file!==o&&H(e,c.symbolId,o)}}}function H(t,e,n){let r=t.get(e);r||(r=new Set,t.set(e,r)),r.add(n)}function zt(t){let e=new Set;for(let n of t){let r="leaf"in n&&typeof n.leaf=="string"?n.leaf:"symbol"in n&&typeof n.symbol=="string"?k(n.symbol):"";r&&e.add(r)}return e.size>0?e:null}function en(t){return t.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function tn(t,e){for(let[n,r]of e){let s=t.get(n);s||(s=new Set,t.set(n,s));for(let i of r)s.add(i)}}function Y(t,e,n={}){return We(t,e,n)}function Z(t,e,n={}){return Re(t,e,n)}function He(t,e,n={}){let r=Y(t,e,{semantic:n.semantic,semanticEvidence:n.semanticEvidence});return n.sourceFallback===!1?r:nn(r,Z(t,e))}function nn(t,e){let n=new Map;for(let[r,s]of t)n.set(r,new Set(s));for(let[r,s]of e){let i=n.get(r)??new Set;for(let o of s)i.add(o);n.set(r,i)}return n}function Ye(t,e,n){let r=e.identifierResolution==="strict"?K:he,s=e.candidateNames?Se(e.candidateNames):null,i=0,o=0,a=0,l=0,u="";for(let c of e.paths)if(i+=1,u=c,!(!R(c)&&!(e.includeVueSfc&&ne(c)))&&!t.isIgnored(c)&&!e.skipPath?.(c))try{if(s&&!ye(ee(t,c),s))continue;o+=1;let v=(d,m,j,D)=>{if(e.candidateNames&&!e.candidateNames.has(d))return;a+=1;let C=e.resolveTargets?e.resolveTargets({sourceFile:c,name:d,kind:m,defaultTargets:D}):D();for(let O of C)l+=1,n({sourceFile:c,name:d,target:O,occurrences:j,kind:m})},_=pe(t,c);for(let[d,m]of _)v(d,"identifier",m.length,()=>r(t,c,d));for(let d of P(t,c,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let m=d.kind==="cross-language-dispatch"?()=>K(t,c,d.name):()=>r(t,c,d.name);v(d.name,d.kind,d.occurrences,m)}}finally{e.afterPath?.(c),i%10===0&&J("source-reference-scan.progress",()=>{},()=>({scannedPaths:i,currentPath:u,candidateMatchedPaths:o,visitedNames:a,visitedHits:l}))}}function Ze(t,e={}){let{scope:n,files:r,minLoc:s=1,maxLoc:i=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:a=!1,excludeTypesFiles:l=!1,excludeRootedSymbols:u=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:N=!1,excludeRustTraitImplMembers:v=!1,includeSuppressed:_=!1,sortByLocDesc:d=!1}=e,m=[],j=rn(t,{scope:n,files:r,requireFunctionLikeSymbol:c,requireCallableSymbol:N}),D=new Map,C=new Map,O=f=>{let p=D.get(f);if(p!==void 0)return p;let y=Ne(t,f);return D.set(f,y),y},Qe=f=>{let p=C.get(f);if(p!==void 0)return p;let y=b(f);return C.set(f,y),y};for(let f of j){let p=f.relativePath;if(t.isIgnored(p)||a&&O(p)||!sn(f,{requireFunctionLikeSymbol:c,requireCallableSymbol:N})||o!==void 0&&f.symbol===o)continue;let y=L(f);y<s||y>i||l&&on(p)||u&&_e(t,f.symbol,p)||v&&ae(f.symbol)||Qe(p)!=="test"&&(ce(f.symbol)||!_&&w(t,p,f.startLine)||m.push(f))}return d?m.sort((f,p)=>L(p)-L(f)):m}function rn(t,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>E(t,r)):e.requireCallableSymbol?B(t,{scope:e.scope,symbolMatches:$,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?B(t,{scope:e.scope,symbolMatches:V,sqlPrefilter:"function-like"}):fe(t,e.scope)}function sn(t,e){return e.requireCallableSymbol?$(t.symbol):e.requireFunctionLikeSymbol?V(t.symbol):t.isFunctionLike}function on(t){return(t.split("/").pop()??"").includes("types")}var Je=class{constructor(e){this.db=e}db;scopedDefinitions(e){return ue(this.db,e)}definitionsForFile(e){return E(this.db,e)}productionCallableDefinitions(e={}){return Ze(this.db,e)}calleeMap(e,n={}){return Pe(this.db,e,{...n,semanticEvidence:I})}crossFileCallerMap(e,n={}){return Y(this.db,e,{...n,semanticEvidence:I})}sourceFallbackCallerFiles(e,n={}){return Z(this.db,e,n)}callerFileMap(e,n={}){return He(this.db,e,{...n,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let n=new Map;for(let s of e){if(!s.leaf)continue;let i=n.get(s.leaf)??[];i.push(s.symbolId),n.set(s.leaf,i)}let r=new Set;for(let s of h(this.db,{includeIgnored:!1}))if(R(s)==="rust")for(let{name:i}of P(this.db,s,{includeRustAttributeNames:!0}))for(let o of n.get(i)??[])r.add(o);return r}symbolsWithNonSelfCallees(e,n={}){if(e.length===0)return new Set;let r=new Map(e.map(i=>[i.symbolId,i.symbol])),s=this.calleeMap(e,n);return new Set([...s.entries()].filter(([i,o])=>{let a=r.get(i);return o.some(l=>l.symbol!==a)}).map(([i])=>i))}fileDependencyGraph(e){return F(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return w(this.db,e.relativePath,e.startLine)}sourceFiles(){return ie(this.db)}scanSourceReferences(e,n){Ye(this.db,e,n)}callableSignature(e){let n=oe(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return n?{paramCount:n.paramCount}:null}};export{Ne as a,vt as b,In as c,Je as d};
|
|
4
|
-
//# sourceMappingURL=chunk-SVHTMVA4.js.map
|
package/dist/chunk-T6QD2ZQB.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{H as G,J as O,b as R,c as x}from"./chunk-C7IJMOFP.js";import{a as F}from"./chunk-YXPUP5G2.js";import{b as P,d as E}from"./chunk-DKM723YF.js";import{c as I}from"./chunk-IW5XQG5G.js";import{e as g}from"./chunk-HGFDYOVB.js";var _=R({kind:"file-dependency-graph",invalidation:x("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:K}),k=I("file-dep-graph",{clearGroups:["whole-project"]});function X(e,n,r){if(r.length===0)return[];let t=new Set(r),i=M(e),s=new Set;if(n==="forward")for(let o of t)for(let c of i.get(o)??[])t.has(c)||s.add(c);else for(let[o,c]of i)if(!t.has(o))for(let l of t)c.has(l)&&s.add(o);return[...s].sort()}function M(e,n,r={}){let t=r.scipEdges??"all-references",i=r.sourceEdges??"imports-only",s=m(n,t,i);return k.get(e,s,()=>{let o=new Set(F(e,{includeIgnored:!1})),c=E(e),l=0,f=0,a=null,p=!1,u=0,C=0,N=null;return g("file-dep-graph.product",()=>{if(c){let d=_.read(e,s,c);if(d){p=!0,N=d.construction;let S=w(d);return l=d.sourceFileCount,f=d.sourceEdgeCount,u=d.scipEdgeCount,C=S.size,a=d.sourceDependencyFingerprint,S}}let D=i==="none"?{files:[],edges:[],fingerprint:P("no-source-dependency-fallback")}:g("file-dep-graph.source-imports",()=>{let d=j(e,o,n,i);return l=d.files.length,f=d.edges.length,a=d.fingerprint,d},()=>({scope:n??null,sourceEdges:i,files:l,edges:f})),y=new Map,A=(d,S)=>h(e,y,o,d,S);g("file-dep-graph.scip-edges",()=>{for(let d of L(e,n,t))u=(u??0)+1,A(d.from_file,d.to_file)},()=>({scope:n??null,edges:u}));for(let d of D.edges)A(d.fromFile,d.toFile);return C=y.size,c&&(N="full",_.write(e,s,c,{version:2,construction:"full",sourceDependencyFingerprint:D.fingerprint,sourceFileCount:D.files.length,sourceEdgeCount:D.edges.length,scipEdgeCount:u,edgeCount:v(y),graph:b(y)})),y},()=>({scope:n??null,available:c!==null,hit:p,construction:N,files:l,sourceEdges:f,sourceEdgeMode:i,scipEdges:u,graphFiles:C,sourceDependencyFingerprint:a}))})}function Z(e){return J(e,"none")}function ee(e,n="imports-only"){let r=m(void 0,"all-references",n),t=E(e);if(!t)return null;let i=_.read(e,r,t);return i?{cacheKey:r,sourceEdges:n,graph:w(i)}:null}function J(e,n){let r=m(void 0,"all-references",n),t=M(e,void 0,{sourceEdges:n});return{cacheKey:r,sourceEdges:n,graph:t}}function ne(e,n,r,t){let i=n.sourceEdges??"imports-only",s=E(e);if(!s)return!1;let o=t??$(e,n,r);if(!o)return!1;let c=new Set(F(e,{includeIgnored:!1})),l=m(void 0,"all-references",i);return _.write(e,l,s,{version:2,construction:"carried",sourceDependencyFingerprint:null,sourceFileCount:c.size,sourceEdgeCount:null,scipEdgeCount:null,edgeCount:v(o),graph:b(o)}),!0}function $(e,n,r,t=[]){let i=n.sourceEdges??"imports-only",s=m(void 0,"all-references",i);if(n.cacheKey!==s)return null;let o=g("file-dep-graph.carry.indexed-files",()=>new Set(F(e,{includeIgnored:!1}))),c=new Set(r),l=new Map;g("file-dep-graph.carry.reuse",()=>{if(t.length===0)for(let[a,p]of n.graph)c.has(a)||l.set(a,p);else for(let[a,p]of n.graph)if(!(c.has(a)||!o.has(a)))for(let u of p)h(e,l,o,a,u)});let f=g("file-dep-graph.carry.scip-edges",()=>W(e,c,"all-references"));for(let a of f)h(e,l,o,a.from_file,a.to_file);return g("file-dep-graph.carry.source-edges",()=>{for(let a of c)if(o.has(a)){if(i!=="none")for(let p of O(e,a))p.sourcePath&&h(e,l,o,a,p.sourcePath);if(i==="imports-and-reexports")for(let p of G(e,a))p.sourcePath&&h(e,l,o,a,p.sourcePath)}}),l}function j(e,n,r,t){let i=[],s=[];for(let o of n)if(!(r&&!o.includes(r))){i.push(o);for(let c of O(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath});if(t==="imports-and-reexports")for(let c of G(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath})}return{files:i,edges:s,fingerprint:T(i,s)}}function T(e,n){let r=n.map(t=>`${t.fromFile}\0${t.toFile}`).sort();return P(JSON.stringify({files:e,edges:r}))}function m(e,n,r){return`edge-mode-v4:${n}:${r}:${e??"<all>"}`}function b(e){return[...e].map(([n,r])=>[n,[...r].sort()]).sort(([n],[r])=>n.localeCompare(r))}function w(e){return new Map(e.graph.map(([n,r])=>[n,new Set(r)]))}function K(e){let n=JSON.parse(e);return z(n)?n:null}function z(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===2&&(n.construction==="full"||n.construction==="carried")&&(n.sourceDependencyFingerprint===null||typeof n.sourceDependencyFingerprint=="string")&&typeof n.sourceFileCount=="number"&&(n.sourceEdgeCount===null||typeof n.sourceEdgeCount=="number")&&(n.scipEdgeCount===null||typeof n.scipEdgeCount=="number")&&typeof n.edgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(H)}function v(e){let n=0;for(let r of e.values())n+=r.size;return n}function H(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function L(e,n,r){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],s=r==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
${s}
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${t}`,...i)}function W(e,n,r){let t=[...n].sort();if(t.length===0)return[];let i=r==="imports-only"?"AND m.role = 2":"AND m.role != 1",s=[];for(let o=0;o<t.length;o+=500){let c=t.slice(o,o+500),l=c.map(()=>"?").join(", ");s.push(...e.all(`SELECT DISTINCT
|
|
20
|
-
d1.relative_path AS from_file,
|
|
21
|
-
d2.relative_path AS to_file
|
|
22
|
-
FROM documents d1
|
|
23
|
-
CROSS JOIN chunks c
|
|
24
|
-
CROSS JOIN mentions m
|
|
25
|
-
CROSS JOIN global_symbols gs
|
|
26
|
-
CROSS JOIN chunks c2
|
|
27
|
-
CROSS JOIN documents d2
|
|
28
|
-
WHERE d1.relative_path IN (${l})
|
|
29
|
-
AND c.document_id = d1.id
|
|
30
|
-
AND m.chunk_id = c.id
|
|
31
|
-
AND gs.id = m.symbol_id
|
|
32
|
-
AND c2.id = (
|
|
33
|
-
SELECT m2.chunk_id
|
|
34
|
-
FROM mentions m2
|
|
35
|
-
WHERE m2.symbol_id = gs.id AND m2.role = 1
|
|
36
|
-
ORDER BY m2.chunk_id
|
|
37
|
-
LIMIT 1
|
|
38
|
-
)
|
|
39
|
-
AND d2.id = c2.document_id
|
|
40
|
-
AND d1.id != d2.id
|
|
41
|
-
${i}
|
|
42
|
-
${e.pathExclusionsFor("d1","d2")}`,...c))}return s}function h(e,n,r,t,i){if(t===i||e.isIgnored(t)||e.isIgnored(i)||!r.has(i))return;let s=n.get(t);s||(s=new Set,n.set(t,s)),s.add(i)}export{X as a,M as b,Z as c,ee as d,ne as e,$ as f};
|
|
43
|
-
//# sourceMappingURL=chunk-T6QD2ZQB.js.map
|
package/dist/chunk-TD7VKJ2Y.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import{a as I,n as v,q as P,w as Q,x as j}from"./chunk-42W3LFUK.js";import{C as A,a as D}from"./chunk-7JYHQAH2.js";import{B as $,E as w,c as S,d as N,i as h,j as x,p as _,w as C,y as O,z as T}from"./chunk-Q7GBK5T7.js";var ie={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=re(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function p(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function re(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||B(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!B(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ie[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function B(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function W(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=se(r);s&&i.push(s)}return i.join(":")}function se(e){let n=e.suffix==="namespace"?oe(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function oe(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function J(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function g(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Be(e){return e.endsWith("().")||g(e)==="method"}function L(e){let n=g(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function We(e){return g(e)==="namespace"}var ae=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Je(e){return ae.test(e)}var le=new Set(["test","tests","_tests"]);function ze(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&le.has(i.name))return!0}return!1}function He(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ge(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ke(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE ${n.where}
|
|
6
|
-
${e.pathExclusionsFor("d")}
|
|
7
|
-
${H(n.orderBy)}
|
|
8
|
-
${G(n.limit)}`,...n.params??[])}function Ye(e,n){return e.all(`SELECT
|
|
9
|
-
gs.id,
|
|
10
|
-
gs.symbol,
|
|
11
|
-
c.document_id,
|
|
12
|
-
MIN(c.start_line) AS start_line,
|
|
13
|
-
0 AS start_char,
|
|
14
|
-
MAX(c.end_line) AS end_line,
|
|
15
|
-
0 AS end_char,
|
|
16
|
-
d.relative_path,
|
|
17
|
-
gs.display_name,
|
|
18
|
-
gs.documentation
|
|
19
|
-
FROM global_symbols gs
|
|
20
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
21
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
-
JOIN documents d ON c.document_id = d.id
|
|
23
|
-
WHERE m.role = 1
|
|
24
|
-
AND ${n.where}
|
|
25
|
-
${e.pathExclusionsFor("d")}
|
|
26
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
27
|
-
${H(n.orderBy)}
|
|
28
|
-
${G(n.limit)}`,...n.params??[])}function H(e){return e?`ORDER BY ${e}`:""}function G(e){return typeof e=="number"?`LIMIT ${e}`:""}function U(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function K(e){if(!e)return null;let n=z(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(z(i)??i).replace(/\n/g," ")}function z(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function b(e){return{forFile(n,t){return Y(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,Y(e,r,t));return i}}}function Y(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=$(e,n)),t.lines&&(i.lines=w(e,n)),t.ast&&(i.ast=A(e,n)),t.imports&&(i.imports=j(e,n)),t.reexports&&(i.reexports=Q(e,n)),r){let s=v(e,n),o=s.facts;t.facts&&(i.facts=o),s.unavailable&&(i.sourceFactsUnavailable=s.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}return i}function ce(e,n={}){if(p(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function F(e,n,t={}){let i=new Map;for(let s of n)e.length>0&&!ce(s,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return t.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}function yn(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}var de=S("file-definitions",{clearGroups:["definition-catalog"]}),ue=N("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),fe=S("file-function-like-definitions",{clearGroups:["definition-catalog"]}),X=new WeakMap;function E(e,n,t={},i){return T(n),t.includeClassMemberFallbacks?R(e,n,void 0,{includeClassMemberFallbacks:!0},i):de.get(e,n,()=>{let r=m(i,"evidence-read",()=>ee(e,n));if(r)return r;let s=R(e,n,void 0,t,i);return m(i,"evidence-write",()=>{let o=x(e),a=b(e).forFile(n,{text:!0}).text;o&&a&&V.write(e,n,h(e,n,a),{projectFingerprint:o,definitions:s.map(c=>({...c}))})}),s})}function me(e,n){return fe.get(e,n,()=>{let t=ee(e,n);return t?t.filter(i=>i.isFunctionLike):R(e,n,i=>i.isFunctionLike)})}var V=C({kind:"file-definitions",invalidation:O("file-definitions"),serialize:pe,deserialize:ge});function ee(e,n){let t=x(e);if(!t)return null;let i=b(e).forFile(n,{text:!0}).text;if(!i)return null;let r=V.read(e,n,h(e,n,i));return r?be(r,t,n):null}function pe(e){return JSON.stringify(e)}function ge(e){try{let n=JSON.parse(e);return!_(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function be(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let s=ye(r,t);if(!s)return null;i.push(s)}return i}function ye(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function R(e,n,t,i={},r){let s=m(r,"primary-rows",()=>Se(e,n)),o=m(r,"fallback-rows",()=>he(e,n)),a=m(r,"merge-rows",()=>F(s,o,{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(k));return t&&(a=a.filter(t)),m(r,"range-correction",()=>M(e,n,a,r,i.rangeCorrectionEvidence))}function m(e,n,t){return e?e(n,t):t()}function Se(e,n){return e.all(`SELECT
|
|
29
|
-
gs.id,
|
|
30
|
-
gs.symbol,
|
|
31
|
-
der.document_id,
|
|
32
|
-
der.start_line,
|
|
33
|
-
der.start_char,
|
|
34
|
-
der.end_line,
|
|
35
|
-
der.end_char,
|
|
36
|
-
d.relative_path,
|
|
37
|
-
gs.display_name,
|
|
38
|
-
gs.kind,
|
|
39
|
-
gs.documentation,
|
|
40
|
-
gs.enclosing_symbol
|
|
41
|
-
FROM global_symbols gs
|
|
42
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
43
|
-
JOIN documents d ON der.document_id = d.id
|
|
44
|
-
WHERE d.relative_path = ?
|
|
45
|
-
${e.symbolNoiseFor("gs")}
|
|
46
|
-
ORDER BY der.start_line, der.end_line`,n)}function he(e,n){return e.all(`SELECT
|
|
47
|
-
gs.id,
|
|
48
|
-
gs.symbol,
|
|
49
|
-
c.document_id,
|
|
50
|
-
MIN(c.start_line) AS start_line,
|
|
51
|
-
0 AS start_char,
|
|
52
|
-
MAX(c.end_line) AS end_line,
|
|
53
|
-
0 AS end_char,
|
|
54
|
-
d.relative_path,
|
|
55
|
-
gs.display_name,
|
|
56
|
-
gs.kind,
|
|
57
|
-
gs.documentation,
|
|
58
|
-
gs.enclosing_symbol
|
|
59
|
-
FROM global_symbols gs
|
|
60
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
61
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
62
|
-
JOIN documents d ON c.document_id = d.id
|
|
63
|
-
WHERE d.relative_path = ?
|
|
64
|
-
AND m.role = 1
|
|
65
|
-
${e.symbolNoiseFor("gs")}
|
|
66
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
67
|
-
ORDER BY start_line, end_line`,n)}function k(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:J(e.symbol),parentTypeName:p(e.symbol),isFunctionLike:L(e.symbol),isTypeLike:g(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Sn(e,n={}){return xe(e,n.scope)}function xe(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>E(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function hn(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>me(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function xn(e,n){let t=ue.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),s=i.get(r);if(s)return[...s];let o=Z(De(e,n.scope,n.sqlPrefilter)),a=Z(_e(e,n.scope,n.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=F(o.get(d)??[],a.get(d)??[],{sort:!0}).filter(te=>n.symbolMatches(te.symbol));f.length!==0&&l.push(...M(e,d,f.map(k)))}return i.set(r,l),[...l]}function De(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ne("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
68
|
-
gs.id,
|
|
69
|
-
gs.symbol,
|
|
70
|
-
der.document_id,
|
|
71
|
-
der.start_line,
|
|
72
|
-
der.start_char,
|
|
73
|
-
der.end_line,
|
|
74
|
-
der.end_char,
|
|
75
|
-
d.relative_path,
|
|
76
|
-
gs.display_name,
|
|
77
|
-
gs.kind,
|
|
78
|
-
gs.documentation,
|
|
79
|
-
gs.enclosing_symbol
|
|
80
|
-
FROM global_symbols gs
|
|
81
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
82
|
-
JOIN documents d ON der.document_id = d.id
|
|
83
|
-
WHERE 1 = 1
|
|
84
|
-
${e.pathExclusionsFor("d")}
|
|
85
|
-
${i}
|
|
86
|
-
${r}
|
|
87
|
-
${e.symbolNoiseFor("gs")}
|
|
88
|
-
ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function _e(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ne("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
89
|
-
gs.id,
|
|
90
|
-
gs.symbol,
|
|
91
|
-
c.document_id,
|
|
92
|
-
MIN(c.start_line) AS start_line,
|
|
93
|
-
0 AS start_char,
|
|
94
|
-
MAX(c.end_line) AS end_line,
|
|
95
|
-
0 AS end_char,
|
|
96
|
-
d.relative_path,
|
|
97
|
-
gs.display_name,
|
|
98
|
-
gs.kind,
|
|
99
|
-
gs.documentation,
|
|
100
|
-
gs.enclosing_symbol
|
|
101
|
-
FROM global_symbols gs
|
|
102
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
103
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
104
|
-
JOIN documents d ON c.document_id = d.id
|
|
105
|
-
WHERE m.role = 1
|
|
106
|
-
AND NOT EXISTS (
|
|
107
|
-
SELECT 1
|
|
108
|
-
FROM defn_enclosing_ranges existing_der
|
|
109
|
-
WHERE existing_der.symbol_id = gs.id
|
|
110
|
-
)
|
|
111
|
-
${e.pathExclusionsFor("d")}
|
|
112
|
-
${i}
|
|
113
|
-
${r}
|
|
114
|
-
${e.symbolNoiseFor("gs")}
|
|
115
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
|
-
ORDER BY d.relative_path, start_line, end_line`,...s)}function Ie(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function ne(e,n){return n==="callable"?Ie(e):Le(e)}function Le(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Z(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Dn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>E(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:W(r.symbol),signature:U(K(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Fe(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function _n(e,n){let t=X.get(e);return t||(t=Fe(e),X.set(e,t)),t.get(n)??null}function In(e,n){let t=E(e,n.relative_path).find(i=>i.symbolId===n.id)??(p(n.symbol)===null||!L(n.symbol)?void 0:M(e,n.relative_path,[k(n)])[0]);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function M(e,n,t,i,r){let s=m(i,"range-correction.source-text",()=>r?r.source:b(e).forFile(n,{text:!0}).text),o=m(i,"range-correction.callable-sites",()=>r?r.callables:P(e,n));return o?m(i,"range-correction.ast-correction",()=>Ce(t,o,s)):s?m(i,"range-correction.regex-fallback",()=>Re(t,s)):t}function Re(e,n){let t=n.split(/\r?\n/),i=Ee(e,t),r=ke(e,i),s=Me(r,t);return Ne(e,s)}function Ee(e,n){let t=e.some(r=>y(r.symbol))?Pe(n):null,i=new Map;for(let r of e)i.set(r.symbolId,ve(n,t,r));return i}function ke(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Me(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:Qe(n,r.definition,r.startLine,o)})}return t}function Ne(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function Ce(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!Ae(r)||!r.leaf)return q(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return q(r,t);let o=t?Oe(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Oe(e,n,t){let i=Te(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${I(i)}\\b`);for(let o of n){let a=$e(r,o.startLine);if(a&&s.test(a))return o}return null}function Te(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function $e(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return we(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function we(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function Ae(e){return y(e.symbol)?!0:g(e.symbol)==="term"&&p(e.symbol)===null}function q(e,n){if(!n||!e.leaf||g(e.symbol)!=="term"||p(e.symbol)!==null)return e;let t=I(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function ve(e,n,t){if(!y(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function Pe(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function Qe(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=je(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function je(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function y(e){return e.includes("().")}function Ln(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{b as a,u as b,p as c,W as d,J as e,g as f,Be as g,L as h,We as i,Je as j,ze as k,He as l,Ge as m,Ke as n,Ye as o,U as p,K as q,F as r,yn as s,E as t,Sn as u,xe as v,hn as w,xn as x,Dn as y,Fe as z,_n as A,In as B,Ln as C};
|
|
117
|
-
//# sourceMappingURL=chunk-TD7VKJ2Y.js.map
|