scip-query 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +244 -1
- package/README.md +2 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-H3P6BR5G.js +2 -0
- package/dist/call-graph-VTG2CUOQ.js +2 -0
- package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
- package/dist/chunk-2BMSSRBH.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-2GJSD5GY.js} +2 -2
- package/dist/{chunk-W5OXRYGE.js → chunk-2M2LSIMY.js} +3 -3
- package/dist/{chunk-2LDBDR6J.js → chunk-2N6WBNDC.js} +2 -2
- package/dist/{chunk-HOENASQM.js → chunk-2USA3S3P.js} +2 -2
- package/dist/chunk-2VAHDDLM.js +133 -0
- package/dist/chunk-2XWIUW5Z.js +455 -0
- package/dist/chunk-3D4BOXW6.js +20 -0
- package/dist/{chunk-BBCIS4DX.js → chunk-3LO4FST5.js} +2 -2
- package/dist/chunk-3WTY4LP2.js +3 -0
- package/dist/{chunk-UXW33INU.js → chunk-3Z5AMSK6.js} +2 -2
- package/dist/{chunk-4ILJCCXV.js → chunk-44IETFOU.js} +2 -2
- package/dist/chunk-4FR6GQIT.js +2 -0
- package/dist/chunk-4KBTHJLP.js +2 -0
- package/dist/{chunk-SSK6LDPC.js → chunk-5BIKR67W.js} +2 -2
- package/dist/{chunk-IHGQTTVW.js → chunk-5PROPLHI.js} +2 -2
- package/dist/{chunk-TA3QKLLU.js → chunk-5V7EPTII.js} +2 -2
- package/dist/{chunk-JS4PGXMV.js → chunk-62LPZCBQ.js} +2 -2
- package/dist/{chunk-DBRSYFXR.js → chunk-64O2JHQA.js} +2 -2
- package/dist/chunk-6D4F5VWG.js +10 -0
- package/dist/{chunk-BHVUJOCQ.js → chunk-6ERFBC3X.js} +2 -2
- package/dist/{chunk-ILTDAWEF.js → chunk-6ILKOOGH.js} +2 -2
- package/dist/chunk-6MFXCMZC.js +2 -0
- package/dist/chunk-6O7FACKB.js +2 -0
- package/dist/{chunk-XDQMU3BT.js → chunk-6TS3KOXR.js} +2 -2
- package/dist/{chunk-YI2AWIHC.js → chunk-76QOU4PK.js} +2 -2
- package/dist/{chunk-7CYG22FH.js → chunk-7DUI77BN.js} +2 -2
- package/dist/{chunk-IDFEUFKS.js → chunk-7F7T6DCR.js} +2 -2
- package/dist/chunk-7H6VHWWJ.js +2 -0
- package/dist/chunk-7HXT6YLU.js +5 -0
- package/dist/{chunk-DIRJWYBM.js → chunk-7R4V5ES6.js} +4 -4
- package/dist/{chunk-SZHGTCPP.js → chunk-7RIRIADH.js} +2 -2
- package/dist/chunk-7ZLWLOGT.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-A4WEAK35.js} +2 -2
- package/dist/chunk-AADQLOQ4.js +38 -0
- package/dist/{chunk-OLNV6I6U.js → chunk-AN76MGUE.js} +2 -2
- package/dist/chunk-ANLNLY66.js +2 -0
- package/dist/chunk-ATXPTSEI.js +81 -0
- package/dist/{chunk-YPWBKGFU.js → chunk-AX7IDVFT.js} +2 -2
- package/dist/chunk-B7MPDEAK.js +3 -0
- package/dist/chunk-BBB5FBX4.js +2 -0
- package/dist/{chunk-6I6L7Z62.js → chunk-BHKK5RJY.js} +2 -2
- package/dist/chunk-BJWFVAA5.js +2 -0
- package/dist/{chunk-UHFYCMZO.js → chunk-BKZYTLGE.js} +2 -2
- package/dist/chunk-BL6DCHQP.js +2 -0
- package/dist/{chunk-TEBQMNVI.js → chunk-BOW7SSQH.js} +2 -2
- package/dist/{chunk-OWOOWNJ5.js → chunk-C4RHHCKL.js} +2 -2
- package/dist/{chunk-N2ZSIIGR.js → chunk-C7C6AKAT.js} +6 -6
- package/dist/chunk-CD6M6LS2.js +16 -0
- package/dist/chunk-CFE6PSG6.js +2 -0
- package/dist/{chunk-6V5CNXL6.js → chunk-CFNIGQMT.js} +2 -2
- package/dist/{chunk-GUFSG5TX.js → chunk-CKBUBRYD.js} +2 -2
- package/dist/{chunk-4WNW27SX.js → chunk-CZW5MZ5B.js} +2 -2
- package/dist/chunk-DBBZ63ZX.js +2 -0
- package/dist/{chunk-HCXEQRFF.js → chunk-DBN7DMJB.js} +2 -2
- package/dist/{chunk-6PQNKL3G.js → chunk-DUULLZHZ.js} +2 -2
- package/dist/{chunk-Z4CDXYNQ.js → chunk-DV5Y5NOS.js} +2 -2
- package/dist/chunk-DZOIKCTM.js +3 -0
- package/dist/chunk-E4PKTOL3.js +2 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-E65ELFKU.js} +2 -2
- package/dist/{chunk-CNO7TOKL.js → chunk-E7QR35ST.js} +2 -2
- package/dist/{chunk-3D3QG236.js → chunk-EFSXAINW.js} +2 -2
- package/dist/{chunk-IL676XCC.js → chunk-EHVEIEQN.js} +2 -2
- package/dist/{chunk-BE7ZZTMC.js → chunk-EHYDXE3Z.js} +2 -2
- package/dist/{chunk-LXABEJX3.js → chunk-EP63Y6LD.js} +2 -2
- package/dist/{chunk-QU5XRYB5.js → chunk-EPX6NQN6.js} +2 -2
- package/dist/{chunk-FESCRNVV.js → chunk-ETC674NS.js} +2 -2
- package/dist/{chunk-OSSESPDX.js → chunk-F5GSBHC6.js} +2 -2
- package/dist/chunk-FH3DGXC6.js +2 -0
- package/dist/{chunk-YEN6CYC7.js → chunk-FI7VGOR4.js} +2 -2
- package/dist/chunk-FJF6VO2P.js +2 -0
- package/dist/{chunk-FRUSVINH.js → chunk-FLMTCX5R.js} +2 -2
- package/dist/chunk-FVFDOIM3.js +2 -0
- package/dist/{chunk-PJFGPYTU.js → chunk-G2HU5WRN.js} +2 -2
- package/dist/{chunk-FIQRSHVM.js → chunk-G4ALYS4J.js} +2 -2
- package/dist/{chunk-UVGEWT4Y.js → chunk-G56I7K4W.js} +2 -2
- package/dist/{chunk-WOIKCX6A.js → chunk-GC4DG2V5.js} +2 -2
- package/dist/chunk-GG45PK4S.js +4 -0
- package/dist/{chunk-XBGWL66K.js → chunk-GHNPACNP.js} +2 -2
- package/dist/{chunk-IICPE7B2.js → chunk-GINH3YQU.js} +2 -2
- package/dist/{chunk-HLZTEXRA.js → chunk-GTZZVLKJ.js} +2 -2
- package/dist/chunk-GXXW5ZHH.js +2 -0
- package/dist/{chunk-B5D7QPBE.js → chunk-HAXXKRTD.js} +2 -2
- package/dist/chunk-HEZWBAZY.js +2 -0
- package/dist/chunk-HMEWLMML.js +2 -0
- package/dist/{chunk-QUU5OBVK.js → chunk-HOBOVYPO.js} +2 -2
- package/dist/{chunk-XGZEP6GR.js → chunk-HRFQ6GW5.js} +2 -2
- package/dist/{chunk-MPQ4OTBM.js → chunk-HX4X7KG3.js} +2 -2
- package/dist/{chunk-FDLOBR6P.js → chunk-HYT2R7LX.js} +2 -2
- package/dist/chunk-IKQVBVQL.js +40 -0
- package/dist/chunk-J6GLBBRK.js +4 -0
- package/dist/{chunk-ZTI4SBFV.js → chunk-J7A4PWFX.js} +2 -2
- package/dist/{chunk-OSR2GEHQ.js → chunk-JCSAZ35V.js} +2 -2
- package/dist/{chunk-ESIQ66Z7.js → chunk-JDU2IV3A.js} +2 -2
- package/dist/chunk-JFMI5SGB.js +4 -0
- package/dist/{chunk-W6STWDQI.js → chunk-JJP37RGX.js} +2 -2
- package/dist/chunk-JZ2A7LDM.js +5 -0
- package/dist/chunk-KNLQGXVH.js +80 -0
- package/dist/chunk-KVQCECPR.js +2 -0
- package/dist/{chunk-SQXRS7BG.js → chunk-KXXORBZ2.js} +2 -2
- package/dist/{chunk-DIUFNHRJ.js → chunk-L5KYH6U3.js} +2 -2
- package/dist/chunk-L6XHYJPZ.js +21 -0
- package/dist/{chunk-2GRUZAQF.js → chunk-L7KTFEAV.js} +2 -2
- package/dist/{chunk-QBE3YX64.js → chunk-LDXHR5EL.js} +2 -2
- package/dist/{chunk-HEHOQQKH.js → chunk-MHGDSBFX.js} +2 -2
- package/dist/{chunk-PWWAJSKV.js → chunk-MLQVVDG3.js} +2 -2
- package/dist/chunk-MOKUWRHO.js +3 -0
- package/dist/{chunk-VQILFTEH.js → chunk-MPYAPMNE.js} +2 -2
- package/dist/{chunk-UICY4GTQ.js → chunk-MV6SPXCR.js} +2 -2
- package/dist/{chunk-HYO3NP5Q.js → chunk-MZPXPSUJ.js} +2 -2
- package/dist/{chunk-VZRNID6A.js → chunk-N55KIE46.js} +2 -2
- package/dist/{chunk-YF5IB2LF.js → chunk-NB4D3BNM.js} +2 -2
- package/dist/{chunk-VVZSBTSU.js → chunk-NGKBOT6G.js} +2 -2
- package/dist/{chunk-NJITK2GP.js → chunk-NJGKXKQF.js} +2 -2
- package/dist/chunk-NJQISBL4.js +8 -0
- package/dist/{chunk-T4N4P2K5.js → chunk-NJT3ZEKY.js} +2 -2
- package/dist/{chunk-FPYLNQPT.js → chunk-NKMKZP6A.js} +2 -2
- package/dist/chunk-NODFZ6ED.js +2 -0
- package/dist/{chunk-BRV7PIFF.js → chunk-NSM5IEVW.js} +2 -2
- package/dist/{chunk-3WR4E3A3.js → chunk-NTGUVNR2.js} +2 -2
- package/dist/{chunk-VUPHCS7Y.js → chunk-NU3KFF2O.js} +2 -2
- package/dist/chunk-NWLVNU66.js +557 -0
- package/dist/{chunk-D4N5SQ2M.js → chunk-NYKZMCRC.js} +2 -2
- package/dist/{chunk-VNLGKHS6.js → chunk-O6BUXZEH.js} +2 -2
- package/dist/chunk-ODPDP7A4.js +3 -0
- package/dist/{chunk-JTQVMR42.js → chunk-OHIV323X.js} +2 -2
- package/dist/chunk-OIAPEKMT.js +3 -0
- package/dist/chunk-OIOC5EHF.js +3 -0
- package/dist/{chunk-YBGKCQIS.js → chunk-ONPPQM4G.js} +2 -2
- package/dist/{chunk-64BFSI5I.js → chunk-OUHEZBYI.js} +2 -2
- package/dist/{chunk-L6PJPETJ.js → chunk-OVGYW7UD.js} +2 -2
- package/dist/{chunk-I55I7XXP.js → chunk-OYKU4B3Y.js} +2 -2
- package/dist/{chunk-J66VOFW6.js → chunk-POBJ6FR2.js} +2 -2
- package/dist/{chunk-CWFP7GM5.js → chunk-PSZPMMWN.js} +2 -2
- package/dist/chunk-PXTRBKRK.js +3 -0
- package/dist/{chunk-HKGFPJ4T.js → chunk-Q5JRIHT3.js} +2 -2
- package/dist/{chunk-P42EIXTA.js → chunk-Q7ATHARX.js} +2 -2
- package/dist/{chunk-JYR66JN5.js → chunk-Q7CSKIDM.js} +2 -2
- package/dist/{chunk-TRNAEQ6P.js → chunk-QBQE7ZJ5.js} +2 -2
- package/dist/{chunk-DULC3QFP.js → chunk-QH22UIXP.js} +2 -2
- package/dist/chunk-QXCKQTKR.js +60 -0
- package/dist/{chunk-ODDUPDP7.js → chunk-RBAD4GJ2.js} +5 -5
- package/dist/{chunk-IZDPJ2QI.js → chunk-RMDPFPNW.js} +2 -2
- package/dist/chunk-ROPJDEJZ.js +4 -0
- package/dist/{chunk-EKV5HX33.js → chunk-RVZC6TJE.js} +2 -2
- package/dist/{chunk-XFA4SSO3.js → chunk-S4QZBKSR.js} +2 -2
- package/dist/{chunk-D2DHWI3D.js → chunk-SCPMZ73U.js} +2 -2
- package/dist/{chunk-PZL5T7SU.js → chunk-SIAP5RGI.js} +2 -2
- package/dist/{chunk-7IWV2EG3.js → chunk-SIX4RFR3.js} +2 -2
- package/dist/{chunk-DYGHBZ2N.js → chunk-SKKXTABJ.js} +2 -2
- package/dist/{chunk-F7DY272B.js → chunk-SSRFUQBD.js} +2 -2
- package/dist/chunk-SYVJEEUJ.js +3 -0
- package/dist/{chunk-FGA2U4OR.js → chunk-T3CZAZSI.js} +2 -2
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/{chunk-EQHFIL6T.js → chunk-T6DWDI5E.js} +2 -2
- package/dist/chunk-T6HRIROJ.js +7 -0
- package/dist/{chunk-GSP44ENC.js → chunk-TAA7HXHE.js} +2 -2
- package/dist/{chunk-BQGB4HBD.js → chunk-TJ2JQYT3.js} +2 -2
- package/dist/{chunk-XPDPNWTQ.js → chunk-TULNMD5T.js} +19 -19
- package/dist/chunk-U2FPY5XA.js +3 -0
- package/dist/chunk-U3SXIMII.js +38 -0
- package/dist/{chunk-NOGJXYFO.js → chunk-U6KCHXJ4.js} +2 -2
- package/dist/chunk-UH3XSKS5.js +9 -0
- package/dist/{chunk-AFHTBORT.js → chunk-UIFUZVCC.js} +2 -2
- package/dist/{chunk-7BWFZPPZ.js → chunk-UXKURIVI.js} +2 -2
- package/dist/{chunk-2E7CX53V.js → chunk-V2RBODHL.js} +2 -2
- package/dist/{chunk-KLFEXGQA.js → chunk-VBKUWB6N.js} +2 -2
- package/dist/{chunk-WUN6KBHV.js → chunk-VBV6ALJE.js} +2 -2
- package/dist/{chunk-GZIUDL6G.js → chunk-VDGFWCQV.js} +2 -2
- package/dist/chunk-VDSDOEWF.js +2 -0
- package/dist/{chunk-WDNVY4E7.js → chunk-VZPWVCLN.js} +2 -2
- package/dist/chunk-WDSFQDPN.js +2 -0
- package/dist/{chunk-CIYLO6SI.js → chunk-WFA35BGR.js} +2 -2
- package/dist/{chunk-LMZ5PRUV.js → chunk-WLMP3OCW.js} +2 -2
- package/dist/{chunk-3SVF22I5.js → chunk-WSA52GOR.js} +2 -2
- package/dist/{chunk-VMPRET3I.js → chunk-X3YVZAKZ.js} +2 -2
- package/dist/{chunk-GYIZ4NXB.js → chunk-X6OGVFIT.js} +2 -2
- package/dist/{chunk-6HFCYNYE.js → chunk-XKXTR6ZI.js} +2 -2
- package/dist/{chunk-6VVV4WRR.js → chunk-Y5DFAW5W.js} +2 -2
- package/dist/chunk-YSYPDRD5.js +3 -0
- package/dist/{chunk-TQPCBMWT.js → chunk-ZFVPWH62.js} +2 -2
- package/dist/chunk-ZGIHTH27.js +2 -0
- package/dist/{chunk-OR2E3AGZ.js → chunk-ZGIQN2SX.js} +2 -2
- package/dist/{chunk-WNTFFKAX.js → chunk-ZHG4WAHR.js} +2 -2
- package/dist/{chunk-DTZCKZEU.js → chunk-ZKB2XUEN.js} +2 -2
- package/dist/chunk-ZLMXIQLC.js +21 -0
- package/dist/chunk-ZMCQIHI4.js +2 -0
- package/dist/cli-main.js +2 -2
- package/dist/code-TAVIKWJI.js +2 -0
- package/dist/code-result-json-5FEFQCAQ.js +2 -0
- package/dist/{command-descriptors-P34VABY5.js → command-descriptors-7BKH53Y3.js} +124 -124
- package/dist/dataflow-GFBTVDH3.js +2 -0
- package/dist/dependence-slice-GWGQCODG.js +2 -0
- package/dist/deps-4QHVDPYA.js +2 -0
- package/dist/direct-navigation-4UBC6HNW.js +3 -0
- package/dist/entry-map-QCTF4RVY.js +2 -0
- package/dist/files-M2UBF5HJ.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
- package/dist/hierarchy-2UIHRLW4.js +2 -0
- package/dist/imports-WIE3YZOB.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/members-YKD636DA.js +2 -0
- package/dist/methods-VDF4IMYG.js +2 -0
- package/dist/output-continuation-command-4UMDOOLO.js +3 -0
- package/dist/output-pagination-2GME6OPY.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-XEQTRCV5.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -0
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +28 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +50 -23
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +4 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +7 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +22 -6
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +16 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +2 -2
- package/dist/refs-JNK5CLM7.js +2 -0
- package/dist/refs-pagination-6BLRYGMV.js +2 -0
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.js +18 -18
- 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/slice-PHPVNCWX.js +2 -0
- package/dist/surface-MQX5MPIV.js +2 -0
- package/dist/{symbol-resolution-WD5EU5JE.js → symbol-resolution-DBLVXLBC.js} +2 -2
- package/dist/system-JOPKV4OG.js +2 -0
- package/dist/trace-I2P2YFH4.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-JJVMF7NP.js +2 -0
- package/dist/watch-server.js +3 -3
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/DETECTOR_GUIDE.md +51 -12
- package/docs/accuracy-audit-checklist.md +36 -13
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +2 -2
- package/skills/conductor/SKILL.md +110 -0
- package/skills/conductor/agents/openai.yaml +4 -0
- package/skills/principal-maintainability-review/SKILL.md +273 -0
- package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
- package/skills/scip-calibrate/SKILL.md +102 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-claim-audit/SKILL.md +113 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-probe-reachability/SKILL.md +93 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-root-cause/SKILL.md +160 -0
- package/skills/scip-root-cause/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/SKILL.md +252 -0
- package/skills/scip-system-compression/agents/openai.yaml +4 -0
- package/skills/scip-system-compression/references/compression-atlas.md +116 -0
- package/skills/scip-system-compression/references/compression-patterns.md +87 -0
- package/skills/scip-twin-drift/SKILL.md +109 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-GAS2LJMP.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
package/dist/chunk-KYSDI3GE.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{f as Ue,h as V,k as qe,m as Y,n as X,o as fe}from"./chunk-7F45LJKI.js";import{isAbsolute as Je,relative as rn}from"path";var g=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function de(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function li(e){return e.replace(/\\/g,"/")}function pi(e,t){return de(e)===de(t)}function j(e,t){let n=rn(e,t);return n===""||!n.startsWith("..")&&!Je(n)}function I(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=de(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}import{createHash as Ze,randomUUID as dn}from"crypto";import{chmodSync as et,existsSync as _,linkSync as gn,lstatSync as te,readdirSync as he,realpathSync as C,unlinkSync as hn,writeSync as mn}from"fs";import{homedir as yn}from"os";import{basename as Sn,dirname as ne,isAbsolute as Xe,join as y,resolve as re}from"path";import{closeSync as on,existsSync as sn,fsyncSync as cn,mkdirSync as an,openSync as un}from"fs";import{dirname as Ke}from"path";var M=Object.freeze({platform:process.platform,pathExists:e=>sn(e),makeDirectory:e=>an(e,{recursive:!0}),openFile:(e,t,n)=>un(e,t,n),syncFile:e=>cn(e),closeFile:e=>on(e)});function Ve(e,t=M){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Ke(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=Z(i,Q(Ke(o),t));return i}function Q(e,t=M){let n;try{n=t.openFile(e,"r")}catch(r){if(fe(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(fe(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function Z(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as ln}from"module";var pn=ln(import.meta.url),Ye=fn().version;function fn(){for(let e of["../package.json","../../package.json"])try{return pn(e)}catch{}return{version:"0.0.0"}}var tt=1,W=".scip-query-cache-owner.json",jn=16*1024,nt=Object.freeze({...M,randomToken:()=>dn(),linkFile:(e,t)=>gn(e,t),removeFile:e=>hn(e),writeFile:(e,t,n,r)=>mn(e,t,n,r)});function ee(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function F(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function bn(e,t){let n=C(e);return xn(n,me(n,t))}function me(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?re(r):t?.dbPath?Fn(n,t.dbPath):Pn(n)}function rt(){let e=process.env.XDG_CACHE_HOME;return y(e||y(yn(),".cache"),"scip-query")}function Pn(e){let t=re(e);try{t=C(t)}catch{}let n=Ze("sha256").update(t).digest("hex").slice(0,12);return y(rt(),"projects",n)}function Ei(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(rt(),"repositories",e);return st(t),C(t)}function vi(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function Ri(e,t){let n=bn(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function xn(e,t,n=nt){return Cn(e,t,n).cacheDir}function Cn(e,t,n=nt){let r=C(e),i=_(t)?"synced":st(t,n),o=C(t),s=y(o,W);if(_(s))return ge(r,o),ye(s),z(o),{kind:"existing",cacheDir:o};Qe(o),vn(o),Qe(o);let a=`${JSON.stringify({schemaVersion:tt,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Ye},null,2)}
|
|
2
|
-
`;try{let u=Rn(s,a,n),p=Z(i,u);return{kind:"published",cacheDir:o,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}catch(u){if(On(u))return ge(r,o),{kind:"existing",cacheDir:o};throw u}}function ge(e,t){let n=C(e),r=C(t);return kn(r,n,r)}function Ti(e,t){return _(y(t,W))?(ge(e,t),it(t),!0):!1}function Fn(e,t){let n;try{n=I(t)}catch(s){throw s instanceof g?ee(t,s.reason):s}let r=re(e,...n.split("/"));if(r===e||!j(e,r))throw ee(t,"outside-project");let i=wn(r),o=C(i);if(!j(e,o)&&o!==e)throw ee(t,"symlink-escape");return r}function wn(e){let t=e;for(;!_(t);){let n=ne(t);if(n===t)throw ee(e,"no-existing-ancestor");t=n}return t}function kn(e,t,n){let r=y(e,W);if(!_(r)||te(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=te(r);if(!i.isFile()||i.size>jn)throw F(e,"invalid ownership record file");let o=V(r,"cache ownership record"),s=In(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw F(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw F(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Ze("sha256").update(o).digest("hex"),physicalCacheDir:e}}function In(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==tt||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Xe(n.canonicalProjectRoot)||!Xe(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw F(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Qe(e){let t=he(e).filter(n=>n!==W&&!En(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function En(e){return e.startsWith(`${W}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function vn(e){for(let t of he(e)){let n=y(e,t);try{let r=te(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())z(n);else if(r.isFile())ye(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(ot(r))continue;throw r}}z(e)}function it(e,t=!1){try{let n=te(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){ye(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");z(e);for(let r of he(e))it(y(e,r),!0)}catch(n){if(t&&ot(n))return;throw n}}function ot(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function st(e,t=M){let n=Ve(e,t);return z(e),n}function Rn(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,X(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=Q(ne(e),n);return n.removeFile(r),o=!1,Z(s,Q(ne(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function z(e){process.platform!=="win32"&&et(e,448)}function ye(e){process.platform!=="win32"&&et(e,384)}function Tn(e){if(_(e))return C(e);let t=C(ne(e));return y(t,Sn(e))}function Oi(e){return Tn(re(e))}function On(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as _n}from"child_process";import{createHash as Ln}from"crypto";import{existsSync as Nn,lstatSync as Gn,realpathSync as An}from"fs";import{dirname as Bn,isAbsolute as Mn,join as zn,relative as Bi,resolve as oe,sep as Mi}from"path";var ct=Symbol.for("scip-query.project-file-listing-context.v1"),at=globalThis,Se=at[ct],E=Se&&typeof Se=="object"?Se:{};at[ct]=E;function ut(e,t){let n=E.active?E.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function lt(){return E.sequence??0}function pt(e,t,n){let r=E.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Dn(n(),(E.sequence??0)+1);if(E.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function ft(e,t){let n=E.active?.get(e);return n&&n.sequence>t?n.indexAllowsTreeFingerprintReuse:void 0}function*dt(e){let t=0;for(;t<e.taggedOutput.length;){let n=e.taggedOutput.indexOf("\0",t);if(n<0)return;yield e.taggedOutput.slice(t+2,n),t=n+1}}function Dn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var v={run(e,t){let n=ht(e,t);return n.kind==="success"?n.output:void 0},runResult:ht},Wn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Pe=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],je=/^[0-9a-f]{40,64}$/;function Wi(e,t=v){return Hn(e,t)?.context}function Hn(e,t=v){let n=t.runResult(e,Wn);if(n.kind==="success"){let i=$n(n.output);if(i){let o=Un(i,t);if(o)return gt(o)}}let r=qn(e,t);return r?gt(r):void 0}function Hi(e,t=v){if(!e.headCommit)return;let n=t.run(e.projectRoot,Pe);if(n===void 0)return;let r=xe(n);if(!(!r?.headCommit||r.headCommit!==e.headCommit))return{...e,clean:r.clean}}function $i(e,t=v,n={}){let r=t===v&&n.cachedInventoryAfterSequence!==void 0?ft(e,n.cachedInventoryAfterSequence):void 0;if(r!==void 0)return r;let i=t.run(e,["ls-files","-v","-z"]);return i===void 0?!1:i.split("\0").filter(Boolean).every(o=>o.startsWith("H "))}function gt(e){return{context:e,projectFileInventorySequence:lt()}}function xe(e){let t=e.split("\0").filter(Boolean),n=t.find(i=>i.startsWith("# branch.oid "))?.slice(13),r=n==="(initial)"?void 0:n;if(!(r!==void 0&&!je.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function $n(e){let t=e.split(`
|
|
3
|
-
`).map(a=>a.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!je.test(o)||!je.test(s))return;let c=w(n);return{root:c,gitDir:w(ie(c,r)),commonDir:w(ie(c,i)),headCommit:o,treeOid:s}}function Un(e,t){let n=t.run(e.root,Pe);if(n===void 0)return;let r=xe(n);return r?.headCommit!==e.headCommit?void 0:{...mt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Ce("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function qn(e,t){let n=Jn(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=w(ie(i,o)),c=be(t.run(i,["rev-parse","--verify","HEAD"])),a=be(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,Pe);if(u===void 0)return;let p=xe(u);if(!(!p||p.headCommit!==c))return{...r,commonDir:s,repositoryId:Ce("repository",s),headCommit:c,treeOid:a,clean:p.clean}}function Jn(e,t=v){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=w(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=w(ie(i,o));return{kind:"worktree",identity:mt(i,s)}}function mt(e,t){return{projectRoot:e,gitDir:t,worktreeId:Ce("worktree",`${e}\0${t}`)}}function Ui(e,t=v){let n=t.run(e,["worktree","list","--porcelain","-z"]);return n===void 0?[]:Kn(n)}function Kn(e){let t=[],n;for(let r of e.split("\0")){if(r===""){n&&t.push(n),n=void 0;continue}let i=r.indexOf(" "),o=i<0?r:r.slice(0,i),s=i<0?"":r.slice(i+1);if(o==="worktree"){n&&t.push(n),n={path:w(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}n&&(o==="HEAD"?n.head=s:o==="branch"?n.branch=s:o==="detached"?n.detached=!0:o==="bare"?n.bare=!0:o==="prunable"?n.prunable=!0:o==="locked"&&(n.locked=!0))}return n&&t.push(n),t}function qi(e,t,n=v){return be(n.run(e,t))}function ie(e,t){return Mn(t)?t:oe(e,t)}function w(e){try{return An(e)}catch{return oe(e)}}function Ce(e,t){return Ln("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function be(e){return e?.trim()||void 0}function ht(e,t){let n=_n("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(n.status===0)return{kind:"success",output:n.stdout.trimEnd()};let i=(typeof n.stderr=="string"?n.stderr.trim():"")||n.error?.message||`git exited with status ${n.status??"unknown"}`,o=n.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&Nn(oe(e)))&&!Vn(e)?{kind:"not-repository"}:{kind:"error",message:i}}function Vn(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=oe(e);for(;;){try{return Gn(zn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Bn(t);if(n===t)return!1;t=n}}import{execFileSync as Gr}from"child_process";import{isUtf8 as Yt}from"buffer";import{createHash as Ge}from"crypto";import{closeSync as Zt,fstatSync as $,lstatSync as Be,openSync as en,readdirSync as Ar,readFileSync as Br,readSync as Xt,readlinkSync as Mr,realpathSync as q}from"fs";import{isAbsolute as zr,join as Me,relative as Wr,resolve as Hr,sep as $r}from"path";function ce(e,t,n=[]){let r=Fe(e);if(Ct.has(r)||n.some(o=>se(r,o))||t.some(o=>Ft(r,o)))return"config";if(t.some(kt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=wt(r);return t.some(o=>(It[o]??[]).includes(i))?"source":"other"}function xt(e,t,n){let r=Fe(e);if(Ct.has(r)||n?.some(o=>se(r,o))||Ft(r,t)||kt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=wt(r);return(It[t]??[]).includes(i)}function Ki(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!St(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!St(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(Yn)?null:t}function yt(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function Vi(e,t){return!e||!t?e===t:JSON.stringify(yt(e))===JSON.stringify(yt(t))}function Yi(e,t){let n=new Map((e?.files??[]).map(c=>[c.path,c])),r=new Map(t.files.map(c=>[c.path,c])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let c of[...i].sort()){let a=n.get(c),u=r.get(c),p=ce(c,t.languages);!a&&u?o.push({kind:"added",path:c,inputKind:p,after:u}):a&&!u?o.push({kind:"deleted",path:c,inputKind:p,before:a}):a&&u&&(a.hash!==u.hash||a.size!==u.size)&&o.push({kind:"modified",path:c,inputKind:p,before:a,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(jt(e?.files??[])||jt(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Xn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Qn(e,t):!0,uncertainty:[...s].sort()}}function St(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function jt(e){return new Set(e.map(t=>t.path)).size!==e.length}function Yn(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function Xn(e){return e.hash==="unreadable"||e.size<0}function Qn(e,t){return bt(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&bt(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function bt(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((i,o)=>i===r[o])}var Ct=new Set([".scipquery.json"]),Zn={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},er={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Pt=new Map;function Ft(e,t){return Zn[t].some(n=>se(e,n))||er[t].some(n=>se(e,n))}function se(e,t){let n=Fe(t).replace(/^\.\//,"");if(!n)return!1;let r=e.split("/").at(-1)??e,i=n.includes("/")?e:r;if(!n.includes("*")&&!n.includes("?"))return i===n;let o=Pt.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Pt.set(n,o)}return o.test(i)}function Fe(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function wt(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function kt(e){return e==="typescript"||e==="javascript"}var It={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{AsyncLocalStorage as tr}from"async_hooks";var nr=new tr;function R(e,t){let n=ae(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function T(e,t){let n=ae(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Et(e,t){return ae(e)?.fingerprints.get(t)}function O(e){return ae(e)?.paths}function ae(e){let t=nr.getStore();if(t)return t.projectRoot===w(e)?t:void 0}import{createRequire as rr}from"module";import{existsSync as ir,lstatSync as vt,readdirSync as or,statSync as sr}from"fs";import f from"path";var cr=rr(import.meta.url),Rt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),ar=18003;function ue(e,t=[]){let n=f.resolve(e),r=t.flatMap(a=>pr(n,a));if(r.length>0)return Tt(n,Dt(r));let i=lr(n),o=Dt(i),s=fr(n,o)?[n,...o]:o,c=s.length>0?s:[n];return Tt(n,c)}function _t(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Lt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var ur=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function co(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function Nt(e){return ur.test(e)}function Gt(e,t,n=[]){let r;try{r=cr("@ts-morph/common/dist/typescript.js")}catch{return null}let i=f.resolve(e),o=t==="workspace"?ue(i,n):["."],s=new Set;for(let c of o){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json"),p=gr(r,i);if(!p.fileExists(u))return null;let l=r.readConfigFile(u,p.readFile);if(l.error)return null;let d=r.parseJsonConfigFileContent(l.config,p,a);if(d.errors.some(m=>m.code!==ar))return null;for(let m of d.fileNames){let h=f.resolve(m);j(i,h)&&s.add(f.relative(i,h).split(f.sep).join("/"))}}return s}function ao(e,t,n,r){let i=f.resolve(e),o=new Set(r);for(let c of n){let a=f.resolve(i,c);if(j(i,a))try{let u=vt(a);if(u.isSymbolicLink()||u.isFile()&&!o.has(D(i,a)))return!1}catch{}}let s=t==="workspace"?ue(i,n):["."];for(let c of s){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json");if(!Bt(i,u))continue;let p=D(i,u);if(!o.has(p))return!1;try{if(vt(u).isSymbolicLink())return!1;let l=Mt(i,u);if(l.includes("extends")||l.includes("\\"))return!1}catch{return!1}}return!0}function Tt(e,t){return[...new Set(t.map(n=>D(e,n)))].sort((n,r)=>n.localeCompare(r))}function lr(e){let t=O(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>Rt.has(s)))return[];let o=f.join(e,...i.split("/"));return Ot(e,o)?[f.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=or(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=f.join(i,s.name);if(s.isDirectory()){!Rt.has(s.name)&&!s.name.startsWith(".")&&r.push(c);continue}s.isFile()&&Ot(e,c)&&n.push(f.dirname(c))}}return n}function pr(e,t){let n=t.trim();if(!n)return[];let r=f.resolve(e,n);if(!j(e,r))return[];let i=O(e);if(i){let o=D(e,r);if(i.includes(o)&&we(f.basename(r)))return[f.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(c=>c.startsWith(s))?[r]:[]}try{let o=sr(r);if(o.isDirectory())return[r];if(o.isFile()&&we(f.basename(r)))return[f.dirname(r)]}catch{return[]}return[]}function Ot(e,t){if(!we(f.basename(t)))return!1;let n=At(e,t);return n?f.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function we(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Dt(e){let t=[...new Set(e.map(n=>f.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&mr(n,r)))}function fr(e,t){if(t.length===0||t.some(r=>f.resolve(r)===e))return!1;let n=f.join(e,"tsconfig.json");return Bt(e,n)&&dr(e,n)}function dr(e,t){let r=At(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!f.extname(i))):!1}function At(e,t){try{let n=JSON.parse(Mt(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Bt(e,t){let n=D(e,t),r=T(e,n);return r?r==="present":ir(t)}function Mt(e,t){let n=D(e,t);if(O(e)){let i=R(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return V(t,"TypeScript project config")}function gr(e,t){let n=O(t);if(!n)return e.sys;let r=f.resolve(t),i=new Set(n),o=hr(r,n),s=e,c=a=>{let u=f.resolve(a);return j(r,u)?D(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(a){let u=c(a);return u===null?e.sys.fileExists(a):i.has(u)},readFile(a){let u=c(a);return u===null?e.sys.readFile(a):R(r,u)?.content.toString("utf8")},readDirectory(a,u,p,l,d){let m=f.resolve(a);return j(r,m)?s.matchFiles(m,u,p,l,e.sys.useCaseSensitiveFileNames,r,d,h=>o.get(f.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(a,u,p,l,d)}}}function hr(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),c=e;for(let a=0;a<s.length-1;a+=1){let u=s[a];i(c),r.get(c).add(u),c=f.join(c,u),i(c)}n.get(c).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function D(e,t){let n=f.relative(e,t);return n?n.split(f.sep).join("/"):"."}function mr(e,t){let n=f.relative(e,t);return!!n&&!n.startsWith("..")&&!f.isAbsolute(n)}import{createHash as Ee}from"crypto";import{execFileSync as zt}from"child_process";import{createRequire as yr}from"module";var Sr=yr(import.meta.url),jr=/\.(?:[cm]?[jt]sx?)$/iu,br=/\.[jt]sx$/iu,Wt=/(?:^|\/)package\.json$/iu,H,ke=new Map;function Ht(e,t){if(!ve(e))return;let n=Pr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=br.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Ee("sha256").update(`typescript-semantic-v1\0${i}\0`),c=!1,a=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){c&&(a=!0);continue}a&&s.update("line-break\0");let p=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(p)}\0`).update(p).update("\0"),c=!0,a=!1}return s.digest("hex")}catch{return}}function ve(e){return jr.test(e)}function Re(e,t){if(Wt.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return Ee("sha256").update("typescript-package-json-v1\0").update(Ie(i)).digest("hex")}catch{return}}function Te(e){return Wt.test(e)}function go(e,t,n){if(!Te(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(ke.has(r))return ke.get(r);let i;try{let o=zt("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let c=zt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Ee("sha256").update(c).digest("hex")===n){i=Re(t,c);break}}}catch{i=void 0}return ke.set(r,i),i}function Pr(){if(H!==void 0)return H;try{H=Sr("typescript")}catch{H=null}return H}function Ie(e){return Array.isArray(e)?`[${e.map(Ie).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${Ie(n)}`).join(",")}}`:JSON.stringify(e)}import{closeSync as $t,existsSync as De,openSync as xr,realpathSync as Cr,renameSync as Fr,unlinkSync as Ut,writeSync as wr}from"fs";import{dirname as kr,join as Ir}from"path";var Er="fingerprint-stat-cache.json",qt=1,vr=8*1024*1024,Oe=new Map;function _e(e,t,n,r){let i=Jt(e),o=i.files.get(t);if(!(!o||!Kt(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function Le(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=Jt(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},c=o.files.get(t);c&&Lr(c,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Ne(e){let t=Oe.get(Vt(e));if(!(!t?.dirty||!t.cachePath))try{let n=kr(t.cachePath);if(!De(n))return;Nr(t.cachePath,Or(t)),t.dirty=!1}catch{}}function Jt(e){let t=Vt(e),n=Oe.get(t);if(n)return n;let r=Rr(t),i=Tr(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return Oe.set(t,o),o}function Rr(e){try{let t=me(e);return De(t)?Ir(t,Er):null}catch{return null}}function Tr(e){let t=new Map;if(!e||!De(e))return t;try{let n=JSON.parse(Ue(e,{inputKind:"fingerprint stat cache",maxBytes:vr}).toString("utf8"));if(!Dr(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function Or(e){return{version:qt,files:Object.fromEntries(e.files)}}function Dr(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==qt||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(_r)}function _r(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function Kt(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function Lr(e,t){return Kt(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function Nr(e,t){let n=`${e}.${process.pid}.tmp`;try{Ut(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
|
|
4
|
-
`,"utf8"),i=xr(n,"wx",384);try{X(i,r,{writeFile:(o,s,c,a)=>wr(o,s,c,a)},"fingerprint stat cache")}catch(o){throw $t(i),Ut(n),o}$t(i),Fr(n,e)}function Vt(e){return Cr(e)}var J=64*1024*1024,Ur=1024*1024,qr=1024,L=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Jr(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function ze(e,t,n={}){let r=I(t),i=ut(e,()=>q(e)),o=Hr(i,...r.split("/"));if(!j(i,o)||o===i)throw new g(t,"outside-project");let s=q(o);if(!j(i,s)||s===i)throw new g(t,"outside-project");let c=Be(s);if(!c.isFile())throw new g(t,"not-a-file");let a={projectRoot:i,relativePath:r,absolutePath:s,size:c.size,mtimeMs:c.mtimeMs,device:c.dev,inode:c.ino},u=n.maxBytes??J;if(Y(u),a.size>u)throw new L(n.inputKind??"project file",a.relativePath,a.size,u);return a}function Kr(e,t,n={}){let r=I(t),i=T(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let a=R(e,r);if(!a)throw new g(r,"changed-during-read");let u=n.maxBytes??J;if(Y(u),a.size>u)throw new L(n.inputKind??"project file",r,a.size,u);return Buffer.from(a.content)}let o=ze(e,t,n),s=n.maxBytes??J,c=en(o.absolutePath,"r");try{let a=$(c);if(U(a,o,t),a.size>s)throw new L(n.inputKind??"project file",o.relativePath,a.size,s);let u=Br(c),p=$(c);if(U(p,o,t),u.byteLength!==a.size)throw new g(t,"changed-during-read");return u}finally{Zt(c)}}function Lo(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Vr(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Vr(e,t,n,r={}){if(n.length===0||n.some(a=>a.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=I(t),o=T(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let a=R(e,i);if(!a)throw new g(i,"changed-during-read");let u=r.maxBytes??J;if(Y(u),a.size>u)throw new L(r.inputKind??"project file",i,a.size,u);let p=!a.content.includes(0)&&Yt(a.content),l=n.map(Qt),d=p?Xr(a.content,n,l):[];return{byteLength:a.size,isUtf8Text:p,matchedLiteralIndexes:d,bytes:d.length>0?Buffer.from(a.content):null,...r.computeSha256?{sha256:a.sha256}:{}}}let s=ze(e,t,r),c=en(s.absolutePath,"r");try{let a=$(c);U(a,s,t);let u=r.computeSha256?Ge("sha256"):null,p=r.scratchBuffer??Buffer.allocUnsafe(Ur);if(p.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let l=0,d=n.map(()=>!1),m=!1,h=!0,b=Buffer.alloc(0),K=n.map(()=>Buffer.alloc(0)),N=n.map(Qt);for(;l<a.size;){let P=Xt(c,p,0,Math.min(p.byteLength,a.size-l),l);if(P<=0)throw new g(t,"changed-during-read");let x=p.subarray(0,P);if(u?.update(x),m||=x.includes(0),h){let S=b.byteLength>0?Buffer.concat([b,x]):x,B=Yr(S);h=Yt(S.subarray(0,B)),b=Buffer.from(S.subarray(B))}for(let S=0;S<n.length;S+=1){if(d[S])continue;let B=n[S],$e=K[S];d[S]=Qr(x,B,$e,N[S]),K[S]=Zr(x,B,$e)}l+=P}h&&=b.byteLength===0,U($(c),s,t);let G=!m&&h,A=G?d.flatMap((P,x)=>P?[x]:[]):[],k=null;if(A.length>0){k=Buffer.allocUnsafe(a.size);let P=0;for(;P<k.byteLength;){let x=Xt(c,k,P,k.byteLength-P,P);if(x<=0)throw new g(t,"changed-during-read");P+=x}U($(c),s,t)}return{byteLength:a.size,isUtf8Text:G,matchedLiteralIndexes:A,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{Zt(c)}}function No(e,t,n={}){return Kr(e,t,n).toString("utf8")}function U(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new g(n,"changed-during-read")}function Yr(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function Xr(e,t,n){return t.flatMap((r,i)=>Ae(e,r,n[i])?[i]:[])}function Qr(e,t,n,r){if(Ae(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return Ae(Buffer.concat([n,i]),t,r)}function Ae(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>qr)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function Qt(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Zr(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function We(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Go(e,t){try{return ze(e,t),!0}catch(n){if(We(n))return!1;throw n}}function ei(e){let t=O(e);return t?t.filter(n=>n&&!pe(n)).sort():(si(e)??ci(e)).filter(n=>n&&!pe(n)).sort()}function ti(e,t={}){let n=(t.includePaths??[]).map(I),r=[...new Set([...ei(e),...n])].filter(s=>!pe(s)).filter(s=>!t.language||xt(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,c)=>s.localeCompare(c)),i=q(e),o=r.flatMap(s=>tn(e,i,s));return Ne(i),o}function tn(e,t,n){let r=Et(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(T(e,n)==="present"){let o=R(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=Me(e,n);try{let o=Be(i);if(o.isSymbolicLink()){let b=_e(t,n,"symlink",le(o));if(b)return[{path:n,size:b.size,hash:b.hash}];let K=q(i),N=Wr(t,K);if(N===".."||N.startsWith(`..${$r}`)||zr(N))throw new Error("external symlink");let G=Mr(i),A=Ge("sha256").update("symlink\0").update(G).digest("hex"),k=Buffer.byteLength(G);return Le(t,n,"symlink",le(o),{hash:A,size:k}),[{path:n,size:k,hash:A}]}let s=ve(n)||Te(n),c=_e(t,n,"file",le(o));if(c&&(!s||c.semanticHash!==void 0))return[{path:n,size:c.size,hash:c.hash,...c.semanticHash===void 0?{}:{semanticHash:c.semanticHash}}];let a=Ge("sha256"),u=s,p=[],l=qe(i,{inputKind:"project fingerprint input",maxBytes:J},b=>{a.update(b),u&&p.push(Buffer.from(b))}),d=a.digest("hex"),m=u?Buffer.concat(p,l):void 0,h=m?Ht(n,m)??Re(n,m):void 0;return Le(t,n,"file",le(o),{hash:d,size:l,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:l,hash:d,...h===void 0?{}:{semanticHash:h}}]}catch(o){return We(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function le(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function nn(e,t,n){let r=He(t,n),i=[...r.typescriptProjects.filter(a=>ii(e,a)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Gt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?ue(e,r.typescriptProjects):["."]:[],c=_t(s);return{...r,files:ti(e,{includePath:a=>{if(a===".scipquery.json")return!1;let u=ce(a,t,i);return u==="other"||u==="config"&&Lt(a)&&!c.has(a)?!1:u!=="source"||!ri(a)||!o?!0:o.has(a)},includePaths:i})}}function Ao(e,t){let n=new Set(t.files.map(o=>o.path)),r=nn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...He(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Bo(e,t,n,r,i,o){let s=l=>({mode:"full",fingerprint:nn(e,t,n),reason:l});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let c=He(t,n);if(!ni(r,c))return s("project-input-configuration-changed");if(new Set(r.files.map(l=>l.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...c,files:[...r.files].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:[]};let a=[...c.typescriptProjects,...c.clojureConfigPath?[c.clojureConfigPath]:[]],u=new Map(r.files.map(l=>[l.path,l]));for(let l of i.entries){let d=u.get(l.path);if(ce(l.path,t,a)!=="source")return s("non-source-project-input-changed");if(l.kind==="add"&&d)return s("added-path-already-in-prior-project-input-snapshot");if(l.kind==="delete"&&!d)return s("deleted-path-not-in-prior-project-input-snapshot");if(l.kind==="change"&&!d)return s("changed-path-not-in-prior-project-input-snapshot");if(d&&(d.hash==="unreadable"||d.size<0))return s("changed-path-was-unreadable")}let p=q(e);for(let l of i.entries){let d=tn(e,p,l.path);if(l.kind==="delete"){if(d.length!==0)return s("deleted-source-is-still-readable");u.delete(l.path);continue}if(d.length!==1||d[0].hash==="unreadable"||d[0].size<0)return s(l.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(l.path,d[0])}return Ne(p),{mode:"delta",fingerprint:{...c,files:[...u.values()].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:i.entries.map(l=>l.path).sort()}}function ni(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ri(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function ii(e,t){let n;try{n=I(t)}catch{return!1}let r=T(e,n);if(r)return r==="present";try{return Be(Me(e,n)).isFile()}catch(i){if(We(i))return!1;throw i}}function He(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Jr(t.typescriptProjects),clojureConfigPath:oi(t.clojureConfigPath)}}function oi(e){return e?.trim()||void 0}function si(e){try{let t=pt(e,52428800,()=>Gr("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...dt(t)]}catch{return null}}function ci(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?Me(e,r):e,o;try{o=Ar(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){pe(c)||n.push(c);continue}t.push(c)}}return t}function pe(e){let t=e.split("/");return e==="meta.json"||Nt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>ai.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ai=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{ce as a,xt as b,Ki as c,yt as d,Vi as e,Yi as f,Yn as g,Zn as h,M as i,Ve as j,Q as k,Z as l,g as m,de as n,li as o,pi as p,j as q,I as r,Ye as s,me as t,rt as u,Pn as v,Ei as w,vi as x,Ri as y,Ti as z,Oi as A,go as B,pt as C,dt as D,v as E,Wi as F,Hi as G,$i as H,Jn as I,Ui as J,qi as K,ie as L,w as M,ue as N,_t as O,Lt as P,co as Q,Nt as R,Gt as S,ao as T,L as U,Jr as V,ze as W,Kr as X,Lo as Y,Vr as Z,No as _,We as $,Go as aa,ei as ba,ti as ca,nn as da,Ao as ea,Bo as fa,He as ga};
|
|
5
|
-
//# sourceMappingURL=chunk-KYSDI3GE.js.map
|
package/dist/chunk-LDVT66YM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as le}from"./chunk-JTQVMR42.js";import{a as de}from"./chunk-QGVTFRY2.js";import{a as pe}from"./chunk-HKGFPJ4T.js";import{a as he}from"./chunk-6YTSKJJ3.js";import{a as ge}from"./chunk-D2DHWI3D.js";import{a as se}from"./chunk-HVF5VBG6.js";import{a as ue}from"./chunk-LMZ5PRUV.js";import{a as ce}from"./chunk-F7DY272B.js";import{a as oe}from"./chunk-FFRKR4EQ.js";import{a as ae}from"./chunk-3JKSW6LJ.js";import{a as ne}from"./chunk-I55I7XXP.js";import{a as me}from"./chunk-PU7T5QYQ.js";import{a as ie}from"./chunk-3PJABJSU.js";import{a as re}from"./chunk-IL676XCC.js";import{a as J}from"./chunk-LQRQN2XA.js";import{b as ee}from"./chunk-4UX2F3JX.js";import{a as Z}from"./chunk-JGKUET5J.js";import{b as te}from"./chunk-XDAUYDFT.js";import{a as M,b as U}from"./chunk-EVFUMY4R.js";import{b as Y}from"./chunk-DHUIOLDT.js";import{a as K}from"./chunk-6HFCYNYE.js";import{a as X}from"./chunk-QU5XRYB5.js";import{f as Q}from"./chunk-TQPCBMWT.js";import{a as W}from"./chunk-GSP44ENC.js";import{f as A,h as T}from"./chunk-XRYABF57.js";import{a as G}from"./chunk-ODDUPDP7.js";import{D as O,z as j}from"./chunk-ZOHS7AQV.js";import{h as k}from"./chunk-FESCRNVV.js";import{Aa as q,Ba as z}from"./chunk-N5B2NILC.js";import{readdirSync as Ye}from"fs";import{basename as Xe,join as fe}from"path";function Qe(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(s=>!i.has(s)).sort(),a=t.allowExtra?[]:[...i].filter(s=>!n.has(s)).sort();return{missing:o,extra:a}}function Je(e,r){let t=Ze(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=ot(e.config.projectRoot,r.mustEqual),n=Qe(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function ve(e,r){return r.map(t=>Je(e,t))}function Ze(e,r,t){return t.type==="markdown-list"?nt(e,r,t.marker):et(e,r,t)}function et(e,r,t){if(!k(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=j(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=O(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?tt(o,t.identifier):it(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function be(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function tt(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type==="object")return rt(n)}return null}function rt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(ye(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function it(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(ye(a.text));return[...o].sort()}return null}function ye(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function nt(e,r,t){let i=k(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=Se(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:xe(n)}}function Se(e,r){let t=G(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function xe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function ot(e,r){switch(r.type){case"top-level-dirs":return Ce(fe(e,r.path));case"file-glob":return[...new Set(W(e,r.pattern).map(t=>Xe(t)))].sort();case"registered-commands":return at(e);case"builtin-skills":return Ce(fe(e,"skills"))}}function Ce(e){let r;try{r=Ye(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function at(e){let r;try{r=q(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!z(i))throw i;return[]}let t=Se(r,"COMMAND REFERENCE");return t?xe(t):[]}function h(e){return e.scoreCount??e.count}function B(e){let r=lt(e),{breakdown:t,pressure:i}=dt(e),n=He(t,"risk"),o=He(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:h(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:h(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:h(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:st(e),validation:ut(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}function st(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ct(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ct(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:p(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ut(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[v,g]of Object.entries(r))i.has(v)?n+=g.fixChanges:(o+=g.fixChanges,a+=1);let s=i.size>0?p(n/i.size):0,l=a>0?p(o/a):0,S={};for(let[v,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let b=0;for(let R of f)b+=r[R]?.fixChanges??0;let x=p(b/f.size);S[v]={flaggedFiles:f.size,fixDensity:x,lift:l>0?p(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?p(s/l):null,byCategory:S,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function p(e){return Math.round(e*100)/100}function Ee(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function E(e,r="existing shared infrastructure discount"){let t=h(e);return Math.abs(t-e.count)<.01?"":` (${Ee(t)} score-weighted after ${r})`}function y(e,r){let t=h(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Ee(t)} score-weighted)`}function lt(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${E(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${E(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} single-consumer symbols${E(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+E({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var we={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function He(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function dt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(d,w,C)=>{w>0&&i.push({axis:d,points:w,detail:C,kind:we[d]??"hygiene"})},a=(d,w,C,je,Oe,We,Ue)=>{let H=Math.max(je,1);if(C<=H)return;let D=C/H,P=Math.min(Oe,Math.ceil(Math.log2(D)*We));if(P<=0)return;let Ke=we[d]??"hygiene";n.push({axis:d,category:w,kind:Ke,count:C,threshold:p(H),ratio:p(D),extraPenalty:P}),o(d,P,`${C} ${Ue} exceed pressure threshold ${p(H)} (${p(D)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let v=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(v*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let g=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(g*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let f=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(f)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let b=h(e.reactHookCandidates),x=b/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(x)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Fe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Fe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let _=h(e.vueComposableCandidates),qe=_/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(qe)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=h(e.wrappers);o("wrappers",Math.min(3,I),y(e.wrappers,"wrapper candidate(s)"));let F=h(e.passthroughs);o("passthroughs",Math.min(3,F),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Ge=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Ge*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(d/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:d},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",d,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",b,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",_,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var m={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as mt}from"v8";var pt=64*1024*1024;function $(){let e=globalThis.gc;if(!e)return;let r=mt();r.heap_size_limit-r.used_heap_size<pt||e()}var ht=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Le(e=new Set(["indexed-graph","source-facts"])){return ht.map(r=>{let t=r.relationRequirements.map(n=>{let o=te(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var gt=50,ft=25e3,Ct=2500,Re=2500,De=50,vt=10,bt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ae={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:xt(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:wt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:Ht(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Et(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:Rt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:Dt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Pt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:kt(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:At(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Tt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Mt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Bt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Lt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:$t(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Vt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Nt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:qt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:zt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:_t(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:It(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ft(e,t)})};function zr(e,r={}){return Te(e,r.full!==!1,(t,i)=>{let n=St(e,r.scope,t,i);return B(n)})}function Gr(e,r,t={}){return yt(e,[r],t)[0]}function yt(e,r,t={}){return Te(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ae[a](e,t.scope,o,i))})}function Te(e,r,t){let i=he(e),n=Gt(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),$()}}function jr(e){return B(Me(e))}function Me(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Le(),dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Pe(e,"git-evidence")?.gitEvidence??null,suppressions:Pe(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Pe(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function St(e,r,t,i){return Me(bt.map(n=>Ae[n](e,r,i,t)))}function xt(e,r,t){return c(e,t,"dead",()=>{let i=U(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Wt(e,i.symbols))})}function wt(e,r,t){return c(e,t,"isolated",()=>{let i=ne(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Ut(e,i))})}function Ht(e,r,t){return c(e,t,"cycles",()=>J(e,{scope:r}).filter(n=>n.kind==="real").length)}function Et(e,r,t){let i=c(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Lt(e,r,t){return c(e,t,"extract-candidates",()=>ie(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function Rt(e,r,t){return c(e,t,"duplicate-bodies",()=>{let i=Z(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i)for(let s of a.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function Dt(e,r,t){return c(e,t,"twin-drift",()=>{let i=ee(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let s of a.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Pt(e,r,t){return c(e,t,"react-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function kt(e,r,t){return c(e,t,"react-hook-candidates",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Yt)})}function At(e,r,t){return c(e,t,"react-large-component-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Kt(i)})}function Tt(e,r,t){return c(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Mt(e,r,t){return c(e,t,"vue-composable-candidates",()=>{let i=ue(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Xt)})}function Bt(e,r,t){return c(e,t,"vue-large-view-pressure",()=>{let i=le(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return L(i)})}function $t(e,r,t){return c(e,t,"wrapper-candidates",()=>{let i=de(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Qt)})}function Vt(e,r,t){return c(e,t,"passthrough-candidates",()=>{let i=me(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Jt)})}function Nt(e,r,t){return c(e,t,"stale-abstractions",()=>{let i=pe(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function _t(e,r){return c(e,r,"git-evidence",()=>{let t=K(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=Y(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,l]of i)a[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:N(o.findings.reduce((s,l)=>s+ke(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:ke(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function It(e,r){return c(e,r,"suppressions",()=>{let t=ge(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ft(e,r){return c(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=ve(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function qt(e,r,t){return c(e,t,"drift",()=>{let i=re(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function zt(e,r,t){return c(e,t,"complexity-hotspots",()=>{let i=X(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>gt).length}})}function Gt(e,r){let t=e.symbols>=ft||e.documents>=Ct,i=r?Number.POSITIVE_INFINITY:De,n=r?Number.POSITIVE_INFINITY:vt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:Re,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${Re} symbols and reported their top ${De} findings. Enable full mode for unbounded candidate counts.`]}}function jt(e,r){r.releaseCachesBetweenPhases&&(M(e),$())}function c(e,r,t,i){Ot(t);try{return i()}finally{jt(e,r)}}function Ot(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Wt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ut(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath))}function L(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Be(e,r){return{...L(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Kt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function $e(e,r){return{...V(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Yt(e){let r=e.sharedHooks.length>0,t=Ve({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Ne(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Xt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ve({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ne(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ve(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Ie.has(_e(r))).length+Math.min(e.functions.length,3)}function Ne(e,r,t){let i=[...e,...r,...t].map(_e);return i.length>0&&i.every(n=>Ie.has(n))}function _e(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Qt(e){return e.actionTier==="signal"?.25:1}function Jt(e){return e.actionTier==="signal"?.25:1}function ke(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function N(e){return Math.round(e*100)/100}var Ie=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{m as a,bt as b,zr as c,Gr as d,yt as e,jr as f};
|
|
2
|
-
//# sourceMappingURL=chunk-LDVT66YM.js.map
|
package/dist/chunk-LQRQN2XA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-35NLDRZC.js";import{c as d}from"./chunk-XRYABF57.js";import{b as u}from"./chunk-NJITK2GP.js";import{b as f}from"./chunk-TEBQMNVI.js";function w(n,e={}){return C(n,e).cycles}function C(n,e={}){return b(n,e)}function W(n,e={}){return b(n,e).cycles}function b(n,e={}){let{scope:t,maxDepth:o=10,edgeBasis:r="symbol-references"}=e,s=f(n,t,r==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:a}=g(s),l=a.filter(i=>D(s,i)).map(i=>{let c=[...i].sort(),p=S(s,c),y=x(p);return{path:p,component:c,edgeBasis:r,witness:!0,classification:y==="real"?"dependency-cycle":"module-structure-candidate",kind:y}});return l.sort((i,c)=>i.kind!==c.kind?i.kind==="real"?-1:1:i.path.length-c.path.length),{cycles:l,truncated:!1,edgeBasis:r,maxDepth:o}}function D(n,e){if(e.length>1)return!0;let t=e[0];return t!==void 0&&n.get(t)?.has(t)===!0}function S(n,e){let t=e[0];if(!t)return[];let o=new Set(e);for(let r of[...n.get(t)??[]].filter(s=>o.has(s)).sort()){if(r===t)return[t,t];let s=B(n,r,t,o);if(s)return[t,...s]}throw new Error(`Cyclic component did not contain a witness path from ${t}.`)}function B(n,e,t,o){let r=[e],s=new Map([[e,null]]);for(let a=0;a<r.length;a+=1){let l=r[a];if(l===t){let i=[];for(let c=l;c!==null;c=s.get(c)??null)i.push(c);return i.reverse()}for(let i of[...n.get(l)??[]].filter(c=>o.has(c)).sort())s.has(i)||(s.set(i,l),r.push(i))}return null}function x(n){for(let o of n){let r=u(o);if(r==="test"||r==="barrel"||r==="entry")return"module-hierarchy"}if(n.length!==3)return"real";let[e,t]=n;return!e||!t?"real":d(e)||d(t)||m(e,t)||m(t,e)||h(e,t)||h(t,e)||u(e)==="entry"||u(t)==="entry"?"module-hierarchy":"real"}function m(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=e.replace(/\.rs$/,"/");return n.startsWith(t)?!n.slice(t.length).includes("/"):!1}function h(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=n.replace(/\.rs$/,""),o=e.replace(/\.rs$/,"");if(t===o+"_tests"||t===o+"/tests")return!0;let r=n.split("/"),s=e.split("/");if(r.length===s.length&&r.includes("tests")&&s.includes("src")){let a=r[r.length-1],l=s[s.length-1];if(a&&a===l)return!0}return!1}export{w as a,C as b,W as c,b as d};
|
|
2
|
-
//# sourceMappingURL=chunk-LQRQN2XA.js.map
|
package/dist/chunk-MNV5FSBW.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as Z,c as q}from"./chunk-TPFHAQ2G.js";import{f as _}from"./chunk-6VVV4WRR.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-CJZXN4NU.js";import{d as Q,f as V}from"./chunk-DYGHBZ2N.js";import{t as T}from"./chunk-N2ZSIIGR.js";import{n as O}from"./chunk-ODDUPDP7.js";import{k as M}from"./chunk-FESCRNVV.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
2
|
-
`).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
|
|
3
|
-
//# sourceMappingURL=chunk-MNV5FSBW.js.map
|
package/dist/chunk-MV3CDXPI.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{d as V,e as Z}from"./chunk-MTDBHTSF.js";import{c as K,d as O,e as Q,f as U,o as Y}from"./chunk-YEN6CYC7.js";import{a as H}from"./chunk-2GRUZAQF.js";import{G as D,K as x,M as j,T as N,U as G,Z as W,_ as J,p as k}from"./chunk-3L2ZBPEX.js";import{d as $,f as B}from"./chunk-DRENNWRG.js";import{d as A}from"./chunk-IW5XQG5G.js";import{p as v}from"./chunk-KYSDI3GE.js";function Ie(o,t,n={}){let i=z(o,[t],{additive:n.additive,semantic:n.semantic,semanticEvidence:n.semanticEvidence}),l=n.callableOnly?(i.get(t.symbolId)??[]).filter(s=>B(s.symbol)||s.source==="ast-callsite"):i.get(t.symbolId)??[];return typeof n.limit=="number"?l.slice(0,n.limit):l}function ve(o,t,n){return te(o,[t],n).get(t.symbolId)??[]}function te(o,t,n){let i=se(o)?ce(o,t,{semantic:n.semantic!==!1,semanticEvidence:n.semanticEvidence}):ae(o,n.semanticEvidence);return typeof n.limit!="number"?new Map(t.map(l=>[l.symbolId,i.get(l.symbolId)??[]])):new Map(t.map(l=>[l.symbolId,(i.get(l.symbolId)??[]).slice(0,n.limit)]))}var oe=A("caller-rows",{clearGroups:["whole-project"]}),ie=A("targeted-caller-strategy",{clearGroups:["whole-project"]}),le=2e4;function se(o){return ie.get(o,()=>(o.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>le)}function ae(o,t){return oe.get(o,()=>{let n=G(o),i=z(o,n,{semanticEvidence:t}),l=new Map;for(let c of n)l.set(c.symbol,c.symbolId);let s=new Map,a=new Map;for(let c of n){let f=i.get(c.symbolId);if(!(!f||f.length===0))for(let b of f){let r=l.get(b.symbol);if(r===void 0||r===c.symbolId)continue;let u=s.get(r);u||(u=[],s.set(r,u),a.set(r,new Set));let h=`${c.symbol}|${c.relativePath}`;a.get(r).has(h)||(a.get(r).add(h),u.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion",callEvidence:b.source}))}}return s})}function ce(o,t,n){let i=n.semantic&&n.semanticEvidence?t.flatMap(e=>{let d=re(o,e);return d?[d]:[]}):[],l=new Map(i.map(e=>[e.symbolId,e])),s=n.semanticEvidence?.referenceMap(o,i)??new Map,a=Y(o,t),c=new Set(t.map(e=>e.symbol)),b=[...new Set(t.flatMap(e=>H(o,"reverse",[e.relativePath])))].flatMap(e=>N(o,e)),r=new Map,u=X(o,b);for(let e of b)for(let d of u.get(e.symbolId)??[]){if(!c.has(d.symbol))continue;let g=r.get(d.symbol)??[];g.push({symbol:e.symbol,file:e.relativePath,source:"caller-map-inversion",callEvidence:d.source}),r.set(d.symbol,g)}let h=new Map;for(let e of t){let d=[],g=new Set,S=m=>{if(m.symbol===e.symbol)return;let E=`${m.symbol}|${m.file}`;g.has(E)||(g.add(E),d.push(m))};for(let m of r.get(e.symbol)??[])S(m);for(let m of a.get(e.symbolId)??[])m.file!==e.relativePath&&S({symbol:m.enclosingSymbol??m.file,file:m.file,source:"resolved-reference"});let L=l.get(e.symbolId);if(L)for(let m of s.get(L.symbolId)??[]){if(m.file===e.relativePath||o.isIgnored(m.file))continue;let E=J(N(o,m.file),m.line);S({symbol:E?.symbol??m.file,file:m.file,source:"semantic-reference"})}h.set(e.symbolId,d)}return h}function re(o,t){let n=V().join(", "),i=Z().join(", ");return o.get(`SELECT
|
|
2
|
-
d.id AS documentId,
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (${n}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (${i}) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
19
|
-
WHERE gs.id = ?
|
|
20
|
-
LIMIT 1`,t.symbolId)??null}function z(o,t,n={}){if(t.length===0)return new Map;let i=n.additive??!1,l=[],s=[];for(let r of t)k(r.relativePath)&&D(o,r.relativePath)!==null?l.push(r):s.push(r);let a=new Map,c=new Map,f=r=>{for(let[u,h]of r){let e=a.get(u);e||(e=[],a.set(u,e));let d=c.get(u);d||(d=new Set,c.set(u,d));for(let g of h){let S=`${g.symbol}|${g.chunkId}`;d.has(S)||(d.add(S),e.push(g))}}};l.length>0&&f(X(o,l)),n.semantic!==!1&&n.semanticEvidence&&f(ye(n.semanticEvidence.calleeMap(o,t)));let b=i?t:s;return b.length>0&&f(fe(o,b)),a}function X(o,t){let n=new Map,i=me(t,n),l=U(o);for(let[s,a]of i){let c=D(o,s);if(!c)continue;let f=W(a);for(let b of c){let r=f.get(b.line);if(!r)continue;let u=de(o,s,l,b);u&&u.symbol!==r.symbol&&n.get(r.symbolId).push({symbol:u.symbol,file:u.file,chunkId:b.line,source:"ast-callsite",callsiteLine:b.line})}}return n}function me(o,t){let n=new Map;for(let i of o){let l=n.get(i.relativePath);l?l.push(i):n.set(i.relativePath,[i]),t.set(i.symbolId,[])}for(let i of n.values())i.sort((l,s)=>l.endLine-l.startLine-(s.endLine-s.startLine));return n}function de(o,t,n,i){let l=j(o,t,i.calleeLeaf);if(l){let c=O(t,n.get(l.importedName)??[]).filter(f=>v(l.sourcePath,f.file));return c.length===1?c[0]:null}let s=O(t,n.get(i.calleeLeaf)??[]);if(s.length===0)return null;let a=ue(o,t,s,i.calleeQualifier);return a||Q(o,t,s,i.memberAccess,i.calleeQualifier)}function ue(o,t,n,i){if(!i||k(t)!=="clojure")return null;let s=x(o,t).filter(a=>a.kind==="namespace"&&a.localName===i&&a.sourcePath).map(a=>a.sourcePath);for(let a of s){let c=n.find(f=>v(a,f.file));if(c)return c}return n.find(a=>/`([^`]+)`\//.exec(a.symbol)?.[1]===i)??null}function fe(o,t){if(t.length===0)return new Map;let i=T(t.map(e=>e.documentId)).flatMap(e=>o.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
21
|
-
FROM mentions m
|
|
22
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
23
|
-
WHERE m.role != 1
|
|
24
|
-
AND c.document_id IN (${e.map(()=>"?").join(",")})`,...e)),l=new Map;for(let e of i)l.has(e.document_id)||l.set(e.document_id,[]),l.get(e.document_id).push(e);let a=T(i.map(e=>e.symbol_id)).flatMap(e=>o.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
25
|
-
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
26
|
-
FROM global_symbols gs
|
|
27
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
28
|
-
LEFT JOIN (
|
|
29
|
-
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
30
|
-
FROM mentions m
|
|
31
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
32
|
-
WHERE m.role = 1
|
|
33
|
-
AND m.symbol_id IN (${e.map(()=>"?").join(",")})
|
|
34
|
-
GROUP BY m.symbol_id
|
|
35
|
-
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
36
|
-
WHERE gs.id IN (${e.map(()=>"?").join(",")})`,...e,...e)),c=T([...t.map(e=>e.documentId),...a.flatMap(e=>e.document_id===null?[]:[e.document_id])]),f=new Map(c.flatMap(e=>o.all(`SELECT id, relative_path FROM documents
|
|
37
|
-
WHERE id IN (${e.map(()=>"?").join(",")})`,...e).map(d=>[d.id,d.relative_path]))),b=new Map;for(let e of a)b.has(e.symbol_id)||b.set(e.symbol_id,{symbol:e.symbol,file:e.document_id!==null?f.get(e.document_id)??"":""});let r=new Map,u=f,h=be(t);for(let[e,d]of h){let S=[...l.get(e)??[]].sort((y,C)=>y.start_line-C.start_line||y.end_line-C.end_line),L=[...d].sort((y,C)=>y.startLine-C.startLine||y.endLine-C.endLine),m=new Set,E=0;for(let y of L){for(;E<S.length&&S[E].start_line<=y.endLine;)m.add(S[E]),E+=1;for(let p of m)p.end_line<y.startLine&&m.delete(p);let C=new Set,P=[],R=null,ee=()=>{if(R)return R;let p=u.get(y.documentId)??"",_=new Set;if(p){let I=K(o,p),w=Math.max(0,y.startLine),F=Math.min(I.length-1,y.endLine);for(let M=w;M<=F;M+=1)for(let ne of I[M])_.add(ne)}return R=_,_};for(let p of m){if(p.symbol_id===y.symbolId)continue;let _=b.get(p.symbol_id);if(!_)continue;if(!(p.start_line>=y.startLine&&p.end_line<=y.endLine)){if(!(p.start_line<=y.endLine&&p.end_line>=y.startLine))continue;let M=$(_.symbol);if(!M||!ee().has(M))continue}let w=`${_.symbol}|${p.chunk_id}`;C.has(w)||(C.add(w),P.push({..._,chunkId:p.chunk_id,source:"scip-chunk"}))}r.set(y.symbolId,P)}}return r}var q=500;function T(o){let t=[...new Set(o)],n=[];for(let i=0;i<t.length;i+=q)n.push(t.slice(i,i+q));return n}function be(o){let t=new Map;for(let n of o){let i=t.get(n.documentId);i?i.push(n):t.set(n.documentId,[n])}return t}function ye(o){let t=new Map;for(let[n,i]of o){let l=[];for(let s of i)l.push({symbol:s.symbol,file:s.file,chunkId:-1,source:"semantic-callee",...s.callsiteLine===void 0?{}:{callsiteLine:s.callsiteLine}});t.set(n,l)}return t}export{Ie as a,ve as b,te as c,z as d};
|
|
38
|
-
//# sourceMappingURL=chunk-MV3CDXPI.js.map
|
package/dist/chunk-N5B2NILC.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{isAbsolute as it,relative as jn}from"path";var g=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function be(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function zi(e){return e.replace(/\\/g,"/")}function Hi(e,t){return be(e)===be(t)}function b(e,t){let n=jn(e,t);return n===""||!n.startsWith("..")&&!it(n)}function w(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(it(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=be(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function te(e,t,n=[]){let r=Pe(e);if(dt.has(r)||n.some(o=>ee(r,o))||t.some(o=>lt(r,o)))return"config";if(t.some(gt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=ft(r);return t.some(o=>(ht[o]??[]).includes(i))?"source":"other"}function pt(e,t,n){let r=Pe(e);if(dt.has(r)||n?.some(o=>ee(r,o))||lt(r,t)||gt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=ft(r);return(ht[t]??[]).includes(i)}function Ui(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!st(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!st(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(xe)?null:t}function ot(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function qi(e,t){return!e||!t?e===t:JSON.stringify(ot(e))===JSON.stringify(ot(t))}function Ji(e,t){let n=new Map((e?.files??[]).map(a=>[a.path,a])),r=new Map(t.files.map(a=>[a.path,a])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let a of[...i].sort()){let c=n.get(a),u=r.get(a),d=te(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:d,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:d,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:d,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(at(e?.files??[])||at(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Cn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Fn(e,t):!0,uncertainty:[...s].sort()}}function st(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function at(e){return new Set(e.map(t=>t.path)).size!==e.length}function xe(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function Cn(e){return e.hash==="unreadable"||e.size<0}function Fn(e,t){return ct(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&ct(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ct(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((i,o)=>i===r[o])}var dt=new Set([".scipquery.json"]),kn={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},wn={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},ut=new Map;function lt(e,t){return kn[t].some(n=>ee(e,n))||wn[t].some(n=>ee(e,n))}function ee(e,t){let n=Pe(t).replace(/^\.\//,"");if(!n)return!1;let r=e.split("/").at(-1)??e,i=n.includes("/")?e:r;if(!n.includes("*")&&!n.includes("?"))return i===n;let o=ut.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),ut.set(n,o)}return o.test(i)}function Pe(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function ft(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function gt(e){return e==="typescript"||e==="javascript"}var ht={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Ki(e){return typeof e=="string"&&e.length>0}function Yi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Xi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Rn=/^[a-f0-9]{64}$/u;function Qi(e){return typeof e=="string"&&Rn.test(e)}function Zi(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function eo(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var yt=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var je=2,O=3;var Ce=new Set(yt);function ao(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${Ln(s)}`}}if(!R(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==je&&n!==O)return{kind:"unsupported",version:n,direction:n<je?"older":"future"};let r=In(t,n);if(r)return{kind:"malformed",reason:r};let i=t,o={metadata:i,capabilities:En(i)};return n===je?{kind:"legacy",...o,metadata:i}:{kind:"supported",...o,metadata:i}}function co(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function uo(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===O?t.sqliteLayoutVersion:void 0})}function En(e){let t=e.fingerprint!==void 0,n=R(e.fingerprint),r=e.indexedLanguages!==void 0,i=e.status==="complete",o=e.version===O?e:null;return{usableForQuery:r,usableForEvidenceCache:t,publishableGeneration:i&&n&&r,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!o?.languageFingerprints,typescriptProjectShardReuse:!!o?.typescriptProjectShards}}function In(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!mt(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!vn(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!Tn(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===O&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===O&&e.languageFingerprints!==void 0&&!On(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===O&&e.typescriptProjectShards!==void 0&&!An(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function po(e){return e.version===O&&e.sqliteLayoutVersion===1}function vn(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&Ce.has(t))?!1:new Set(e).size===e.length}function Tn(e){return Array.isArray(e)&&e.every(t=>R(t)&&typeof t.language=="string"&&Ce.has(t.language)&&typeof t.reason=="string")}function On(e){return R(e)&&Object.entries(e).every(([t,n])=>Ce.has(t)&&R(n))}function An(e){return R(e)&&Object.values(e).every(t=>R(t)&&Array.isArray(t.files)&&t.files.every(xe))}function Ln(e){return e instanceof Error?e.message:String(e)}import{closeSync as Fe,fstatSync as ne,openSync as ke,readFileSync as Dn,readSync as St}from"fs";import{createHash as _n}from"crypto";var bt=8*1024*1024,xt=64*1024*1024,Bn=512*1024*1024,Mn=256*1024*1024,E=class extends Error{constructor(n,r,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${n} ${JSON.stringify(r)} ${a}`);this.inputKind=n;this.inputPath=r;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function re(e,t){A(t.maxBytes);let n=String(e),r=ke(e,"r");try{let i=ne(r);jt(i,t,n);let o=Dn(r),s=ne(r);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new E(t.inputKind,n,"changed-during-read",s.size,t.maxBytes);return o}finally{Fe(r)}}function we(e,t,n="utf8"){return re(e,t).toString(n)}function $(e,t){return we(e,{maxBytes:bt,inputKind:t})}function Nn(e,t){return we(e,{maxBytes:xt,inputKind:t})}function Re(e,t){A(t.maxBytes);let n=[],r=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=St(e,r,0,r.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new E(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);n.push(Buffer.from(r.subarray(0,o)))}return Buffer.concat(n,i)}function Gn(e,t,n="utf8"){return Re(e,t).toString(n)}function Pt(e,t){let n=ke(e,"r");try{return Re(n,t)}finally{Fe(n)}}function Wn(e,t,n="utf8"){return Pt(e,t).toString(n)}function ie(e,t,n){A(t.maxBytes);let r=String(e),i=ke(e,"r");try{let o=ne(i);jt(o,t,r);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=St(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;n(s.subarray(0,u)),a+=u}let c=ne(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new E(t.inputKind,r,"changed-during-read",c.size,t.maxBytes);return a}finally{Fe(i)}}function zn(e,t){let n=_n("sha256");return ie(e,t,r=>n.update(r)),n.digest("hex")}function jt(e,t,n){if(!e.isFile())throw new E(t.inputKind,n,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new E(t.inputKind,n,"too-large",Number(e.size),t.maxBytes)}function A(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{spawnSync as $n}from"child_process";import{createHash as Un}from"crypto";import{existsSync as qn,lstatSync as Jn,realpathSync as Vn}from"fs";import{dirname as Kn,isAbsolute as Yn,join as Xn,relative as Fo,resolve as ae,sep as ko}from"path";var Ct=Symbol.for("scip-query.project-file-listing-context.v1"),Ft=globalThis,Ee=Ft[Ct],I=Ee&&typeof Ee=="object"?Ee:{};Ft[Ct]=I;function kt(e,t){let n=I.active?I.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function wt(){return I.sequence??0}function Rt(e,t,n){let r=I.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Hn(n(),(I.sequence??0)+1);if(I.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function Et(e,t){let n=I.active?.get(e);return n&&n.sequence>t?n.indexAllowsTreeFingerprintReuse:void 0}function*It(e){let t=0;for(;t<e.taggedOutput.length;){let n=e.taggedOutput.indexOf("\0",t);if(n<0)return;yield e.taggedOutput.slice(t+2,n),t=n+1}}function Hn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var T={run(e,t){let n=Tt(e,t);return n.kind==="success"?n.output:void 0},runResult:Tt},Qn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],ve=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],oe=/^[0-9a-f]{40,64}$/;function Ro(e,t,n=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let r=n.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(r.kind!=="success"||!oe.test(r.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return r.output}function Eo(e,t=T){return Zn(e,t)?.context}function Zn(e,t=T){let n=t.runResult(e,Qn);if(n.kind==="success"){let i=er(n.output);if(i){let o=tr(i,t);if(o)return vt(o)}}let r=nr(e,t);return r?vt(r):void 0}function Io(e,t=T){if(!e.headCommit)return;let n=t.run(e.projectRoot,ve);if(n===void 0)return;let r=Te(n);if(!(!r?.headCommit||r.headCommit!==e.headCommit))return{...e,clean:r.clean}}function vo(e,t=T,n={}){let r=t===T&&n.cachedInventoryAfterSequence!==void 0?Et(e,n.cachedInventoryAfterSequence):void 0;if(r!==void 0)return r;let i=t.run(e,["ls-files","-v","-z"]);return i===void 0?!1:i.split("\0").filter(Boolean).every(o=>o.startsWith("H "))}function vt(e){return{context:e,projectFileInventorySequence:wt()}}function Te(e){let t=e.split("\0").filter(Boolean),n=t.find(i=>i.startsWith("# branch.oid "))?.slice(13),r=n==="(initial)"?void 0:n;if(!(r!==void 0&&!oe.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function er(e){let t=e.split(`
|
|
2
|
-
`).map(c=>c.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!oe.test(o)||!oe.test(s))return;let a=v(n);return{root:a,gitDir:v(se(a,r)),commonDir:v(se(a,i)),headCommit:o,treeOid:s}}function tr(e,t){let n=t.run(e.root,ve);if(n===void 0)return;let r=Te(n);return r?.headCommit!==e.headCommit?void 0:{...Ot(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Oe("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function nr(e,t){let n=rr(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=v(se(i,o)),a=Ie(t.run(i,["rev-parse","--verify","HEAD"])),c=Ie(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,ve);if(u===void 0)return;let d=Te(u);if(!(!d||d.headCommit!==a))return{...r,commonDir:s,repositoryId:Oe("repository",s),headCommit:a,treeOid:c,clean:d.clean}}function rr(e,t=T){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=v(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=v(se(i,o));return{kind:"worktree",identity:Ot(i,s)}}function Ot(e,t){return{projectRoot:e,gitDir:t,worktreeId:Oe("worktree",`${e}\0${t}`)}}function To(e,t,n=T){return Ie(n.run(e,t))}function se(e,t){return Yn(t)?t:ae(e,t)}function v(e){try{return Vn(e)}catch{return ae(e)}}function Oe(e,t){return Un("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function Ie(e){return e?.trim()||void 0}function Tt(e,t){let n=$n("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(n.status===0)return{kind:"success",output:n.stdout.trimEnd()};let i=(typeof n.stderr=="string"?n.stderr.trim():"")||n.error?.message||`git exited with status ${n.status??"unknown"}`,o=n.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&qn(ae(e)))&&!ir(e)?{kind:"not-repository"}:{kind:"error",message:i}}function ir(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ae(e);for(;;){try{return Jn(Xn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Kn(t);if(n===t)return!1;t=n}}import{createRequire as ar}from"module";import{existsSync as cr,lstatSync as Lt,readdirSync as ur,statSync as pr}from"fs";import l from"path";import{AsyncLocalStorage as or}from"async_hooks";var sr=new or;function L(e,t){let n=ce(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function D(e,t){let n=ce(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function At(e,t){return ce(e)?.fingerprints.get(t)}function _(e){return ce(e)?.paths}function ce(e){let t=sr.getStore();if(t)return t.projectRoot===v(e)?t:void 0}var dr=ar(import.meta.url),Dt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),lr=18003;function ue(e,t=[]){let n=l.resolve(e),r=t.flatMap(c=>hr(n,c));if(r.length>0)return _t(n,Mt(r));let i=gr(n),o=Mt(i),s=mr(n,o)?[n,...o]:o,a=s.length>0?s:[n];return _t(n,a)}function Nt(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Gt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var fr=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function zo(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function Wt(e){return fr.test(e)}function zt(e,t,n=[]){let r;try{r=dr("@ts-morph/common/dist/typescript.js")}catch{return null}let i=l.resolve(e),o=t==="workspace"?ue(i,n):["."],s=new Set;for(let a of o){let c=a==="."?i:l.join(i,a),u=l.join(c,"tsconfig.json"),d=Sr(r,i);if(!d.fileExists(u))return null;let p=r.readConfigFile(u,d.readFile);if(p.error)return null;let f=r.parseJsonConfigFileContent(p.config,d,c);if(f.errors.some(m=>m.code!==lr))return null;for(let m of f.fileNames){let h=l.resolve(m);b(i,h)&&s.add(l.relative(i,h).split(l.sep).join("/"))}}return s}function Ho(e,t,n,r){let i=l.resolve(e),o=new Set(r);for(let a of n){let c=l.resolve(i,a);if(b(i,c))try{let u=Lt(c);if(u.isSymbolicLink()||u.isFile()&&!o.has(B(i,c)))return!1}catch{}}let s=t==="workspace"?ue(i,n):["."];for(let a of s){let c=a==="."?i:l.join(i,a),u=l.join(c,"tsconfig.json");if(!$t(i,u))continue;let d=B(i,u);if(!o.has(d))return!1;try{if(Lt(u).isSymbolicLink())return!1;let p=Ut(i,u);if(p.includes("extends")||p.includes("\\"))return!1}catch{return!1}}return!0}function _t(e,t){return[...new Set(t.map(n=>B(e,n)))].sort((n,r)=>n.localeCompare(r))}function gr(e){let t=_(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>Dt.has(s)))return[];let o=l.join(e,...i.split("/"));return Bt(e,o)?[l.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=ur(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=l.join(i,s.name);if(s.isDirectory()){!Dt.has(s.name)&&!s.name.startsWith(".")&&r.push(a);continue}s.isFile()&&Bt(e,a)&&n.push(l.dirname(a))}}return n}function hr(e,t){let n=t.trim();if(!n)return[];let r=l.resolve(e,n);if(!b(e,r))return[];let i=_(e);if(i){let o=B(e,r);if(i.includes(o)&&Ae(l.basename(r)))return[l.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[r]:[]}try{let o=pr(r);if(o.isDirectory())return[r];if(o.isFile()&&Ae(l.basename(r)))return[l.dirname(r)]}catch{return[]}return[]}function Bt(e,t){if(!Ae(l.basename(t)))return!1;let n=Ht(e,t);return n?l.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function Ae(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Mt(e){let t=[...new Set(e.map(n=>l.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&xr(n,r)))}function mr(e,t){if(t.length===0||t.some(r=>l.resolve(r)===e))return!1;let n=l.join(e,"tsconfig.json");return $t(e,n)&&yr(e,n)}function yr(e,t){let r=Ht(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!l.extname(i))):!1}function Ht(e,t){try{let n=JSON.parse(Ut(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function $t(e,t){let n=B(e,t),r=D(e,n);return r?r==="present":cr(t)}function Ut(e,t){let n=B(e,t);if(_(e)){let i=L(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return $(t,"TypeScript project config")}function Sr(e,t){let n=_(t);if(!n)return e.sys;let r=l.resolve(t),i=new Set(n),o=br(r,n),s=e,a=c=>{let u=l.resolve(c);return b(r,u)?B(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):L(r,u)?.content.toString("utf8")},readDirectory(c,u,d,p,f){let m=l.resolve(c);return b(r,m)?s.matchFiles(m,u,d,p,e.sys.useCaseSensitiveFileNames,r,f,h=>o.get(l.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(c,u,d,p,f)}}}function br(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),r.get(a).add(u),a=l.join(a,u),i(a)}n.get(a).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function B(e,t){let n=l.relative(e,t);return n?n.split(l.sep).join("/"):"."}function xr(e,t){let n=l.relative(e,t);return!!n&&!n.startsWith("..")&&!l.isAbsolute(n)}import{createHash as _e}from"crypto";import{execFileSync as qt}from"child_process";import{createRequire as Pr}from"module";var jr=Pr(import.meta.url),Cr=/\.(?:[cm]?[jt]sx?)$/iu,Fr=/\.[jt]sx$/iu,Jt=/(?:^|\/)package\.json$/iu,U,Le=new Map;function Vt(e,t){if(!Be(e))return;let n=kr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=Fr.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=_e("sha256").update(`typescript-semantic-v1\0${i}\0`),a=!1,c=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){a&&(c=!0);continue}c&&s.update("line-break\0");let d=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(d)}\0`).update(d).update("\0"),a=!0,c=!1}return s.digest("hex")}catch{return}}function Be(e){return Cr.test(e)}function Me(e,t){if(Jt.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return _e("sha256").update("typescript-package-json-v1\0").update(De(i)).digest("hex")}catch{return}}function Ne(e){return Jt.test(e)}function Vo(e,t,n){if(!Ne(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(Le.has(r))return Le.get(r);let i;try{let o=qt("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let a=qt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(_e("sha256").update(a).digest("hex")===n){i=Me(t,a);break}}}catch{i=void 0}return Le.set(r,i),i}function kr(){if(U!==void 0)return U;try{U=jr("typescript")}catch{U=null}return U}function De(e){return Array.isArray(e)?`[${e.map(De).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${De(n)}`).join(",")}}`:JSON.stringify(e)}import{createHash as en,randomUUID as Lr}from"crypto";import{chmodSync as tn,existsSync as M,linkSync as Dr,lstatSync as ge,readdirSync as ze,realpathSync as C,unlinkSync as _r,writeSync as Br}from"fs";import{homedir as Mr}from"os";import{basename as Nr,dirname as he,isAbsolute as Qt,join as y,resolve as me}from"path";import{closeSync as wr,existsSync as Rr,fsyncSync as Er,mkdirSync as Ir,openSync as vr}from"fs";import{dirname as Kt}from"path";function pe(e,t,n,r){let i=0;for(;i<t.length;){let o=n.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${r} write did not make valid forward progress`);i+=o}}function Ge(e,t){if(t!=="win32")return!1;let n=e.code;return n==="EACCES"||n==="EBADF"||n==="EINVAL"||n==="EISDIR"||n==="EPERM"}var q=Object.freeze({platform:process.platform,pathExists:e=>Rr(e),makeDirectory:e=>Ir(e,{recursive:!0}),openFile:(e,t,n)=>vr(e,t,n),syncFile:e=>Er(e),closeFile:e=>wr(e)});function Yt(e,t=q){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Kt(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=le(i,de(Kt(o),t));return i}function de(e,t=q){let n;try{n=t.openFile(e,"r")}catch(r){if(Ge(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(Ge(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function le(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as Tr}from"module";var Or=Tr(import.meta.url),Xt=Ar().version;function Ar(){for(let e of["../package.json","../../package.json"])try{return Or(e)}catch{}return{version:"0.0.0"}}var nn=1,V=".scip-query-cache-owner.json",Gr=16*1024,rn=Object.freeze({...q,randomToken:()=>Lr(),linkFile:(e,t)=>Dr(e,t),removeFile:e=>_r(e),writeFile:(e,t,n,r)=>Br(e,t,n,r)});function fe(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function F(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Wr(e,t){let n=C(e);return Hr(n,He(n,t))}function He(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?me(r):t?.dbPath?Ur(n,t.dbPath):zr(n)}function on(){let e=process.env.XDG_CACHE_HOME;return y(e||y(Mr(),".cache"),"scip-query")}function zr(e){let t=me(e);try{t=C(t)}catch{}let n=en("sha256").update(t).digest("hex").slice(0,12);return y(on(),"projects",n)}function ls(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(on(),"repositories",e);return cn(t),C(t)}function fs(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function gs(e,t){let n=Wr(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function Hr(e,t,n=rn){return $r(e,t,n).cacheDir}function $r(e,t,n=rn){let r=C(e),i=M(t)?"synced":cn(t,n),o=C(t),s=y(o,V);if(M(s))return We(r,o),$e(s),J(o),{kind:"existing",cacheDir:o};Zt(o),Yr(o),Zt(o);let c=`${JSON.stringify({schemaVersion:nn,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Xt},null,2)}
|
|
3
|
-
`;try{let u=Xr(s,c,n),d=le(i,u);return{kind:"published",cacheDir:o,achievedDurability:d==="synced"?"directory-durable":"file-flushed",directorySync:d}}catch(u){if(Zr(u))return We(r,o),{kind:"existing",cacheDir:o};throw u}}function We(e,t){let n=C(e),r=C(t);return Jr(r,n,r)}function hs(e,t){return M(y(t,V))?(We(e,t),sn(t),!0):!1}function Ur(e,t){let n;try{n=w(t)}catch(s){throw s instanceof g?fe(t,s.reason):s}let r=me(e,...n.split("/"));if(r===e||!b(e,r))throw fe(t,"outside-project");let i=qr(r),o=C(i);if(!b(e,o)&&o!==e)throw fe(t,"symlink-escape");return r}function qr(e){let t=e;for(;!M(t);){let n=he(t);if(n===t)throw fe(e,"no-existing-ancestor");t=n}return t}function Jr(e,t,n){let r=y(e,V);if(!M(r)||ge(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=ge(r);if(!i.isFile()||i.size>Gr)throw F(e,"invalid ownership record file");let o=$(r,"cache ownership record"),s=Vr(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw F(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw F(e,"ownership record names a different cache directory");return{record:s,ownerSha256:en("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Vr(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==nn||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Qt(n.canonicalProjectRoot)||!Qt(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw F(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Zt(e){let t=ze(e).filter(n=>n!==V&&!Kr(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Kr(e){return e.startsWith(`${V}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function Yr(e){for(let t of ze(e)){let n=y(e,t);try{let r=ge(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())J(n);else if(r.isFile())$e(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(an(r))continue;throw r}}J(e)}function sn(e,t=!1){try{let n=ge(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){$e(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");J(e);for(let r of ze(e))sn(y(e,r),!0)}catch(n){if(t&&an(n))return;throw n}}function an(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function cn(e,t=q){let n=Yt(e,t);return J(e),n}function Xr(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,pe(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=de(he(e),n);return n.removeFile(r),o=!1,le(s,de(he(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function J(e){process.platform!=="win32"&&tn(e,448)}function $e(e){process.platform!=="win32"&&tn(e,384)}function Qr(e){if(M(e))return C(e);let t=C(he(e));return y(t,Nr(e))}function ms(e){return Qr(me(e))}function Zr(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as hi}from"child_process";import{isUtf8 as hn}from"buffer";import{createHash as Ye}from"crypto";import{closeSync as Sn,fstatSync as K,lstatSync as Qe,openSync as bn,readdirSync as mi,readFileSync as yi,readSync as mn,readlinkSync as Si,realpathSync as X}from"fs";import{isAbsolute as bi,join as Ze,relative as xi,resolve as Pi,sep as ji}from"path";import{closeSync as un,existsSync as qe,openSync as ei,realpathSync as ti,renameSync as ni,unlinkSync as pn,writeSync as ri}from"fs";import{dirname as ii,join as oi}from"path";var si="fingerprint-stat-cache.json",dn=1,ai=8*1024*1024,Ue=new Map;function Je(e,t,n,r){let i=ln(e),o=i.files.get(t);if(!(!o||!fn(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function Ve(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=ln(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},a=o.files.get(t);a&&fi(a,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Ke(e){let t=Ue.get(gn(e));if(!(!t?.dirty||!t.cachePath))try{let n=ii(t.cachePath);if(!qe(n))return;gi(t.cachePath,pi(t)),t.dirty=!1}catch{}}function ln(e){let t=gn(e),n=Ue.get(t);if(n)return n;let r=ci(t),i=ui(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return Ue.set(t,o),o}function ci(e){try{let t=He(e);return qe(t)?oi(t,si):null}catch{return null}}function ui(e){let t=new Map;if(!e||!qe(e))return t;try{let n=JSON.parse(re(e,{inputKind:"fingerprint stat cache",maxBytes:ai}).toString("utf8"));if(!di(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function pi(e){return{version:dn,files:Object.fromEntries(e.files)}}function di(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==dn||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(li)}function li(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function fn(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function fi(e,t){return fn(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function gi(e,t){let n=`${e}.${process.pid}.tmp`;try{pn(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
|
|
4
|
-
`,"utf8"),i=ei(n,"wx",384);try{pe(i,r,{writeFile:(o,s,a,c)=>ri(o,s,a,c)},"fingerprint stat cache")}catch(o){throw un(i),pn(n),o}un(i),ni(n,e)}function gn(e){return ti(e)}var Q=64*1024*1024,Ci=1024*1024,Fi=1024,N=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function ki(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function et(e,t,n={}){let r=w(t),i=kt(e,()=>X(e)),o=Pi(i,...r.split("/"));if(!b(i,o)||o===i)throw new g(t,"outside-project");let s=X(o);if(!b(i,s)||s===i)throw new g(t,"outside-project");let a=Qe(s);if(!a.isFile())throw new g(t,"not-a-file");let c={projectRoot:i,relativePath:r,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=n.maxBytes??Q;if(A(u),c.size>u)throw new N(n.inputKind??"project file",c.relativePath,c.size,u);return c}function wi(e,t,n={}){let r=w(t),i=D(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let c=L(e,r);if(!c)throw new g(r,"changed-during-read");let u=n.maxBytes??Q;if(A(u),c.size>u)throw new N(n.inputKind??"project file",r,c.size,u);return Buffer.from(c.content)}let o=et(e,t,n),s=n.maxBytes??Q,a=bn(o.absolutePath,"r");try{let c=K(a);if(Y(c,o,t),c.size>s)throw new N(n.inputKind??"project file",o.relativePath,c.size,s);let u=yi(a),d=K(a);if(Y(d,o,t),u.byteLength!==c.size)throw new g(t,"changed-during-read");return u}finally{Sn(a)}}function Bs(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Ri(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Ri(e,t,n,r={}){if(n.length===0||n.some(c=>c.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=w(t),o=D(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let c=L(e,i);if(!c)throw new g(i,"changed-during-read");let u=r.maxBytes??Q;if(A(u),c.size>u)throw new N(r.inputKind??"project file",i,c.size,u);let d=!c.content.includes(0)&&hn(c.content),p=n.map(yn),f=d?Ii(c.content,n,p):[];return{byteLength:c.size,isUtf8Text:d,matchedLiteralIndexes:f,bytes:f.length>0?Buffer.from(c.content):null,...r.computeSha256?{sha256:c.sha256}:{}}}let s=et(e,t,r),a=bn(s.absolutePath,"r");try{let c=K(a);Y(c,s,t);let u=r.computeSha256?Ye("sha256"):null,d=r.scratchBuffer??Buffer.allocUnsafe(Ci);if(d.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let p=0,f=n.map(()=>!1),m=!1,h=!0,x=Buffer.alloc(0),Z=n.map(()=>Buffer.alloc(0)),G=n.map(yn);for(;p<c.size;){let P=mn(a,d,0,Math.min(d.byteLength,c.size-p),p);if(P<=0)throw new g(t,"changed-during-read");let j=d.subarray(0,P);if(u?.update(j),m||=j.includes(0),h){let S=x.byteLength>0?Buffer.concat([x,j]):j,H=Ei(S);h=hn(S.subarray(0,H)),x=Buffer.from(S.subarray(H))}for(let S=0;S<n.length;S+=1){if(f[S])continue;let H=n[S],rt=Z[S];f[S]=vi(j,H,rt,G[S]),Z[S]=Ti(j,H,rt)}p+=P}h&&=x.byteLength===0,Y(K(a),s,t);let W=!m&&h,z=W?f.flatMap((P,j)=>P?[j]:[]):[],k=null;if(z.length>0){k=Buffer.allocUnsafe(c.size);let P=0;for(;P<k.byteLength;){let j=mn(a,k,P,k.byteLength-P,P);if(j<=0)throw new g(t,"changed-during-read");P+=j}Y(K(a),s,t)}return{byteLength:c.size,isUtf8Text:W,matchedLiteralIndexes:z,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{Sn(a)}}function Ms(e,t,n={}){return wi(e,t,n).toString("utf8")}function Y(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new g(n,"changed-during-read")}function Ei(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function Ii(e,t,n){return t.flatMap((r,i)=>Xe(e,r,n[i])?[i]:[])}function vi(e,t,n,r){if(Xe(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return Xe(Buffer.concat([n,i]),t,r)}function Xe(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>Fi)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function yn(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Ti(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function tt(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Ns(e,t){try{return et(e,t),!0}catch(n){if(tt(n))return!1;throw n}}function Oi(e){let t=_(e);return t?t.filter(n=>n&&!Se(n)).sort():(Mi(e)??Ni(e)).filter(n=>n&&!Se(n)).sort()}function Ai(e,t={}){let n=(t.includePaths??[]).map(w),r=[...new Set([...Oi(e),...n])].filter(s=>!Se(s)).filter(s=>!t.language||pt(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,a)=>s.localeCompare(a)),i=X(e),o=r.flatMap(s=>xn(e,i,s));return Ke(i),o}function xn(e,t,n){let r=At(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(D(e,n)==="present"){let o=L(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=Ze(e,n);try{let o=Qe(i);if(o.isSymbolicLink()){let x=Je(t,n,"symlink",ye(o));if(x)return[{path:n,size:x.size,hash:x.hash}];let Z=X(i),G=xi(t,Z);if(G===".."||G.startsWith(`..${ji}`)||bi(G))throw new Error("external symlink");let W=Si(i),z=Ye("sha256").update("symlink\0").update(W).digest("hex"),k=Buffer.byteLength(W);return Ve(t,n,"symlink",ye(o),{hash:z,size:k}),[{path:n,size:k,hash:z}]}let s=Be(n)||Ne(n),a=Je(t,n,"file",ye(o));if(a&&(!s||a.semanticHash!==void 0))return[{path:n,size:a.size,hash:a.hash,...a.semanticHash===void 0?{}:{semanticHash:a.semanticHash}}];let c=Ye("sha256"),u=s,d=[],p=ie(i,{inputKind:"project fingerprint input",maxBytes:Q},x=>{c.update(x),u&&d.push(Buffer.from(x))}),f=c.digest("hex"),m=u?Buffer.concat(d,p):void 0,h=m?Vt(n,m)??Me(n,m):void 0;return Ve(t,n,"file",ye(o),{hash:f,size:p,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:p,hash:f,...h===void 0?{}:{semanticHash:h}}]}catch(o){return tt(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function ye(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function Pn(e,t,n){let r=nt(t,n),i=[...r.typescriptProjects.filter(c=>_i(e,c)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?zt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?ue(e,r.typescriptProjects):["."]:[],a=Nt(s);return{...r,files:Ai(e,{includePath:c=>{if(c===".scipquery.json")return!1;let u=te(c,t,i);return u==="other"||u==="config"&&Gt(c)&&!a.has(c)?!1:u!=="source"||!Di(c)||!o?!0:o.has(c)},includePaths:i})}}function Gs(e,t){let n=new Set(t.files.map(o=>o.path)),r=Pn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...nt(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Ws(e,t,n,r,i,o){let s=p=>({mode:"full",fingerprint:Pn(e,t,n),reason:p});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let a=nt(t,n);if(!Li(r,a))return s("project-input-configuration-changed");if(new Set(r.files.map(p=>p.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...a,files:[...r.files].sort((p,f)=>p.path.localeCompare(f.path))},changedPaths:[]};let c=[...a.typescriptProjects,...a.clojureConfigPath?[a.clojureConfigPath]:[]],u=new Map(r.files.map(p=>[p.path,p]));for(let p of i.entries){let f=u.get(p.path);if(te(p.path,t,c)!=="source")return s("non-source-project-input-changed");if(p.kind==="add"&&f)return s("added-path-already-in-prior-project-input-snapshot");if(p.kind==="delete"&&!f)return s("deleted-path-not-in-prior-project-input-snapshot");if(p.kind==="change"&&!f)return s("changed-path-not-in-prior-project-input-snapshot");if(f&&(f.hash==="unreadable"||f.size<0))return s("changed-path-was-unreadable")}let d=X(e);for(let p of i.entries){let f=xn(e,d,p.path);if(p.kind==="delete"){if(f.length!==0)return s("deleted-source-is-still-readable");u.delete(p.path);continue}if(f.length!==1||f[0].hash==="unreadable"||f[0].size<0)return s(p.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(p.path,f[0])}return Ke(d),{mode:"delta",fingerprint:{...a,files:[...u.values()].sort((p,f)=>p.path.localeCompare(f.path))},changedPaths:i.entries.map(p=>p.path).sort()}}function Li(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Di(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function _i(e,t){let n;try{n=w(t)}catch{return!1}let r=D(e,n);if(r)return r==="present";try{return Qe(Ze(e,n)).isFile()}catch(i){if(tt(i))return!1;throw i}}function nt(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:ki(t.typescriptProjects),clojureConfigPath:Bi(t.clojureConfigPath)}}function Bi(e){return e?.trim()||void 0}function Mi(e){try{let t=Rt(e,52428800,()=>hi("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...It(t)]}catch{return null}}function Ni(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?Ze(e,r):e,o;try{o=mi(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){Se(a)||n.push(a);continue}t.push(a)}}return t}function Se(e){let t=e.split("/");return e==="meta.json"||Wt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>Gi.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Gi=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{g as a,be as b,zi as c,Hi as d,b as e,w as f,te as g,pt as h,Ui as i,ot as j,qi as k,Ji as l,kn as m,R as n,mt as o,Ki as p,Yi as q,Xi as r,Qi as s,Zi as t,eo as u,yt as v,O as w,ao as x,co as y,uo as z,En as A,po as B,bt as C,xt as D,Bn as E,Mn as F,E as G,re as H,we as I,$ as J,Nn as K,Gn as L,Wn as M,ie as N,zn as O,pe as P,Ge as Q,q as R,Yt as S,de as T,le as U,Rt as V,It as W,T as X,Ro as Y,Eo as Z,Io as _,vo as $,To as aa,se as ba,v as ca,ue as da,Nt as ea,Gt as fa,zo as ga,Wt as ha,zt as ia,Ho as ja,Vo as ka,Xt as la,He as ma,on as na,zr as oa,ls as pa,fs as qa,gs as ra,hs as sa,ms as ta,N as ua,ki as va,et as wa,wi as xa,Bs as ya,Ri as za,Ms as Aa,tt as Ba,Ns as Ca,Oi as Da,Ai as Ea,Pn as Fa,Gs as Ga,Ws as Ha,nt as Ia};
|
|
5
|
-
//# sourceMappingURL=chunk-N5B2NILC.js.map
|