scip-query 0.22.0 → 0.23.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 +257 -0
- package/README.md +11 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-XI2CSWEY.js +2 -0
- package/dist/call-graph-UONR6JR5.js +2 -0
- package/dist/{chunk-FGNCOQUX.js → chunk-2E7CX53V.js} +2 -2
- package/dist/chunk-2GRUZAQF.js +43 -0
- package/dist/{chunk-DPWKKNKI.js → chunk-2LDBDR6J.js} +2 -2
- package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
- package/dist/{chunk-XGGBK66W.js → chunk-2R3V3PSD.js} +2 -2
- package/dist/chunk-2WC2OEDO.js +4 -0
- package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
- package/dist/{chunk-2RE5OCHZ.js → chunk-3D3QG236.js} +2 -2
- package/dist/{chunk-D2MVJSP4.js → chunk-3FHOF22C.js} +2 -2
- package/dist/{chunk-7XZGZBSQ.js → chunk-3JKSW6LJ.js} +2 -2
- package/dist/chunk-3L2ZBPEX.js +133 -0
- package/dist/{chunk-NVSZNESQ.js → chunk-3PJABJSU.js} +2 -2
- package/dist/{chunk-WOOAY3PA.js → chunk-3SVF22I5.js} +2 -2
- package/dist/{chunk-YAGYMBEX.js → chunk-3WR4E3A3.js} +2 -2
- package/dist/chunk-4FTZ4P5G.js +2 -0
- package/dist/{chunk-F24G5NBE.js → chunk-4ILJCCXV.js} +2 -2
- package/dist/chunk-4UX2F3JX.js +2 -0
- package/dist/chunk-4WNW27SX.js +2 -0
- package/dist/chunk-5ENOG4VP.js +61 -0
- package/dist/{chunk-RHHCLWQ6.js → chunk-64BFSI5I.js} +2 -2
- package/dist/chunk-66DVSJQG.js +455 -0
- package/dist/{chunk-ISWFRGJ6.js → chunk-6HFCYNYE.js} +2 -2
- package/dist/{chunk-Y2VM4CJC.js → chunk-6I6L7Z62.js} +2 -2
- package/dist/{chunk-CKRWA452.js → chunk-6PQNKL3G.js} +2 -2
- package/dist/{chunk-GPGRZJ3R.js → chunk-6V5CNXL6.js} +2 -2
- package/dist/chunk-6VVV4WRR.js +4 -0
- package/dist/{chunk-BDGTPN27.js → chunk-7BWFZPPZ.js} +2 -2
- package/dist/{chunk-25GWKRUZ.js → chunk-7CYG22FH.js} +2 -2
- package/dist/chunk-7F45LJKI.js +2 -0
- package/dist/{chunk-4TQU4TX2.js → chunk-7IWV2EG3.js} +2 -2
- package/dist/{chunk-UDY7MIAW.js → chunk-AFHTBORT.js} +2 -2
- package/dist/chunk-AVRYW5OZ.js +2 -0
- package/dist/chunk-B3PYOSCX.js +2 -0
- package/dist/{chunk-RNKPYYYE.js → chunk-B5D7QPBE.js} +2 -2
- package/dist/{chunk-FFJQZG6J.js → chunk-BBCIS4DX.js} +2 -2
- package/dist/chunk-BDUVI7TO.js +3 -0
- package/dist/{chunk-BVFYEEBH.js → chunk-BE7ZZTMC.js} +2 -2
- package/dist/{chunk-NEIQPFBI.js → chunk-BHVUJOCQ.js} +2 -2
- package/dist/chunk-BKVWUP7Y.js +2 -0
- package/dist/{chunk-IJMD6BRI.js → chunk-BQGB4HBD.js} +2 -2
- package/dist/{chunk-ERCYGVAM.js → chunk-BRV7PIFF.js} +2 -2
- package/dist/chunk-CEEZJXEF.js +2 -0
- package/dist/{chunk-BTVKZGWT.js → chunk-CIYLO6SI.js} +2 -2
- package/dist/chunk-CJZXN4NU.js +2 -0
- package/dist/{chunk-VXJJTQYE.js → chunk-CNO7TOKL.js} +2 -2
- package/dist/{chunk-ZZ3Z7D56.js → chunk-COF23M5F.js} +2 -2
- package/dist/{chunk-ZGW4HLPD.js → chunk-CWFP7GM5.js} +2 -2
- package/dist/chunk-D2DHWI3D.js +2 -0
- package/dist/{chunk-Q55NF3ZG.js → chunk-D4N5SQ2M.js} +2 -2
- package/dist/{chunk-LXQUF2RP.js → chunk-DBRSYFXR.js} +2 -2
- package/dist/{chunk-PXXYQK55.js → chunk-DHUIOLDT.js} +2 -2
- package/dist/{chunk-KZYID5KV.js → chunk-DIRJWYBM.js} +2 -2
- package/dist/{chunk-IKVNEGTW.js → chunk-DIUFNHRJ.js} +2 -2
- package/dist/{chunk-CLG6DWVS.js → chunk-DTZCKZEU.js} +2 -2
- package/dist/{chunk-Z2PZVKPR.js → chunk-DULC3QFP.js} +2 -2
- package/dist/{chunk-AYPDH2LU.js → chunk-DYGHBZ2N.js} +2 -2
- package/dist/{chunk-JJ62MTQH.js → chunk-E5R6AQ73.js} +2 -2
- package/dist/{chunk-BWVQP3LB.js → chunk-E73UNJTF.js} +2 -2
- package/dist/{chunk-GVOMSPGL.js → chunk-EG2CPZMJ.js} +2 -2
- package/dist/{chunk-56NQAEPJ.js → chunk-EKV5HX33.js} +2 -2
- package/dist/{chunk-GDRJB3SB.js → chunk-EQHFIL6T.js} +2 -2
- package/dist/{chunk-EWWY2ZFL.js → chunk-ESIQ66Z7.js} +2 -2
- package/dist/chunk-EVFUMY4R.js +3 -0
- package/dist/{chunk-ZYM4HOFA.js → chunk-F7DY272B.js} +2 -2
- package/dist/chunk-FBN2FGXG.js +2 -0
- package/dist/{chunk-AZS7YPCB.js → chunk-FDLOBR6P.js} +2 -2
- package/dist/chunk-FESCRNVV.js +5 -0
- package/dist/{chunk-URSGGIZX.js → chunk-FFRKR4EQ.js} +2 -2
- package/dist/chunk-FGA2U4OR.js +8 -0
- package/dist/{chunk-7YQOCABQ.js → chunk-FIQRSHVM.js} +2 -2
- package/dist/{chunk-KFVSJX25.js → chunk-FPYLNQPT.js} +2 -2
- package/dist/{chunk-FELGD32K.js → chunk-FRUSVINH.js} +2 -2
- package/dist/chunk-GAS2LJMP.js +3 -0
- package/dist/{chunk-OTSPRVNW.js → chunk-GSP44ENC.js} +2 -2
- package/dist/{chunk-K3XFWJI2.js → chunk-GUFSG5TX.js} +2 -2
- package/dist/chunk-GYIZ4NXB.js +2 -0
- package/dist/{chunk-2OXVP5U5.js → chunk-GZIUDL6G.js} +2 -2
- package/dist/chunk-HCXEQRFF.js +18 -0
- package/dist/{chunk-LO5JSW2C.js → chunk-HEHOQQKH.js} +2 -2
- package/dist/{chunk-U2N2KE7A.js → chunk-HKGFPJ4T.js} +2 -2
- package/dist/chunk-HLZTEXRA.js +2 -0
- package/dist/{chunk-EELPBR7E.js → chunk-HOENASQM.js} +2 -2
- package/dist/{chunk-VTCIYFEK.js → chunk-HVF5VBG6.js} +2 -2
- package/dist/{chunk-TH6IC56G.js → chunk-HYO3NP5Q.js} +2 -2
- package/dist/{chunk-OPSAW5DT.js → chunk-I55I7XXP.js} +2 -2
- package/dist/{chunk-DEAB5TGT.js → chunk-IDFEUFKS.js} +2 -2
- package/dist/{chunk-DJAO2OZJ.js → chunk-IHGQTTVW.js} +2 -2
- package/dist/{chunk-XU75YQN4.js → chunk-IICPE7B2.js} +2 -2
- package/dist/{chunk-GY7CCCEZ.js → chunk-IL676XCC.js} +2 -2
- package/dist/{chunk-4HE7MVWD.js → chunk-ILTDAWEF.js} +2 -2
- package/dist/chunk-IZDPJ2QI.js +2 -0
- package/dist/{chunk-5YRQIE2B.js → chunk-J66VOFW6.js} +2 -2
- package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
- package/dist/{chunk-QLBSG7U5.js → chunk-JGKUET5J.js} +2 -2
- package/dist/{chunk-VZ7NXSHV.js → chunk-JS4PGXMV.js} +2 -2
- package/dist/{chunk-ZAZGGSM3.js → chunk-JTQVMR42.js} +2 -2
- package/dist/chunk-JWTGMPIT.js +80 -0
- package/dist/{chunk-5ZMBRQFC.js → chunk-JYR66JN5.js} +2 -2
- package/dist/chunk-KLFEXGQA.js +2 -0
- package/dist/chunk-KYSDI3GE.js +5 -0
- package/dist/{chunk-MSR2QRUE.js → chunk-L6PJPETJ.js} +2 -2
- package/dist/{chunk-VU6LIWHT.js → chunk-LDVT66YM.js} +2 -2
- package/dist/chunk-LEECKFCJ.js +2 -0
- package/dist/{chunk-H7CG6LOE.js → chunk-LMZ5PRUV.js} +2 -2
- package/dist/{chunk-ZPASRBLF.js → chunk-LQRQN2XA.js} +2 -2
- package/dist/{chunk-HISEUIL2.js → chunk-LXABEJX3.js} +2 -2
- package/dist/{chunk-WHADK6OS.js → chunk-M2O5NY6W.js} +2 -2
- package/dist/{chunk-Y334QQU5.js → chunk-MNV5FSBW.js} +2 -2
- package/dist/{chunk-RYOYJMGF.js → chunk-MPQ4OTBM.js} +2 -2
- package/dist/{chunk-6NC3YSPY.js → chunk-MV3CDXPI.js} +2 -2
- package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
- package/dist/chunk-N2ZSIIGR.js +117 -0
- package/dist/chunk-N5B2NILC.js +5 -0
- package/dist/{chunk-Q6T2CAJL.js → chunk-NJITK2GP.js} +2 -2
- package/dist/{chunk-ENWQWA2R.js → chunk-NOGJXYFO.js} +2 -2
- package/dist/{chunk-V4NG5OMS.js → chunk-NOYBFVJA.js} +106 -106
- package/dist/chunk-NWQXSFFU.js +3 -0
- package/dist/chunk-ODDUPDP7.js +13 -0
- package/dist/{chunk-A77SCPW2.js → chunk-OLIWTZI3.js} +2 -2
- package/dist/{chunk-XFMVKFSF.js → chunk-OLNV6I6U.js} +2 -2
- package/dist/{chunk-QKT4UI2Y.js → chunk-OR2E3AGZ.js} +2 -2
- package/dist/chunk-OSR2GEHQ.js +2 -0
- package/dist/{chunk-5H5WTJSD.js → chunk-OSSESPDX.js} +2 -2
- package/dist/{chunk-KQHJEU6V.js → chunk-OWOOWNJ5.js} +2 -2
- package/dist/{chunk-GRX7JOXQ.js → chunk-P42EIXTA.js} +2 -2
- package/dist/{chunk-AQ2PORIO.js → chunk-PJFGPYTU.js} +2 -2
- package/dist/{chunk-LRI5OMPE.js → chunk-PP7KNN7L.js} +2 -2
- package/dist/{chunk-PLJUQFQN.js → chunk-PU7T5QYQ.js} +2 -2
- package/dist/{chunk-JUN5DOAK.js → chunk-PWWAJSKV.js} +2 -2
- package/dist/{chunk-7IQXARSQ.js → chunk-PZL5T7SU.js} +2 -2
- package/dist/{chunk-UAQ4T73O.js → chunk-QBE3YX64.js} +2 -2
- package/dist/{chunk-3TJY6M3B.js → chunk-QGVTFRY2.js} +2 -2
- package/dist/chunk-QOJONDS7.js +2 -0
- package/dist/chunk-QU5XRYB5.js +4 -0
- package/dist/{chunk-2KVU55CW.js → chunk-QUU5OBVK.js} +2 -2
- package/dist/{chunk-Q5TA4OY4.js → chunk-RBLQNW26.js} +2 -2
- package/dist/chunk-RTQ7NEKG.js +81 -0
- package/dist/{chunk-F24QUEQP.js → chunk-SQXRS7BG.js} +2 -2
- package/dist/chunk-SSK6LDPC.js +2 -0
- package/dist/chunk-SZHGTCPP.js +7 -0
- package/dist/chunk-T4N4P2K5.js +16 -0
- package/dist/chunk-TA3QKLLU.js +2 -0
- package/dist/chunk-TEBQMNVI.js +43 -0
- package/dist/{chunk-NK3JMP22.js → chunk-TPFHAQ2G.js} +2 -2
- package/dist/chunk-TQPCBMWT.js +5 -0
- package/dist/{chunk-HG722PO7.js → chunk-TRNAEQ6P.js} +2 -2
- package/dist/chunk-TY7CRN3Z.js +2 -0
- package/dist/{chunk-7XA3OM44.js → chunk-UHFYCMZO.js} +2 -2
- package/dist/{chunk-ARVO6TTW.js → chunk-UICY4GTQ.js} +2 -2
- package/dist/{chunk-SWK4XPUS.js → chunk-UVGEWT4Y.js} +2 -2
- package/dist/{chunk-GIQ6CSL4.js → chunk-UXW33INU.js} +2 -2
- package/dist/{chunk-RDULNRSJ.js → chunk-VMPRET3I.js} +2 -2
- package/dist/{chunk-I6UTXNHU.js → chunk-VNLGKHS6.js} +2 -2
- package/dist/{chunk-44T4DUAA.js → chunk-VQILFTEH.js} +2 -2
- package/dist/{chunk-N7FP5H5U.js → chunk-VUPHCS7Y.js} +8 -8
- package/dist/{chunk-JAT6C3VX.js → chunk-VVZSBTSU.js} +2 -2
- package/dist/{chunk-FBCVASUG.js → chunk-VZRNID6A.js} +2 -2
- package/dist/{chunk-TUQIPUDS.js → chunk-W5OXRYGE.js} +2 -2
- package/dist/chunk-W6STWDQI.js +57 -0
- package/dist/chunk-W7CXK74K.js +2 -0
- package/dist/chunk-WB3WYIRE.js +4 -0
- package/dist/{chunk-C76O5MDS.js → chunk-WDNVY4E7.js} +2 -2
- package/dist/{chunk-TAYD3AE7.js → chunk-WIWY3CRX.js} +2 -2
- package/dist/chunk-WK46TNUM.js +3 -0
- package/dist/chunk-WNTFFKAX.js +12 -0
- package/dist/{chunk-JFQBRL3J.js → chunk-WOIKCX6A.js} +2 -2
- package/dist/{chunk-PIFTZEEM.js → chunk-WUN6KBHV.js} +2 -2
- package/dist/chunk-WYCTJDVR.js +2 -0
- package/dist/chunk-WYPL7GF7.js +2 -0
- package/dist/{chunk-XN22RGSR.js → chunk-XBGWL66K.js} +2 -2
- package/dist/{chunk-R6M456QG.js → chunk-XDQMU3BT.js} +2 -2
- package/dist/{chunk-XJX6LGHL.js → chunk-XFA4SSO3.js} +2 -2
- package/dist/{chunk-2YC7YNKT.js → chunk-XGZEP6GR.js} +2 -2
- package/dist/chunk-XPDPNWTQ.js +368 -0
- package/dist/chunk-XRYABF57.js +8 -0
- package/dist/{chunk-YIHNPKWD.js → chunk-YBGKCQIS.js} +2 -2
- package/dist/{chunk-2XCGSDIT.js → chunk-YEN6CYC7.js} +2 -2
- package/dist/{chunk-VMWUV6WB.js → chunk-YF5IB2LF.js} +2 -2
- package/dist/{chunk-TNG2FYS5.js → chunk-YI2AWIHC.js} +2 -2
- package/dist/{chunk-EELG7D3Q.js → chunk-YPWBKGFU.js} +2 -2
- package/dist/{chunk-GQIDEID3.js → chunk-YPWHBBIS.js} +2 -2
- package/dist/{chunk-TKDNDQA7.js → chunk-YSH6U3L4.js} +2 -2
- package/dist/{chunk-BUTEIZKP.js → chunk-YU5DZUZI.js} +2 -2
- package/dist/chunk-YWO5DDRC.js +16 -0
- package/dist/{chunk-6HRZQLOI.js → chunk-Z4CDXYNQ.js} +2 -2
- package/dist/{chunk-XSWYJCAK.js → chunk-ZF5KHH7C.js} +2 -2
- package/dist/chunk-ZOHS7AQV.js +21 -0
- package/dist/{chunk-7U2YQSDE.js → chunk-ZTI4SBFV.js} +2 -2
- package/dist/cli-main.js +2 -2
- package/dist/code-MI6F2TTU.js +2 -0
- package/dist/code-result-json-FXALY4HE.js +2 -0
- package/dist/{command-descriptors-ORNTVNYV.js → command-descriptors-P34VABY5.js} +136 -135
- package/dist/dataflow-4KEMJPC6.js +2 -0
- package/dist/dependence-slice-R7FPWD5M.js +2 -0
- package/dist/deps-7EMQUYUT.js +2 -0
- package/dist/direct-navigation-6YO234F2.js +3 -0
- package/dist/entry-map-KOOLR26E.js +2 -0
- package/dist/files-OPIPJIGZ.js +2 -0
- package/dist/hierarchy-QPD2CAER.js +2 -0
- package/dist/imports-M6HUXRXC.js +2 -0
- package/dist/index.js +1 -1
- package/dist/members-I5MEFOCT.js +2 -0
- package/dist/methods-5JYGGHXA.js +2 -0
- package/dist/output-continuation-command-UPQAAKBP.js +3 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-UKKQ5PLS.js +3 -0
- package/dist/queries/affected.js +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.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- 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.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.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- 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.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.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.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- 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.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.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.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.js +1 -1
- package/dist/query-service-server.js +3 -3
- package/dist/refs-PSU4JZZW.js +2 -0
- package/dist/refs-pagination-JG6CJMRC.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-HYRATV64.js +2 -0
- package/dist/surface-VTGDYWF5.js +2 -0
- package/dist/symbol-resolution-WD5EU5JE.js +2 -0
- package/dist/system-LRQNFOR2.js +2 -0
- package/dist/trace-F4B6OLL4.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-VRPZY72V.js +2 -0
- package/dist/watch-server.js +3 -3
- package/package.json +1 -1
- package/dist/by-kind-4IYG2SKW.js +0 -2
- package/dist/call-graph-WQNXMNNN.js +0 -2
- package/dist/chunk-2BTJALUS.js +0 -454
- package/dist/chunk-3QXC54FQ.js +0 -3
- package/dist/chunk-42W3LFUK.js +0 -13
- package/dist/chunk-4GAQ6FI4.js +0 -43
- 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-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-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-D35XIZGN.js +0 -2
- package/dist/chunk-DKM723YF.js +0 -79
- 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-HCVJR2V4.js +0 -3
- package/dist/chunk-HXOU4XNH.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-JT6XX7QY.js +0 -8
- package/dist/chunk-MHIEP7EG.js +0 -4
- 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-PLYUVM4F.js +0 -2
- package/dist/chunk-Q7GBK5T7.js +0 -81
- 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-TUSPIVZ3.js +0 -4
- package/dist/chunk-UT7TADJX.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-Z2AWCTN6.js +0 -2
- package/dist/chunk-ZOXKSQQB.js +0 -2
- package/dist/code-EQJFDT6I.js +0 -2
- package/dist/code-result-json-7UWIWBOO.js +0 -2
- 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/project-reindex-HYO4WD7Z.js +0 -3
- package/dist/refs-ARMA6XUJ.js +0 -2
- package/dist/refs-pagination-VUGIWN6U.js +0 -2
- package/dist/slice-YOB5YFAM.js +0 -2
- package/dist/surface-VY5EFWTW.js +0 -2
- package/dist/symbol-resolution-DGQN4XIV.js +0 -2
- package/dist/system-2KQ3QD2P.js +0 -2
- package/dist/trace-HTIPTXAE.js +0 -2
- package/dist/value-flow-5FV3VQI7.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as M,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-
|
|
1
|
+
import{B as M,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-N2ZSIIGR.js";import{b as B}from"./chunk-ZOHS7AQV.js";import{c as O}from"./chunk-JWTGMPIT.js";var T=O("symbol-resolution",{clearGroups:[]});function he(e,n){return G(e,n).match}function G(e,n){return T.get(e,n,()=>{let t=W(e,n.trim()).filter(i=>!e.isIgnored(i.relative_path));if(t.length>0)return L(e,t);let o=P(e,n);if(o&&!e.isIgnored(o.relative_path))return L(e,[o]);let r=H(e,n);if(r.length>0)return L(e,r);let s=U(e,n);return s.length>0?L(e,s):J(e,n)})}function H(e,n){let t=n.trim().replace(/\(\)$/u,""),o=t.lastIndexOf(":");if(o<=0||o===t.length-1||t.startsWith("local:"))return[];let r=t.slice(o+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(r))return[];let s=[`/${r}().`,`/${r}.`,`/${r}#`,`#${r}().`,`#${r}.`,`/${r}/`],i=`gs.display_name = ? OR ${s.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[r,...s],l=f(e,{where:i,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),u=l.length>0?[]:S(e,{where:i,params:a,orderBy:"d.relative_path, start_line",limit:200}),p=R(l,u).filter(m=>!e.isIgnored(m.relative_path)).filter(m=>_(m.symbol).replace(/\(\)$/u,"")===t);return[...new Map(p.map(m=>[`${m.symbol}\0${m.relative_path}`,m])).values()]}function U(e,n){let t=Q(n),o=E(t);if(!o)return[];let r=`%${o.path}%`,s=o.leaf;return X(e,r,s,t)}function X(e,n,t,o){let r=R([],[...Y(e,n,t),...Z(e,n,t)]).filter(s=>!e.isIgnored(s.relative_path)).filter(s=>C(s,o)>1);return r.sort((s,i)=>C(i,o)-C(s,o)||s.end_line-s.start_line-(i.end_line-i.start_line)||s.start_line-i.start_line||s.symbol.localeCompare(i.symbol)),r}function Y(e,n,t){return f(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function Z(e,n,t){return S(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function J(e,n){let t=Q(n),o=ae(n),r=oe(e,o),s=se(r,n,t).filter(a=>!e.isIgnored(a.relative_path));if(s.length>0)return L(e,s);let i=[];for(let a of r){if(e.isIgnored(a.relative_path))continue;let l=re(a,n,t,o);l<=0||i.push({row:a,score:l})}return i.sort((a,l)=>l.score-a.score||a.row.end_line-a.row.start_line-(l.row.end_line-l.row.start_line)||a.row.relative_path.localeCompare(l.row.relative_path)||a.row.symbol.localeCompare(l.row.symbol)),L(e,i.map(a=>a.row))}function L(e,n){let t=n.map(r=>M(e,r)),o=t[0]??null;return{match:o,candidates:o?V(t,o):[],total:t.length}}function V(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let r of e){let s=`${r.symbolId}:${r.relativePath}:${r.startLine}`;if(!t.has(s)&&(t.add(s),o.push({symbol:r.symbol,shortName:_(r.symbol),relativePath:r.relativePath,startLine:r.startLine}),o.length>=5))break}return o}function P(e,n){let t=n.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!t)return;let[,o,r,s]=t,i=B(e,o,{allowMultiple:!1,requirePathMatch:!0})[0]?.relativePath;if(!i)return;let a=Math.max(0,parseInt(r,10)-1),l=s?Math.max(a,parseInt(s,10)-1):a;return ee(e,i,a,l)??te(e,i,a,l)}function ee(e,n,t,o){return f(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[n,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function te(e,n,t,o){return S(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[n,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function be(e,n){let t=W(e,n).find(o=>!e.isIgnored(o.relative_path));return t?M(e,t):null}function W(e,n){let t=f(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:S(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return R(t,o)}function Se(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=ne(e,n.symbolId)[0];return t?M(e,t):null}function ne(e,n){let t=f(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=S(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return R(t,o)}function oe(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(a=>{let l=`%${a}%`;return[l,l,l]}),r=t.join(`
|
|
2
2
|
AND `),s=f(e,{where:r,params:o,limit:200}),i=S(e,{where:r,params:o,limit:200});return R(s,i)}function re(e,n,t,o){let r=n.trim(),s=t,i=s.replace(/\(\)$/,""),a=n.toLowerCase(),l=t.toLowerCase(),u=l.replace(/\(\)$/,""),p=e.symbol,m=_(e.symbol),y=w(e.symbol),g=e.display_name??"",$=e.symbol.toLowerCase(),d=m.toLowerCase(),h=y.toLowerCase(),x=g.toLowerCase(),b=e.relative_path.toLowerCase(),j=/[/:.]/.test(t),I=E(t),v=I?.leaf.toLowerCase(),c=0;return(p===r||p===s)&&(c+=1150),(m===r||m===s)&&(c+=1100),g===i&&(c+=1180),y===i&&(c+=1160),(`${y}()`===r||`${y}()`===s)&&(c+=955),($===a||$===l)&&(c+=1e3),(d===a||d===l)&&(c+=950),(b===a||b===l)&&(c+=925),(b.endsWith(`/${l}`)||b.endsWith(`/${a}`))&&(c+=875),x===u&&(c+=850),h===u&&(c+=825),(`${h}()`===a||`${h}()`===l)&&(c+=820),(d.endsWith(`:${l}`)||d.endsWith(`:${u}`)||d.endsWith(`:${u}()`))&&(c+=800),$.includes(l)&&(c+=120),d.includes(l)&&(c+=140),b.includes(l)&&(c+=140),x.includes(l)&&(c+=110),o.every(q=>{let D=q.toLowerCase();return $.includes(D)||d.includes(D)||b.includes(D)||x.includes(D)})&&(c+=100+o.length*15),I&&b.includes(I.path.toLowerCase())&&(c+=360,v&&(h===v||`${h}()`===v||`${h}()`==`${v}()`)&&(c+=700),k(e.symbol)&&(c+=180)),A(e.symbol)&&h===u&&(c+=60),!j&&z(e.symbol)&&(c-=160),c-=Math.min(50,Math.max(0,e.end_line-e.start_line)),c}function E(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function Q(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function ae(e){let n=Q(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function se(e,n,t){let o=n.trim(),r=e.filter(a=>{let l=_(a.symbol),u=w(a.symbol),p=(a.display_name??"").trim();return a.symbol===o||l===o||l===t||u===o||u===t||`${u}()`===o||p===o||p===t||`${p}()`===o||C(a,t)>1||a.relative_path===o});if(r.length===0)return[];let s=t.replace(/\(\)$/u,""),i=r.filter(a=>w(a.symbol)===s);if(i.length>0){i.sort((l,u)=>F(l,u,t));let a=i.filter(l=>A(l.symbol));return a.length>0?a:i}return r.sort((a,l)=>F(a,l,t)),r}function F(e,n,t){return C(n,t)-C(e,t)||e.end_line-e.start_line-(n.end_line-n.start_line)||e.relative_path.localeCompare(n.relative_path)||e.symbol.localeCompare(n.symbol)}function C(e,n){let t=E(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),r=w(e.symbol).toLowerCase(),s=t.path.toLowerCase(),i=t.leaf.toLowerCase();return o.includes(s)?r!==i?1:k(e.symbol)?N(e.symbol)===null?5:4:N(e.symbol)===null?3:2:0}function ge(e,n,t=5){let o=K(n);if(!o)return[];let r=f(e,{where:"1 = 1",orderBy:"d.relative_path, der.start_line",limit:5e3}),s=new Map;for(let i of r){if(e.isIgnored(i.relative_path))continue;let a=_(i.symbol),l=w(i.symbol),u=i.display_name??l,p=[a,l,u].filter(g=>g.trim().length>0),m=Math.min(...p.map(g=>ie(K(g),o))),y=s.get(a);(!y||m<y.distance)&&s.set(a,{shortName:a,distance:m})}return[...s.values()].sort((i,a)=>i.distance-a.distance||i.shortName.localeCompare(a.shortName)).slice(0,t).map(i=>i.shortName)}function K(e){return Q(e).toLowerCase().replace(/[^a-z0-9_]+/g,"")}function ie(e,n){if(e===n)return 0;if(e.length===0)return n.length;if(n.length===0)return e.length;let t=Array.from({length:n.length+1},(o,r)=>r);for(let o=0;o<e.length;o++){let r=[o+1];for(let s=0;s<n.length;s++){let i=e[o]===n[s]?0:1;r[s+1]=Math.min(r[s]+1,t[s+1]+1,t[s]+i)}t=r}return t[n.length]}export{he as a,G as b,be as c,Se as d,ge as e};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-OSSESPDX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as R,b as v}from"./chunk-
|
|
1
|
+
import{a as R,b as v}from"./chunk-GAS2LJMP.js";import{a as b,b as L}from"./chunk-2OOY75BW.js";import{d}from"./chunk-JFMEXGFE.js";import{spawn as B}from"child_process";import{platform as P}from"os";var u=class extends Error{},h=class extends Error{},m=class extends Error{constructor(t,r,i){super(`rust-analyzer LSP request ${r} failed: ${i}`);this.code=t}code},k=3e4,M=16*1024,O=64*1024*1024,z=64*1024,A=256*1024*1024,p=Buffer.from(`\r
|
|
2
2
|
\r
|
|
3
3
|
`,"ascii"),x=class{constructor(e,t={}){this.transport=e;this.requestTimeoutMs=t.requestTimeoutMs??k,this.configuration=t.configuration??{};let r=D(t.maxHeaderBytes,t.maxMessageBytes);this.maxHeaderBytes=r.maxHeaderBytes,this.maxMessageBytes=r.maxMessageBytes,this.monotonicNow=t.monotonicNow??d,this.headerBuffer=Buffer.allocUnsafe(this.maxHeaderBytes+p.length),this.transport.onData(i=>this.handleData(i)),this.transport.onClose((i,s)=>this.failTransport(new Error(H(i,s)),!1)),this.transport.onError(i=>this.failTransport(i,!0))}transport;nextId=1;pending=new Map;diagnosedUris=new Set;diagnosticWaiters=new Map;readinessWaiters=new Set;requestTimeoutMs;configuration;maxHeaderBytes;maxMessageBytes;monotonicNow;headerBuffer;headerLength=0;bodyBuffer=null;bodyLength=0;transportFailure=null;transportKilled=!1;transportKillPromise=null;currentServerStatusGeneration=0;latestServerStatus=null;shutdownStarted=!1;async initialize(e,t={}){let r=e.capabilities??{},i=r.experimental&&typeof r.experimental=="object"&&!Array.isArray(r.experimental)?r.experimental:{},s=await this.request("initialize",{...e,capabilities:{...r,experimental:{...i,serverStatusNotification:!0}}},t);return this.notify("initialized",{}),s}async references(e,t={}){let r=await this.request("textDocument/references",e,t);return Array.isArray(r)?r:[]}async definition(e,t={}){let r=await this.request("textDocument/definition",e,t);return W(r)}async prepareCallHierarchy(e,t={}){let r=await this.request("textDocument/prepareCallHierarchy",e,t);return Array.isArray(r)?r:[]}async outgoingCalls(e,t={}){let r=await this.request("callHierarchy/outgoingCalls",{item:e},t);return Array.isArray(r)?r:[]}async hover(e,t={}){let r=await this.request("textDocument/hover",e,t);return r&&typeof r=="object"?r:null}async readinessBarrier(e={}){try{await this.request("scip-query/readinessBarrier",null,e)}catch(t){if(t instanceof m&&t.code===-32601)return;throw t}}serverStatusGeneration(){return this.currentServerStatusGeneration}serverStatusSnapshot(){let e=this.latestServerStatus;return e?{generation:e.generation,status:{...e.status}}:null}waitForQuiescence(e,t){if(this.transportFailure)return Promise.reject(this.transportFailure);let r=this.latestServerStatus;if(r&&r.generation>e){if(r.status.health==="error")return Promise.reject(E());if(r.status.quiescent)return Promise.resolve(r.status)}return new Promise((i,s)=>{let a={afterGeneration:e,resolve:i,reject:s,timeout:setTimeout(()=>{this.readinessWaiters.delete(a),s(new Error(`rust-analyzer readiness timed out after ${t}ms`))},t)};this.readinessWaiters.add(a)})}didOpenTextDocument(e){this.notify("textDocument/didOpen",{textDocument:e})}waitForDiagnostics(e,t){return this.transportFailure?Promise.resolve(!1):this.diagnosedUris.has(e)?Promise.resolve(!0):new Promise(r=>{let i=l=>{clearTimeout(s),r(l)},s=setTimeout(()=>{let l=this.diagnosticWaiters.get(e)?.filter(o=>o!==i);l&&l.length>0?this.diagnosticWaiters.set(e,l):this.diagnosticWaiters.delete(e),r(!1)},t),a=this.diagnosticWaiters.get(e)??[];a.push(i),this.diagnosticWaiters.set(e,a)})}async shutdown(e={}){if(!this.shutdownStarted){this.shutdownStarted=!0;try{await this.request("shutdown",null,e),this.notify("exit",null)}catch(t){throw this.notify("exit",null),this.killTransportOnce(),t}}}async shutdownAndReap(e={}){let t;try{await this.shutdown(e)}catch(r){t=r}try{await this.killTransportOnce()}catch(r){throw new Error(`rust-analyzer process-tree cleanup failed: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(t)throw t}request(e,t,r={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=y(r.timeoutMs??this.requestTimeoutMs,r.deadlineMs,this.monotonicNow),s=this.nextId++,a={jsonrpc:"2.0",id:s,method:e,params:t};return new Promise((l,o)=>{let c=setTimeout(()=>{let w=i.deadlineLimited?new u(`rust-analyzer readiness deadline expired during LSP request ${e}`):new Error(`rust-analyzer LSP request ${e} timed out after ${i.timeoutMs}ms`);this.cancelAndFailTimedOutRequest(s,w)},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:r.deadlineMs,resolve:w=>l(w),reject:o,timeout:c}),this.transport.write(f(a))})}notify(e,t){this.transportFailure||this.transport.write(f({jsonrpc:"2.0",method:e,params:t}))}handleData(e){if(this.transportFailure||e.length===0)return;let t=0;for(;t<e.length&&!this.transportFailure;){if(this.bodyBuffer){let a=Math.min(e.length-t,this.bodyBuffer.length-this.bodyLength);if(e.copy(this.bodyBuffer,this.bodyLength,t,t+a),t+=a,this.bodyLength+=a,this.bodyLength===this.bodyBuffer.length){let l=this.bodyBuffer.toString("utf8");this.bodyBuffer=null,this.bodyLength=0;let o;try{o=$(l)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(o)}catch{this.failTransport(new Error("rust-analyzer LSP message handling failed"),!0)}}continue}if(this.headerLength===this.headerBuffer.length){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}if(this.headerBuffer[this.headerLength++]=e[t++],!this.headerDelimiterComplete())continue;let r=this.headerLength-p.length;if(r>this.maxHeaderBytes){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}let i=this.headerBuffer.subarray(0,r).toString("ascii");this.headerLength=0;let s;try{s=C(i,this.maxMessageBytes)}catch(a){this.failProtocol(a instanceof Error?a.message:String(a));return}this.bodyBuffer=Buffer.allocUnsafe(s),this.bodyLength=0,s===0&&(this.bodyBuffer=null,this.failProtocol("rust-analyzer LSP response body was not a valid JSON object"))}}headerDelimiterComplete(){if(this.headerLength<p.length)return!1;let e=this.headerLength-p.length;return this.headerBuffer.subarray(e,this.headerLength).equals(p)}failProtocol(e){this.failTransport(new h(e),!0)}failTransport(e,t){this.transportFailure||(this.transportFailure=e,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0,t&&this.killTransportOnce().catch(()=>{}),this.rejectPending(e),this.resolveDiagnosticWaiters(!1))}killTransportOnce(){return this.transportKilled?this.transportKillPromise??Promise.resolve():(this.transportKilled=!0,this.transportKillPromise=Promise.resolve(this.transport.kill()),this.transportKillPromise)}async cancelAndFailTimedOutRequest(e,t){let r=this.pending.get(e);if(!r)return;this.pending.delete(e);try{this.transport.write(f({jsonrpc:"2.0",method:"$/cancelRequest",params:{id:e}}))}catch{}this.transportFailure||(this.transportFailure=t,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0);let i=t;try{await this.killTransportOnce()}catch(s){i=new Error(`${t.message}; rust-analyzer cleanup failed: ${s instanceof Error?s.message:String(s)}`,{cause:s})}r.reject(i),this.rejectPending(i),this.resolveDiagnosticWaiters(!1)}dispatchMessage(e){if(this.recordDiagnosticNotification(e),this.recordServerStatusNotification(e),e.id!==void 0&&e.id!==null&&e.method){this.respondToServerRequest(e);return}if(e.id===void 0||e.id===null)return;let t=this.pending.get(e.id);if(t){if(clearTimeout(t.timeout),this.pending.delete(e.id),e.error){t.reject(new m(e.error.code,t.method,e.error.message));return}if(t.deadlineMs!==void 0&&this.monotonicNow()>=t.deadlineMs){t.reject(new u(`rust-analyzer readiness deadline expired during LSP request ${t.method}`));return}t.resolve(e.result)}}recordDiagnosticNotification(e){if(e.method!=="textDocument/publishDiagnostics")return;let t=e.params,r=t&&typeof t=="object"&&typeof t.uri=="string"?t.uri:null;if(!r)return;this.diagnosedUris.add(r);let i=this.diagnosticWaiters.get(r)??[];this.diagnosticWaiters.delete(r),i.forEach(s=>s(!0))}recordServerStatusNotification(e){if(e.method!=="experimental/serverStatus"||e.id!==void 0||!j(e.params))return;let t=e.params,r={health:t.health,quiescent:t.quiescent,...typeof t.message=="string"?{message:t.message}:{}},i=++this.currentServerStatusGeneration;if(this.latestServerStatus={generation:i,status:r},r.health==="error"){this.rejectReadinessWaiters(E());return}if(r.quiescent)for(let s of this.readinessWaiters)i<=s.afterGeneration||(clearTimeout(s.timeout),this.readinessWaiters.delete(s),s.resolve(r))}respondToServerRequest(e){if(e.id===void 0||e.id===null||!e.method)return;let t=e.method==="workspace/configuration"?this.workspaceConfiguration(e.params):null;this.transport.write(f({jsonrpc:"2.0",id:e.id,result:t}))}workspaceConfiguration(e){return(e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]).map(r=>typeof r.section=="string"?F(this.configuration,r.section):this.configuration)}rejectPending(e){for(let[t,r]of this.pending)clearTimeout(r.timeout),r.reject(e),this.pending.delete(t);this.rejectReadinessWaiters(e)}resolveDiagnosticWaiters(e){for(let t of this.diagnosticWaiters.values())t.forEach(r=>r(e));this.diagnosticWaiters.clear()}rejectReadinessWaiters(e){for(let t of this.readinessWaiters)clearTimeout(t.timeout),t.reject(e),this.readinessWaiters.delete(t)}};function D(n=M,e=O){if(!Number.isSafeInteger(n)||n<=0)throw new TypeError("maxHeaderBytes must be a positive safe integer.");if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxMessageBytes must be a positive safe integer.");if(n>z)throw new RangeError(`maxHeaderBytes cannot exceed ${z} bytes for rust-analyzer LSP.`);if(n+p.length+e>A)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${A} bytes.`);return{maxHeaderBytes:n,maxMessageBytes:e}}function C(n,e){let t=[];for(let s of n.split(`\r
|
|
4
4
|
`)){let a=s.indexOf(":");a<0||s.slice(0,a).trim().toLowerCase()!=="content-length"||t.push(s.slice(a+1).trim())}if(t.length===0)throw new h("rust-analyzer LSP response missing Content-Length header");if(t.length>1){let s=new Set(t).size>1?"rust-analyzer LSP response has conflicting Content-Length headers":"rust-analyzer LSP response has duplicate Content-Length headers";throw new h(s)}let r=t[0];if(!/^\d+$/.test(r))throw new h("rust-analyzer LSP Content-Length must be a non-negative safe integer");let i=Number(r);if(!Number.isSafeInteger(i))throw new h("rust-analyzer LSP Content-Length must be a non-negative safe integer");if(i>e)throw new h(`rust-analyzer LSP Content-Length exceeds ${e} byte message limit`);return i}function y(n,e,t=d){if(e===void 0)return{timeoutMs:n,deadlineLimited:!1};let r=e-t();if(r<=0)throw new u("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(n,r),deadlineLimited:r<=n}}function j(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return(e.health==="ok"||e.health==="warning"||e.health==="error")&&typeof e.quiescent=="boolean"&&(e.message===void 0||e.message===null||typeof e.message=="string")}function E(){return new u("rust-analyzer reported error health before reaching readiness")}function F(n,e){let t=e.startsWith("rust-analyzer.")?e.slice(14):e;if(t===""||t==="rust-analyzer")return n;let r=n;for(let i of t.split(".")){if(!r||typeof r!="object")return null;r=r[i]}return r??null}function W(n){return n?(Array.isArray(n)?n:[n]).flatMap(t=>N(t)?[t]:_(t)?[{uri:t.targetUri,range:t.targetSelectionRange}]:[]):[]}function N(n){return!!(n&&typeof n=="object"&&typeof n.uri=="string")}function _(n){return!!(n&&typeof n=="object"&&typeof n.targetUri=="string")}function Z(n,e,t=process.env,r){let i=B(n,[],{cwd:e,env:t,detached:P()!=="win32",stdio:["pipe","pipe","pipe"]}),s=i.pid===void 0?null:b(i.pid,P()!=="win32"),a=s?R(r,s):null,l=null;return i.on("close",()=>v(a)),{write(o){i.stdin.write(o)},onData(o){i.stdout.on("data",o)},onClose(o){i.on("close",o)},onError(o){i.on("error",o)},kill(){if(!s){i.kill();return}return l??=L(s,{gracefulMs:1e3,forceMs:1e3}).then(o=>{if(!o.reaped)throw new Error(o.detail??`rust-analyzer process tree ${s.rootPid} was not reaped.`);v(a)}),l}}}function f(n){let e=JSON.stringify(n);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
|
|
5
5
|
\r
|
|
6
6
|
${e}`}function $(n){let e=JSON.parse(n);if(!e||typeof e!="object")throw new Error("rust-analyzer LSP response was not a JSON object");return e}function H(n,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:n===null?"":` with code ${n}`}`}async function q(n,e,t,r=d){let i=t-r();if(i<=0)throw new u("rust-analyzer readiness deadline expired before quiescence");try{let s=await n.waitForQuiescence(e,i);if(g(t,r,"during quiescence"),s.health==="error")throw new u("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new u("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof u?s:new u(s instanceof Error?s.message:String(s))}}async function te(n,e,t,r,i,s=d,a=S){let l=await q(n,e,r,s);if(t===0)return l;let o=n.serverStatusSnapshot();if(!o)throw new u("rust-analyzer status is unavailable after initial document open");return await J(n,o,t,r,i,s,a)??l}async function J(n,e,t,r,i,s=d,a=S){if(t===0)return null;if(!e)throw new u("rust-analyzer status is unavailable before document open");T(e.status,"before document open");try{await n.readinessBarrier({deadlineMs:r}),g(r,s,"during post-open synchronization")}catch(c){throw c instanceof u?c:new u(c instanceof Error?c.message:String(c))}let l=n.serverStatusSnapshot();if(!l||l.generation<e.generation)throw new u("rust-analyzer status is unavailable after document open");let o;return l.generation===e.generation?(T(l.status,"after document open"),o=l.status):o=await q(n,e.generation,r,s),await U(i,r,s,a),o}async function re(n,e,t,r=d){let i=y(e,t,r);await n(i.timeoutMs),g(t,r,"during diagnostics")}async function U(n,e,t=d,r=S){if(n<=0)return;if(y(n,e,t).deadlineLimited)throw new u("rust-analyzer readiness deadline cannot accommodate delay");await r(n),g(e,t,"during delay")}async function ne(n,e){try{return await n()}catch(t){throw t instanceof u&&await e(),t}}function se(n){return n instanceof u?{ok:!1,error:n.message}:null}function g(n,e,t){if(n-e()<=0)throw new u(`rust-analyzer readiness deadline expired ${t}`)}function T(n,e){if(n.health==="error")throw new u(`rust-analyzer reported error health ${e}`);if(!n.quiescent)throw new u(`rust-analyzer did not report quiescence ${e}`)}function S(n){return new Promise(e=>setTimeout(e,n))}export{u as a,x as b,Z as c,te as d,J as e,re as f,U as g,ne as h,se as i,S as j};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-OWOOWNJ5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-7YQOCABQ.js";import{c as R,d as E}from"./chunk-SB25YMEQ.js";import{h as S}from"./chunk-AK3PYTIK.js";import{randomUUID as q}from"crypto";import{getHeapStatistics as V}from"v8";import{resolve as H}from"path";import{createRequire as L}from"module";import{dirname as I,isAbsolute as j,relative as P,resolve as m,sep as b}from"path";var u=L(import.meta.url),_=1,D="0.4.0";function z(){try{let t=M();if(!t.available)return t;let{packageRoot:e}=t,r=u.resolve("typescript",{paths:[e]}),i=u(r),{FileIndexer:n}=u(m(e,"dist/src/FileIndexer.js")),{Input:s}=u(m(e,"dist/src/Input.js")),{Packages:o}=u(m(e,"dist/src/Packages.js")),c=u(m(e,"dist/src/scip.js"));if(!n||!s||!o||!c.scip?.Document||!c.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let a={packageVersion:t.packageVersion,typescript:i,Document:c.scip.Document,Index:c.scip.Index,FileIndexer:n,Input:s,Packages:o};return{available:!0,runtime:a,producerIdentity:x(a)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function J(){let t=M();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function M(){try{let t=u.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(S(t,"scip-typescript package manifest"));if(e.version!==D)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${D}`};let r=I(t),i=u.resolve("typescript/package.json",{paths:[r]}),n=JSON.parse(S(i,"TypeScript package manifest"));return typeof n.version!="string"||!n.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:n.version,producerIdentity:C(e.version,n.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function A(t){let e=t.runtime===void 0?z():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:x(t.runtime)};return e.available?{available:!0,emitter:new T(t,e.runtime)}:e}var T=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=m(e.workspaceRoot),this.tsconfigPath=m(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??O(this.workspaceRoot,I(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=x(r);let i=v(r.typescript,this.tsconfigPath);this.config=i,this.host=new w(r.typescript,i.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now();this.initializeProgram();let r=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(f(i.fileName))&&r.push(this.emitSourceFile(i));return this.result(r,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);if(this.fragments.clear(),i.length===0&&n.length===0)return this.validateAffectedPaths(s),this.result(this.emitAffectedFiles(s),r);let o=v(this.runtime.typescript,this.tsconfigPath);this.config=o,this.includedFiles=new Set(o.fileNames.map(f));let c=this.program,a=new Map;for(let d of[...i,...n]){let p=y(this.workspaceRoot,d),l=c.getSourceFile(p);l&&(a.set(d,l),this.stats.symbolEntriesPruned+=F(this.symbolTable,l),this.stats.symbolEntriesPruned+=F(this.constructorTable,l)),this.host.invalidate(p)}this.program=this.runtime.typescript.createProgram(o.fileNames,o.options,this.host.compilerHost,c),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1,this.validateIncrementalPaths(i,n,s),this.stats.documentsRemoved+=n.length;for(let[d,p]of a)this.program.getSourceFile(y(this.workspaceRoot,d))===p?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;return this.result(this.emitAffectedFiles(s),r)}fragment(e){return this.fragments.get(g(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=performance.now();this.initializeProgram();let i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);return this.fragments.clear(),this.validateIncrementalPaths(i,n,s,!0),this.stats.documentsRemoved+=n.length,this.result(this.emitAffectedFiles(s),r)}initializeProgram(){let e=this.config??v(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(e.fileNames.map(f)),this.program=this.runtime.typescript.createProgram(e.fileNames,e.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1}validateIncrementalPaths(e,r,i,n=!1){if(!n&&e.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires a modified or removed file");if(i.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires an affected or removed file");for(let s of e){let o=y(this.workspaceRoot,s);if(!this.program?.getSourceFile(o))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${s}`)}for(let s of r){let o=y(this.workspaceRoot,s);if(this.program?.getSourceFile(o))throw new Error(`removed TypeScript source is still present in the configured project: ${s}`)}this.validateAffectedPaths(i)}validateAffectedPaths(e){for(let r of e){let i=y(this.workspaceRoot,r);if(!this.includedFiles.has(f(i)))throw new Error(`affected TypeScript file is outside the configured project: ${r}`)}}emitAffectedFiles(e){return e.map(r=>{let i=this.program.getSourceFile(y(this.workspaceRoot,r));if(!i)throw new Error(`affected TypeScript source is unavailable: ${r}`);return this.emitSourceFile(i)})}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=g(P(this.workspaceRoot,e.fileName)),i=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),i,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,i.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:i.symbols.length,referenceFragments:[]};let s=i.serializeBinary();return this.fragments.set(r,s),{relativePath:r,bytes:s,occurrences:i.occurrences.length,symbols:i.symbols.length,referenceFragments:U(r,i)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function U(t,e){let r=new Map;for(let i of e.occurrences){if(!i.symbol||(i.symbol_roles&1)!==0||i.range.length<3)continue;let n=i.range[0],s=i.range[1];if(!Number.isInteger(n)||!Number.isInteger(s))continue;let o={targetSymbol:i.symbol,location:{file:t,line:n,column:s}};r.set(`${i.symbol}\0${n}\0${s}`,o)}return[...r.values()].sort((i,n)=>i.targetSymbol.localeCompare(n.targetSymbol)||i.location.line-n.location.line||i.location.column-n.location.column)}var w=class{compilerHost;sourceFiles=new Map;constructor(e,r,i){let n=e.createCompilerHost(r),s=n.getSourceFile.bind(n);this.compilerHost={...n,getCurrentDirectory:()=>i,getSourceFile:(o,c,a,d)=>{let p=f(o);if(this.sourceFiles.has(p))return this.sourceFiles.get(p);let l=s(o,c,a,d);return this.sourceFiles.set(p,l),l}}}invalidate(e){this.sourceFiles.delete(f(e))}};function v(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let i=t.parseJsonConfigFileContent(r.config,t.sys,I(e)),n=i.errors.filter(s=>s.code!==18003);if(n.length>0)throw new Error(t.formatDiagnostics(n,t.createCompilerHost({})));return i}function x(t){return C(t.packageVersion,t.typescript.version)}function C(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${_}`}function O(t,e){return g(P(t,e))||"."}function y(t,e){if(j(e))throw new Error(`expected a project-relative path: ${e}`);let r=m(t,e),i=t.endsWith(b)?t:`${t}${b}`;if(r!==t&&!r.startsWith(i))throw new Error(`path escapes the project root: ${e}`);return r}function h(t){return[...new Set(t.map(g))].sort()}function g(t){return t.split(b).join("/").replace(/^\.\//,"")}function f(t){return m(t)}function F(t,e){let r=0;for(let i of t.keys())if($(i)){try{if(i.getSourceFile()!==e)continue}catch{continue}t.delete(i),r+=1}return r}function $(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}var N=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;maxActiveSessions;softMemoryLimitBytes;memoryUsage;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;sessionsEvicted=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){if(this.projectRoot=H(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??A,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??E,e.maxActiveSessions!==void 0&&(!Number.isInteger(e.maxActiveSessions)||e.maxActiveSessions<1))throw new Error("TypeScript index maxActiveSessions must be a positive integer.");if(this.maxActiveSessions=e.maxActiveSessions??8,e.softMemoryLimitMb!==void 0&&(!Number.isInteger(e.softMemoryLimitMb)||e.softMemoryLimitMb<1))throw new Error("TypeScript index softMemoryLimitMb must be a positive integer.");this.softMemoryLimitBytes=e.softMemoryLimitMb===void 0?null:e.softMemoryLimitMb*1024*1024,this.memoryUsage=e.memoryUsage??(()=>({heapUsedBytes:process.memoryUsage().heapUsed,heapLimitBytes:V().heap_size_limit}))}handle(e,r){let i=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let n=this.emitterFor(r);if(n.emitter.producerIdentity!==r.producerIdentity)throw new Error("TypeScript index producer identity changed.");let s=n.emitter.snapshotStats(),o=n.emitter.advance({modifiedFiles:r.modifiedFiles,removedFiles:r.removedFiles,affectedFiles:r.affectedFiles}),c=this.monotonicNow()-i;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=c,this.lastError=null,this.unavailable=!1,{producerIdentity:o.producerIdentity,cold:o.stats.initializations>s.initializations,durationMs:c,fragments:o.fragments.map(a=>({relativePath:a.relativePath,bytesBase64:a.bytes===null?null:Buffer.from(a.bytes).toString("base64"),occurrences:a.occurrences,symbols:a.symbols,referenceFragments:a.referenceFragments}))}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let r=[...this.active.values()].map(o=>o.emitter.snapshotStats()),i=o=>r.reduce((c,a)=>c+a[o],0),n=this.memoryUsage(),s=this.softMemoryLimitBytes!==null&&n.heapUsedBytes>=this.softMemoryLimitBytes;return{protocolVersion:k,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,sessionsEvicted:this.sessionsEvicted,activeSessions:this.active.size,maxActiveSessions:this.maxActiveSessions,heapUsedBytes:n.heapUsedBytes,heapLimitBytes:n.heapLimitBytes,...this.softMemoryLimitBytes===null?{}:{softMemoryLimitBytes:this.softMemoryLimitBytes},retireRequested:s,initializations:i("initializations"),programUpdates:i("programUpdates"),documentsEmitted:i("documentsEmitted"),documentsRemoved:i("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let r=`${e.tsconfigPath}\0${e.projectArgument}`,i=this.active.get(r);if(i?.projectIdentity===e.projectIdentity)return this.active.delete(r),this.active.set(r,i),i;if(i)this.active.delete(r);else if(this.active.size>=this.maxActiveSessions){let o=this.active.keys().next().value;o!==void 0&&(this.active.delete(o),this.sessionsEvicted+=1)}let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);i&&(this.sessionsReplaced+=1);let s={projectIdentity:e.projectIdentity,emitter:n.emitter};return this.active.set(r,s),this.sessionsCreated+=1,s}};var se=`typescript-index-${process.pid}-${q()}`,B=R(process.pid),oe={pid:process.pid,...B?{processIdentity:B}:{}};export{J as a,N as b};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-FIQRSHVM.js";import{c as R,d as E}from"./chunk-JFMEXGFE.js";import{h as S}from"./chunk-7F45LJKI.js";import{randomUUID as q}from"crypto";import{getHeapStatistics as V}from"v8";import{resolve as H}from"path";import{createRequire as L}from"module";import{dirname as I,isAbsolute as j,relative as P,resolve as m,sep as b}from"path";var u=L(import.meta.url),_=1,D="0.4.0";function z(){try{let t=M();if(!t.available)return t;let{packageRoot:e}=t,r=u.resolve("typescript",{paths:[e]}),i=u(r),{FileIndexer:n}=u(m(e,"dist/src/FileIndexer.js")),{Input:s}=u(m(e,"dist/src/Input.js")),{Packages:o}=u(m(e,"dist/src/Packages.js")),c=u(m(e,"dist/src/scip.js"));if(!n||!s||!o||!c.scip?.Document||!c.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let a={packageVersion:t.packageVersion,typescript:i,Document:c.scip.Document,Index:c.scip.Index,FileIndexer:n,Input:s,Packages:o};return{available:!0,runtime:a,producerIdentity:x(a)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function J(){let t=M();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function M(){try{let t=u.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(S(t,"scip-typescript package manifest"));if(e.version!==D)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${D}`};let r=I(t),i=u.resolve("typescript/package.json",{paths:[r]}),n=JSON.parse(S(i,"TypeScript package manifest"));return typeof n.version!="string"||!n.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:n.version,producerIdentity:C(e.version,n.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function A(t){let e=t.runtime===void 0?z():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:x(t.runtime)};return e.available?{available:!0,emitter:new T(t,e.runtime)}:e}var T=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=m(e.workspaceRoot),this.tsconfigPath=m(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??O(this.workspaceRoot,I(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=x(r);let i=v(r.typescript,this.tsconfigPath);this.config=i,this.host=new w(r.typescript,i.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now();this.initializeProgram();let r=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(f(i.fileName))&&r.push(this.emitSourceFile(i));return this.result(r,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);if(this.fragments.clear(),i.length===0&&n.length===0)return this.validateAffectedPaths(s),this.result(this.emitAffectedFiles(s),r);let o=v(this.runtime.typescript,this.tsconfigPath);this.config=o,this.includedFiles=new Set(o.fileNames.map(f));let c=this.program,a=new Map;for(let d of[...i,...n]){let p=y(this.workspaceRoot,d),l=c.getSourceFile(p);l&&(a.set(d,l),this.stats.symbolEntriesPruned+=F(this.symbolTable,l),this.stats.symbolEntriesPruned+=F(this.constructorTable,l)),this.host.invalidate(p)}this.program=this.runtime.typescript.createProgram(o.fileNames,o.options,this.host.compilerHost,c),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1,this.validateIncrementalPaths(i,n,s),this.stats.documentsRemoved+=n.length;for(let[d,p]of a)this.program.getSourceFile(y(this.workspaceRoot,d))===p?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;return this.result(this.emitAffectedFiles(s),r)}fragment(e){return this.fragments.get(g(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=performance.now();this.initializeProgram();let i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);return this.fragments.clear(),this.validateIncrementalPaths(i,n,s,!0),this.stats.documentsRemoved+=n.length,this.result(this.emitAffectedFiles(s),r)}initializeProgram(){let e=this.config??v(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(e.fileNames.map(f)),this.program=this.runtime.typescript.createProgram(e.fileNames,e.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1}validateIncrementalPaths(e,r,i,n=!1){if(!n&&e.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires a modified or removed file");if(i.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires an affected or removed file");for(let s of e){let o=y(this.workspaceRoot,s);if(!this.program?.getSourceFile(o))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${s}`)}for(let s of r){let o=y(this.workspaceRoot,s);if(this.program?.getSourceFile(o))throw new Error(`removed TypeScript source is still present in the configured project: ${s}`)}this.validateAffectedPaths(i)}validateAffectedPaths(e){for(let r of e){let i=y(this.workspaceRoot,r);if(!this.includedFiles.has(f(i)))throw new Error(`affected TypeScript file is outside the configured project: ${r}`)}}emitAffectedFiles(e){return e.map(r=>{let i=this.program.getSourceFile(y(this.workspaceRoot,r));if(!i)throw new Error(`affected TypeScript source is unavailable: ${r}`);return this.emitSourceFile(i)})}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=g(P(this.workspaceRoot,e.fileName)),i=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),i,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,i.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:i.symbols.length,referenceFragments:[]};let s=i.serializeBinary();return this.fragments.set(r,s),{relativePath:r,bytes:s,occurrences:i.occurrences.length,symbols:i.symbols.length,referenceFragments:U(r,i)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function U(t,e){let r=new Map;for(let i of e.occurrences){if(!i.symbol||(i.symbol_roles&1)!==0||i.range.length<3)continue;let n=i.range[0],s=i.range[1];if(!Number.isInteger(n)||!Number.isInteger(s))continue;let o={targetSymbol:i.symbol,location:{file:t,line:n,column:s}};r.set(`${i.symbol}\0${n}\0${s}`,o)}return[...r.values()].sort((i,n)=>i.targetSymbol.localeCompare(n.targetSymbol)||i.location.line-n.location.line||i.location.column-n.location.column)}var w=class{compilerHost;sourceFiles=new Map;constructor(e,r,i){let n=e.createCompilerHost(r),s=n.getSourceFile.bind(n);this.compilerHost={...n,getCurrentDirectory:()=>i,getSourceFile:(o,c,a,d)=>{let p=f(o);if(this.sourceFiles.has(p))return this.sourceFiles.get(p);let l=s(o,c,a,d);return this.sourceFiles.set(p,l),l}}}invalidate(e){this.sourceFiles.delete(f(e))}};function v(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let i=t.parseJsonConfigFileContent(r.config,t.sys,I(e)),n=i.errors.filter(s=>s.code!==18003);if(n.length>0)throw new Error(t.formatDiagnostics(n,t.createCompilerHost({})));return i}function x(t){return C(t.packageVersion,t.typescript.version)}function C(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${_}`}function O(t,e){return g(P(t,e))||"."}function y(t,e){if(j(e))throw new Error(`expected a project-relative path: ${e}`);let r=m(t,e),i=t.endsWith(b)?t:`${t}${b}`;if(r!==t&&!r.startsWith(i))throw new Error(`path escapes the project root: ${e}`);return r}function h(t){return[...new Set(t.map(g))].sort()}function g(t){return t.split(b).join("/").replace(/^\.\//,"")}function f(t){return m(t)}function F(t,e){let r=0;for(let i of t.keys())if($(i)){try{if(i.getSourceFile()!==e)continue}catch{continue}t.delete(i),r+=1}return r}function $(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}var N=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;maxActiveSessions;softMemoryLimitBytes;memoryUsage;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;sessionsEvicted=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){if(this.projectRoot=H(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??A,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??E,e.maxActiveSessions!==void 0&&(!Number.isInteger(e.maxActiveSessions)||e.maxActiveSessions<1))throw new Error("TypeScript index maxActiveSessions must be a positive integer.");if(this.maxActiveSessions=e.maxActiveSessions??8,e.softMemoryLimitMb!==void 0&&(!Number.isInteger(e.softMemoryLimitMb)||e.softMemoryLimitMb<1))throw new Error("TypeScript index softMemoryLimitMb must be a positive integer.");this.softMemoryLimitBytes=e.softMemoryLimitMb===void 0?null:e.softMemoryLimitMb*1024*1024,this.memoryUsage=e.memoryUsage??(()=>({heapUsedBytes:process.memoryUsage().heapUsed,heapLimitBytes:V().heap_size_limit}))}handle(e,r){let i=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let n=this.emitterFor(r);if(n.emitter.producerIdentity!==r.producerIdentity)throw new Error("TypeScript index producer identity changed.");let s=n.emitter.snapshotStats(),o=n.emitter.advance({modifiedFiles:r.modifiedFiles,removedFiles:r.removedFiles,affectedFiles:r.affectedFiles}),c=this.monotonicNow()-i;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=c,this.lastError=null,this.unavailable=!1,{producerIdentity:o.producerIdentity,cold:o.stats.initializations>s.initializations,durationMs:c,fragments:o.fragments.map(a=>({relativePath:a.relativePath,bytesBase64:a.bytes===null?null:Buffer.from(a.bytes).toString("base64"),occurrences:a.occurrences,symbols:a.symbols,referenceFragments:a.referenceFragments}))}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let r=[...this.active.values()].map(o=>o.emitter.snapshotStats()),i=o=>r.reduce((c,a)=>c+a[o],0),n=this.memoryUsage(),s=this.softMemoryLimitBytes!==null&&n.heapUsedBytes>=this.softMemoryLimitBytes;return{protocolVersion:k,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,sessionsEvicted:this.sessionsEvicted,activeSessions:this.active.size,maxActiveSessions:this.maxActiveSessions,heapUsedBytes:n.heapUsedBytes,heapLimitBytes:n.heapLimitBytes,...this.softMemoryLimitBytes===null?{}:{softMemoryLimitBytes:this.softMemoryLimitBytes},retireRequested:s,initializations:i("initializations"),programUpdates:i("programUpdates"),documentsEmitted:i("documentsEmitted"),documentsRemoved:i("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let r=`${e.tsconfigPath}\0${e.projectArgument}`,i=this.active.get(r);if(i?.projectIdentity===e.projectIdentity)return this.active.delete(r),this.active.set(r,i),i;if(i)this.active.delete(r);else if(this.active.size>=this.maxActiveSessions){let o=this.active.keys().next().value;o!==void 0&&(this.active.delete(o),this.sessionsEvicted+=1)}let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);i&&(this.sessionsReplaced+=1);let s={projectIdentity:e.projectIdentity,emitter:n.emitter};return this.active.set(r,s),this.sessionsCreated+=1,s}};var se=`typescript-index-${process.pid}-${q()}`,B=R(process.pid),oe={pid:process.pid,...B?{processIdentity:B}:{}};export{J as a,N as b};
|
|
2
|
+
//# sourceMappingURL=chunk-P42EIXTA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as i}from"./chunk-TQPCBMWT.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PJFGPYTU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as x}from"./chunk-4UX2F3JX.js";import{f,g as p}from"./chunk-JGKUET5J.js";import{a as L}from"./chunk-CNO7TOKL.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as v}from"./chunk-CJZXN4NU.js";import{a as E}from"./chunk-BGBBVSH4.js";import{a as C}from"./chunk-W7CXK74K.js";import{a as y}from"./chunk-E73UNJTF.js";import{b}from"./chunk-OSSESPDX.js";import{d as m,t as g}from"./chunk-N2ZSIIGR.js";import{c as u,n as h}from"./chunk-ODDUPDP7.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,k=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,I=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,_=/\.(?:addIssue|push)\s*\(/;function M(e,t={}){let{scope:n,limit:i=30,scanLimit:l}=t,a=new v(e),r=D(a.productionCallableDefinitions({scope:n,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),s=[];for(let o of r){let c=P(e,o);c&&s.push({symbol:o.symbol,shortName:m(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:E(o),...c})}return s.sort((o,c)=>o.file.localeCompare(c.file)||o.startLine-c.startLine||o.loc-c.loc),i?s.slice(0,i):s}function w(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function P(e,t){let n=w(t.leaf);if(!n||L(e,t))return null;let i=f(e,t);if(!i||!I.test(i))return null;let l=h(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine);if(n==="predicate"&&l?.paramCount===0)return null;if(x(i)){let r=O(e,t);return!r||S(r.body,T(r.snippet))||R(r.body)?null:{nameKind:n,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let a=p(i);return S(a,T(i))||R(a)?null:{nameKind:n,resolvedVia:"direct"}}var F=new Set(["if","for","while","switch","catch","function"]);function R(e){let t=u(e);for(let n of t.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!F.has(n[1]))return!0;return!1}function T(e){let t=e.indexOf("=>");return t===-1?!1:!/^\s*\{/.test(e.slice(t+2))}function S(e,t){let n=u(e);if(/\bthrow\b/.test(n)||/\.reject\s*\(/.test(n)||k.test(n)||_.test(n))return!0;let i=K(n);if(t&&i.length===0){let l=n.trim();return l!==""&&l!=="true"}for(let l of i)if(l!==""&&l!=="true")return!0;return!1}function K(e){let t=[];d.lastIndex=0;let n;for(;n=d.exec(e);){let i=n.index+n[0].length,l=0,a=e.length;for(let r=i;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")l+=1;else if(s===")"||s==="]"||s==="}"){if(l===0){a=r;break}l-=1}else if(s===";"&&l===0){a=r;break}}t.push(e.slice(i,a).trim()),d.lastIndex=a}return t}function O(e,t){let n=y(e,t,{callableOnly:!0,limit:3,semanticEvidence:C}),i=[...new Set(n.map(o=>o.symbol))].filter(o=>o!==t.symbol);if(i.length!==1)return null;let a=b(e,i[0]).match;if(!a)return null;let r=g(e,a.relativePath).find(o=>o.symbolId===a.symbolId);if(!r)return null;let s=f(e,r);return s?{body:p(s),snippet:s,shortName:m(r.symbol)}:null}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PP7KNN7L.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-QOJONDS7.js";import{a as d}from"./chunk-WIWY3CRX.js";import{a as P}from"./chunk-WUN6KBHV.js";import{a as v}from"./chunk-BOJ5SVE2.js";import{c as b}from"./chunk-CJZXN4NU.js";import{a as p}from"./chunk-BGBBVSH4.js";import{a as g,h}from"./chunk-XRYABF57.js";import{d as l,h as u}from"./chunk-N2ZSIIGR.js";import{p as f,q as m}from"./chunk-ODDUPDP7.js";import{basename as x,extname as L}from"path";function z(i,e){let{scope:r,maxLoc:n=15,limit:o=30,scanLimit:s}=e??{},a=new b(i);return P({candidates:()=>E(i,a,r,n),orderCandidates:v,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:t=>a.calleeMap(t,{semantic:e?.semantic!==!1}),evaluate:(t,c)=>S(i,t,c.get(t.symbolId)??[]),orderResults:(t,c)=>t.loc-c.loc||t.file.localeCompare(c.file),limit:o})}function S(i,e,r){let n=w(r);if(n.size!==1||!f(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...n.entries()][0],s=D(i,e,o),a=T(i,e),t=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:t,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:I(t,s,a)}}function D(i,e,r){return y(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(r.symbol)},{label:"passthrough module",value:x(e.relativePath,L(e.relativePath))},{label:"callee module",value:x(r.file,L(r.file))}])}function I(i,e,r){if(i==="signal"){if(r.length>0)return`Review the public API before inlining; public-facade evidence: ${r.slice(0,2).join("; ")}.`;let n=e.filter(C);return n.length>0?`Review the public API before inlining; public-surface evidence: ${n.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(i,e){return d(i,e)?g(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:h(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i){return i.includes("public surface")}function w(i){let e=i.some(n=>u(n.symbol))?i.filter(n=>u(n.symbol)):i,r=new Map;for(let n of e)r.has(n.symbol)||r.set(n.symbol,n);return r}function E(i,e,r,n){return e.productionCallableDefinitions({scope:r,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!m(i,o))}export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PU7T5QYQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as f}from"./chunk-
|
|
1
|
+
import{c as f}from"./chunk-CJZXN4NU.js";import{a as b,d as g}from"./chunk-XRYABF57.js";import{d as m}from"./chunk-N2ZSIIGR.js";import{B as a,x as u,y as _}from"./chunk-ODDUPDP7.js";import{a as l}from"./chunk-ZOHS7AQV.js";import{h as p}from"./chunk-FESCRNVV.js";function B(e,t={}){let{scope:o,limit:r}=t,i=new f(e),s=T([...x(e,o),...y(e,i,o)]);return F(s),r?s.slice(0,r):s}function x(e,t){let o=[];for(let r of N(e,t)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||g(e,r.barrel_path)||p(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=I(e,r),s=i?.barrel_consumers??0,n=i?.direct_consumers??0;s!==0||n!==0||o.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:m(r.symbol),originalFile:r.original_path,barrelConsumers:s,directConsumers:n,...h(e,r.barrel_path)})}return o}function N(e,t){let o=t?"AND barrel_d.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.all(`WITH barrel_refs AS MATERIALIZED (
|
|
2
2
|
SELECT DISTINCT
|
|
3
3
|
barrel_d.id AS barrel_doc_id,
|
|
4
4
|
barrel_d.relative_path AS barrel_path,
|
|
@@ -71,4 +71,4 @@ import{c as f}from"./chunk-PLYUVM4F.js";import{a as b,d as g}from"./chunk-BECZLY
|
|
|
71
71
|
${e.pathExclusionsFor("consumer_d")}
|
|
72
72
|
GROUP BY consumer_d.id
|
|
73
73
|
)`,t.barrel_doc_id,t.symbol_id,t.barrel_doc_id,t.original_doc_id)}function y(e,t,o){let r=[],i=C(e);for(let s of O(e,o))E(i,s,s)>0||r.push(...D(e,t,s,i));return r}function O(e,t){return l(e,{scope:t,includeIgnored:!1}).filter(o=>a(e,o).length>0||u(e,o).length>0)}function D(e,t,o,r){let i=a(e,o).filter(n=>n.sourcePath&&!e.isIgnored(n.sourcePath)).flatMap(n=>R(e,t,o,n.sourcePath,r,[A(n.specifier)])),s=u(e,o).filter(n=>n.sourcePath&&!e.isIgnored(n.sourcePath)).flatMap(n=>R(e,t,o,n.sourcePath,r,n.kind==="named"&&n.names.length>0?n.names:[n.kind==="star"?`* from ${n.sourcePath}`:`* namespace from ${n.sourcePath}`]));return[...i,...s]}function R(e,t,o,r,i,s){let n=t.definitionsForFile(r);return s.map(c=>{let d=n.find(S=>S.leaf===c);return{barrelFile:o,symbol:d?.symbol??`source-reexport:${o}:${c}`,shortName:d?m(d.symbol):c,originalFile:r,barrelConsumers:0,directConsumers:E(i,r,o),...h(e,o)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function h(e,t){return b(e,t)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function C(e){let t=new Map;for(let o of l(e,{includeIgnored:!1}))for(let r of _(e,o)){if(!r.sourcePath)continue;let i=t.get(r.sourcePath)??new Set;i.add(o),t.set(r.sourcePath,i)}return t}function E(e,t,o){let r=e.get(t);return r?r.size-(r.has(o)?1:0):0}function T(e){let t=new Set,o=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;t.has(i)||(t.add(i),o.push(r))}return o}function F(e){e.sort((t,o)=>o.directConsumers-t.directConsumers||t.barrelFile.localeCompare(o.barrelFile)||t.shortName.localeCompare(o.shortName))}export{B as a};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-PWWAJSKV.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-BRV7PIFF.js";import{a as r}from"./chunk-OSSESPDX.js";import{b as l}from"./chunk-TEBQMNVI.js";import{d as m}from"./chunk-N2ZSIIGR.js";function N(n,t){let e=r(n,t);if(!e)return[];let s=n.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN (
|
|
@@ -70,4 +70,4 @@ import{a as c}from"./chunk-ERCYGVAM.js";import{a as r}from"./chunk-5H5WTJSD.js";
|
|
|
70
70
|
GROUP BY d.id
|
|
71
71
|
ORDER BY symbol_count DESC
|
|
72
72
|
LIMIT ?`,...i,e).filter(d=>!n.isIgnored(d.relative_path)).map(d=>({name:d.relative_path,count:d.symbol_count}))}export{N as a,a as b,u as c,g as d,I as e,R as f};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-PZL5T7SU.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as d,u as p}from"./chunk-
|
|
1
|
+
import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as d,u as p}from"./chunk-N2ZSIIGR.js";import{a as c}from"./chunk-ZOHS7AQV.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
|
|
2
2
|
FROM defn_enclosing_ranges der
|
|
3
3
|
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
4
4
|
JOIN documents d ON der.document_id = d.id
|
|
@@ -20,4 +20,4 @@ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as
|
|
|
20
20
|
${n.symbolNoiseFor("gs")}
|
|
21
21
|
AND d.relative_path IN (${i})
|
|
22
22
|
ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-QBE3YX64.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-QOJONDS7.js";import{a as j,b as g,c as N}from"./chunk-HLZTEXRA.js";import{a as _}from"./chunk-WUN6KBHV.js";import{a as E}from"./chunk-BOJ5SVE2.js";import{b as C,c as P}from"./chunk-CJZXN4NU.js";import{a as k}from"./chunk-BGBBVSH4.js";import{b as w}from"./chunk-DYGHBZ2N.js";import{A as L,d,e as y,k as v}from"./chunk-N2ZSIIGR.js";import{q as S}from"./chunk-ODDUPDP7.js";import{y as x}from"./chunk-JWTGMPIT.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=j(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return N(t,e,o).realConsumers}function T(t,n,e){return t.get(`SELECT c.start_line, c.end_line
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d ON c.document_id = d.id
|
|
5
5
|
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
6
|
LIMIT 1`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return R(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-QGVTFRY2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{k as c,l}from"./chunk-FESCRNVV.js";function h(e,a,i,r,n,o){let t=new Set;d(e,a,i,r)&&t.add(n);for(let s of o)s.value&&p(t,s.label,s.value);return[...t].slice(0,6)}function p(e,a,i){let r=u(i);a.endsWith("name")&&y(r)&&e.add(`${a} has type-guard boundary shape`);for(let n of r){let o=f.get(n);o&&e.add(`${a} has ${o} term: ${n}`)}}function d(e,a,i,r){if(i<=0)return!1;let n=c(e,a);if(n.length===0)return!1;for(let o=i-1;o>=0&&o>=i-5;o-=1){let t=(n[o]??"").trim();if(t!==""){if(l(t)===r)return!0;if(!t.startsWith("//")&&!t.startsWith("*")&&!t.startsWith("/*")&&!t.startsWith("@")&&!t.startsWith("#"))return!1}}return!1}function u(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function y(e){return e.some(a=>g.has(a))&&e.some(a=>m.has(a))}var f=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),g=new Set(["can","has","is","should"]),m=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QOJONDS7.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as C}from"./chunk-WUN6KBHV.js";import{c as M}from"./chunk-T4N4P2K5.js";import{b as f,c as I}from"./chunk-CJZXN4NU.js";import{e as d}from"./chunk-NWQXSFFU.js";import{d as h}from"./chunk-MTDBHTSF.js";import{d as g}from"./chunk-N2ZSIIGR.js";import{n as y}from"./chunk-ODDUPDP7.js";var x=new Set(h());function N(e,n){let{scope:o,minLoc:r=10,limit:i=30,scanLimit:t}=n??{},s=new I(e);return C({candidates:()=>s.productionCallableDefinitions({scope:o,minLoc:r,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof t=="number"&&t>0}),scanLimit:t,filterCandidate:S,profile:{name:"complexity-hotspots"},prepare:a=>{let l=B(e,a),m=n?.semantic!==!1,c=m?d(e):null;c?.materializeReferences(a,{prefetchCallees:!0});let u=s.crossFileCallerMap(a,{semantic:!1});return{callerMap:c?f(u,c.callerMap(a)):u,calleeMap:s.calleeMap(a,{semantic:m}),languageByFile:l,clojureCallableIds:D(e,a,l),branchEstimates:M(e,a)}},evaluate:(a,l)=>L(a,l,r),orderResults:(a,l)=>l.score-a.score||l.loc-a.loc,limit:i})}function S(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&x.has(e.kind):!0}function L(e,n,o){if(n.languageByFile.get(e.relativePath)==="clojure"&&!n.clojureCallableIds.has(e.symbolId))return null;let r=e.endLine-e.startLine+1;if(r<o)return null;let i=n.callerMap.get(e.symbolId)?.size??0,t=n.calleeMap.get(e.symbolId)??[],s=new Set,a=new Set;for(let p of t){let b=`${p.symbol}|${p.file}`;s.add(b),p.file!==e.relativePath&&a.add(b)}let l=a.size,m=s.size,c=n.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},u=c.branches+1;return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:r,fanIn:i,fanOut:l,calleeCount:m,branches:c.branches,estimateBasis:c.estimateBasis,score:Math.round(r/50*(i/5)*Math.max(l/5,1)*Math.max(u/5,1)*100)/100}}function B(e,n){let o=[...new Set(n.map(t=>t.relativePath))];if(o.length===0)return new Map;let r=o.map(()=>"?").join(", "),i=e.all(`SELECT relative_path, language
|
|
2
|
+
FROM documents
|
|
3
|
+
WHERE relative_path IN (${r})`,...o);return new Map(i.map(t=>[t.relative_path,t.language?.toLowerCase()??null]))}function D(e,n,o){let r=new Set,i=new Map;for(let t of n){if(o.get(t.relativePath)!=="clojure")continue;let s=i.get(t.relativePath);s||(s=new Set((y(e,t.relativePath)?.callables??[]).map(a=>`${a.name}:${a.startLine}`)),i.set(t.relativePath,s)),s.has(`${t.leaf}:${t.startLine}`)&&r.add(t.symbolId)}return r}export{N as a};
|
|
4
|
+
//# sourceMappingURL=chunk-QU5XRYB5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-BRV7PIFF.js";import{c as y}from"./chunk-CJZXN4NU.js";import{i as v}from"./chunk-NWQXSFFU.js";import{a as R,b as k,j as b}from"./chunk-XRYABF57.js";import{b as C}from"./chunk-NJITK2GP.js";import{d as h}from"./chunk-N2ZSIIGR.js";import{Aa as f,Ba as g,c as m}from"./chunk-N5B2NILC.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
|
|
2
2
|
WHERE relative_path = ?
|
|
3
3
|
${e.pathExclusionsFor("documents")}
|
|
4
4
|
LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
@@ -8,4 +8,4 @@ import{a as S}from"./chunk-ERCYGVAM.js";import{c as y}from"./chunk-PLYUVM4F.js";
|
|
|
8
8
|
WHERE m.symbol_id = ?
|
|
9
9
|
AND m.role != 1
|
|
10
10
|
AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-QUU5OBVK.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{Nb as q,Ob as N,Pb as ot,Qb as V,Sb as at,mc as it,oc as U,tc as L,uc as B}from"./chunk-NOYBFVJA.js";import{Ca as I,Ge as st,Md as et,Nd as nt,Od as rt,Pd as z,Wd as j,u as A}from"./chunk-66DVSJQG.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
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
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
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(`
|
|
@@ -17,4 +17,4 @@ ${e.command}]
|
|
|
17
17
|
`:`
|
|
18
18
|
[scip-query transport complete; evaluate command coverage separately]
|
|
19
19
|
`;return`${s}${t.content}${r}`}export{ee as a,fe as b,un as c,cn as d};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-RBLQNW26.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import{d as y}from"./chunk-GUFSG5TX.js";import{c as g}from"./chunk-IW5XQG5G.js";import{createHash as C}from"crypto";import{existsSync as A,mkdirSync as F}from"fs";import{dirname as T,join as b}from"path";import _ from"better-sqlite3";var O="evidence.db";var w=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],h=new Set(w),I=25e4,x=512*1024*1024,k=6e4,u=new WeakMap,M=g("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),j=g("evidence-project-fingerprint",{clearGroups:["whole-project"]}),s="evidence-v1",d="version NOT LIKE 'evidence-%'";function N(r){return C("sha256").update(r).digest("hex")}function Y(r,n,e){return M.get(r,n,()=>N(e))}function V(r){return j.get(r,"current",()=>{try{if(!r.generation.metadataRaw)return null;let n=y(r.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let e=n.metadata,a=[...e.indexedLanguages??[]].sort();return N(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(n){return E("project fingerprint unavailable",n),null}})}function E(r,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${r}: ${n instanceof Error?n.message:String(n)}`)}function o(r){if(u.has(r))return u.get(r)??null;let n=null;try{let e=new _(r.config.evidenceDbPath??b(T(r.config.dbPath),O));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.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
|
+
`),n={evidence:e,shared:U(r.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
|
|
36
|
+
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
|
|
37
|
+
ORDER BY version DESC
|
|
38
|
+
LIMIT 1`),existsFileEvidence:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:e.prepare(`SELECT 1 AS present FROM file_evidence
|
|
39
|
+
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
|
|
40
|
+
LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:e.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.prepare(`SELECT payload FROM project_evidence
|
|
41
|
+
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${d}
|
|
42
|
+
ORDER BY version DESC
|
|
43
|
+
LIMIT 1`),writeProjectEvidence:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:e.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
44
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
45
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${d}
|
|
46
|
+
ORDER BY version DESC
|
|
47
|
+
LIMIT 1`),readCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
48
|
+
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
49
|
+
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${d}
|
|
50
|
+
ORDER BY symbol, version DESC`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
51
|
+
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
52
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
53
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${d}
|
|
54
|
+
ORDER BY version DESC
|
|
55
|
+
LIMIT 1`),readReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
|
|
56
|
+
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
|
|
57
|
+
WHERE relative_path = ? AND project_fingerprint = ? AND ${d}
|
|
58
|
+
ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
59
|
+
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){E("disabled (open failed)",e)}return u.set(r,n),n}function l(r,n,e){E(`disabled (${n})`,e),u.set(r,null)}function U(r){if(!r)return null;try{F(T(r),{recursive:!0});let n=new _(r);return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
|
|
60
|
+
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
61
|
+
kind TEXT NOT NULL,
|
|
62
|
+
relative_path TEXT NOT NULL,
|
|
63
|
+
content_hash TEXT NOT NULL,
|
|
64
|
+
version TEXT NOT NULL,
|
|
65
|
+
payload TEXT NOT NULL,
|
|
66
|
+
last_accessed_at INTEGER NOT NULL,
|
|
67
|
+
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
68
|
+
);
|
|
69
|
+
CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
70
|
+
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
|
|
71
|
+
`),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:n.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
72
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
73
|
+
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
74
|
+
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
|
|
75
|
+
SET last_accessed_at = ?
|
|
76
|
+
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
|
|
77
|
+
AND last_accessed_at < ?`)}}catch(n){return E("shared cache disabled (open failed)",n),null}}function v(r,n,e){E(`shared cache disabled (${n})`,e);try{r.shared?.evidence.close()}catch{}r.shared=null}function $(r,n={}){if(!A(r))return null;let e;try{e=new _(r),e.pragma("busy_timeout = 50"),e.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
78
|
+
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),e.pragma("wal_checkpoint(TRUNCATE)");let a=e.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,t=n.maxRows??I,i=n.budgetBytes??x,c=Number(e.pragma("page_size",{simple:!0})),S=Number(e.pragma("page_count",{simple:!0})),R=Number(e.pragma("freelist_count",{simple:!0})),f=Math.max(0,S-R)*c,L=a>0&&f>i?Math.min(a,Math.ceil((f-i)/Math.max(1,f/a))):0,p=Math.max(a-t,L);return p>0&&(e.prepare(`DELETE FROM file_evidence WHERE rowid IN (
|
|
79
|
+
SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
|
|
80
|
+
)`).run(p),e.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:p,remainingRows:a-p}}catch(a){return E("shared cache maintenance skipped",a),null}finally{try{e?.close()}catch{}}}function G(r,n,e,a){let t=o(r);if(!t)return null;try{let i=t.readFileEvidence.get(n,e,a,s)??t.readLegacyFileEvidence.get(n,e,a);if(i?.payload!==void 0)return i.payload;if(!h.has(n)||!t.shared)return null;try{let c=t.shared.readFileEvidence.get(n,e,a,s);return c?.payload!==void 0&&D(t.shared,n,e,a),c?.payload??null}catch(c){return v(t,"file_evidence read",c),null}}catch(i){return l(r,"file_evidence read",i),null}}function J(r,n,e,a){let t=o(r);if(!t)return!1;try{if((t.existsFileEvidence.get(n,e,a,s)??t.existsLegacyFileEvidence.get(n,e,a))?.present!==void 0)return!0;if(!h.has(n)||!t.shared)return!1;try{return t.shared.existsFileEvidence.get(n,e,a,s)?.present===void 0?!1:(D(t.shared,n,e,a),!0)}catch(c){return v(t,"file_evidence exists",c),!1}}catch(i){return l(r,"file_evidence exists",i),!1}}function D(r,n,e,a){let t=Date.now();try{r.touchFileEvidence.run(t,n,e,a,s,t-k)}catch(i){E("shared file_evidence recency touch skipped",i)}}function z(r,n,e,a,t){let i=o(r);if(i)try{if(i.writeFileEvidence.run(n,e,a,s,t),h.has(n)&&i.shared)try{i.shared.writeFileEvidence.run(n,e,a,s,t,Date.now())}catch(c){v(i,"file_evidence write",c)}}catch(c){l(r,"file_evidence write",c)}}function Q(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{for(let t of n)e.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s,t.payload)})();try{e.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=n.filter(t=>h.has(t.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let t of a)e.shared.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s,t.payload,Date.now())})()}catch(t){v(e,"file_evidence batch write",t)}}catch(a){l(r,"file_evidence batch write",a)}}function q(r,n,e,a){let t=o(r);if(!t)return null;try{return(t.readProjectEvidence.get(n,e,a,s)??t.readLegacyProjectEvidence.get(n,e,a))?.payload??null}catch(i){return l(r,"project_evidence read",i),null}}function Z(r,n,e,a,t){let i=o(r);if(i)try{i.writeProjectEvidence.run(n,e,a,s,t)}catch(c){l(r,"project_evidence write",c)}}function ee(r,n,e,a){if(e===a)return 0;let t=o(r);if(!t)return 0;try{return t.rekeyProjectEvidenceKind.run(a,s,n,e).changes}catch(i){return l(r,"project_evidence kind rekey",i),0}}function ne(r,n,e,a){let t=o(r);if(!t)return new Map;try{let i=t.readCalleesForFile.all(n,e,a,s),c=t.readLegacyCalleesForFile.all(n,e,a);return m([...c,...i])}catch(i){return l(r,"semantic_callees bulk read",i),new Map}}function te(r,n,e){let a=o(r);if(!a)return new Map;try{let t=a.readReferencesForFile.all(n,e,s),i=a.readLegacyReferencesForFile.all(n,e);return m([...i,...t])}catch(t){return l(r,"semantic_references bulk read",t),new Map}}function m(r){let n=new Map;for(let e of r)n.set(e.symbol,e.payload);return n}function re(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(t.relativePath,t.contentHash)),e.writeCallees.run(t.relativePath,t.symbol,t.contentHash,t.depsDigest,s,t.payload)}})()}catch(a){l(r,"semantic_callees write",a)}}function ae(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(t.relativePath,t.projectFingerprint)),e.writeReferences.run(t.relativePath,t.symbol,t.projectFingerprint,s,t.payload)}})()}catch(a){l(r,"semantic_references write",a)}}function ce(r){return typeof r=="object"&&r!==null}function se(r){return Array.isArray(r)&&r.every(n=>typeof n=="string")?r:null}export{O as a,N as b,Y as c,V as d,$ as e,G as f,J as g,z as h,Q as i,q as j,Z as k,ee as l,ne as m,te as n,re as o,ae as p,ce as q,se as r};
|
|
81
|
+
//# sourceMappingURL=chunk-RTQ7NEKG.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
1
|
+
import{b as i}from"./chunk-EKV5HX33.js";import{a as o}from"./chunk-2GRUZAQF.js";import{Y as l}from"./chunk-3L2ZBPEX.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
2
|
WHERE relative_path IN (${a})
|
|
3
3
|
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-SQXRS7BG.js.map
|