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-AVRYW5OZ.js
DELETED
package/dist/chunk-BDUVI7TO.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-ILMHV3KM.js";import{a as A,b as T,c as v,g as P,j as R}from"./chunk-OWOOWNJ5.js";import{d as g,e as L,f as p,g as M,h as k}from"./chunk-GAS2LJMP.js";import{$ as z,_ as I}from"./chunk-KYSDI3GE.js";import c from"process";import{existsSync as _}from"fs";import{dirname as h,join as J,resolve as b,sep as N}from"path";import{fileURLToPath as K}from"url";async function G(e){let n=e.includeReferences!==!1,r=e.includeCallees===!0,t=e.includeSignatures===!0,s={timeoutMs:e.requestTimeoutMs},o=Q(e),a=W(e),l=H(e),f=j(e),C=re(e.projectRoot,o),x=te(e.projectRoot,C),w=ne(C),u=new T(v(e.rustAnalyzerBinary,x),{requestTimeoutMs:e.requestTimeoutMs,configuration:w});try{let y=await u.initialize({processId:c.pid,rootUri:g(x,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:w});if(n&&!y.capabilities.referencesProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/references support.",references:a.map(i=>[i.symbolId,[]]),...r?{callees:l.map(i=>[i.symbolId,[]])}:{}};if(r&&!y.capabilities.callHierarchyProvider)return{available:!1,reason:"rust-analyzer initialized without call hierarchy support.",references:a.map(i=>[i.symbolId,[]]),callees:l.map(i=>[i.symbolId,[]]),...t?{signatures:f.map(i=>[i.symbolId,null])}:{}};if(t&&!y.capabilities.hoverProvider)return{available:!1,reason:"rust-analyzer initialized without hover support.",references:a.map(i=>[i.symbolId,[]]),...r?{callees:l.map(i=>[i.symbolId,[]])}:{},signatures:f.map(i=>[i.symbolId,null])};let $=ie(u,e.projectRoot,o);await se(u,$,e.diagnosticsTimeoutMs??1e4),await R(e.settleDelayMs??5e3);let S=n?await d(a,e.concurrency??8,async i=>{let D=await E(u,p(e.projectRoot,i,!1),{requestTimeoutMs:e.requestTimeoutMs,retryTimeoutMs:e.referenceRetryTimeoutMs});return{symbolId:i.symbolId,references:k(M(e.projectRoot,D.locations)),complete:D.complete}}):a.map(i=>({symbolId:i.symbolId,references:[],complete:!0})),B=r?await d(l,e.concurrency??8,async i=>({symbolId:i.symbolId,callees:await ae(u,e.projectRoot,i,s)})):[],U=t?await d(f,e.concurrency??8,async i=>({symbolId:i.symbolId,signature:await V(u,e.projectRoot,i,s)})):[];return{available:!0,references:S.filter(i=>i.complete).map(i=>[i.symbolId,i.references]),incompleteReferenceSymbolIds:S.filter(i=>!i.complete).map(i=>i.symbolId),...r?{callees:B.map(i=>[i.symbolId,i.callees])}:{},...t?{signatures:U.map(i=>[i.symbolId,i.signature])}:{}}}finally{await u.shutdown().catch(()=>{})}}function W(e){return e.referenceDefinitions??e.definitions}function H(e){return e.calleeDefinitions??e.definitions}function j(e){return e.signatureDefinitions??e.definitions}function Q(e){return[...e.includeReferences!==!1?W(e):[],...e.includeCallees===!0?H(e):[],...e.includeSignatures===!0?j(e):[]]}async function V(e,n,r,t={}){let s=p(n,r,!1),o=await X(e,{textDocument:s.textDocument,position:s.position},t);return Y(o)}async function X(e,n,r={}){try{return await e.hover(n,r)}catch(t){if(m(t),!(t instanceof Error?t.message:String(t)).includes("content modified"))return null;await F(r.deadlineMs);try{return await e.hover(n,r)}catch(o){return m(o),null}}}function Y(e){if(!e)return null;let n=Z(e.contents),r=/```(?:rust)?\s*([\s\S]*?)```/i.exec(n),t=r?r[1]:n;for(let s of t.split(/\r?\n/)){let o=s.replace(/^`+|`+$/g,"").trim();if(o&&ee(o))return o}return null}function Z(e){return typeof e=="string"?e:Array.isArray(e)?e.map(q).join(`
|
|
2
|
-
`):"value"in e?e.value:""}function q(e){return typeof e=="string"?e:e.value}function ee(e){return/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?(?:fn|struct|enum|trait|type|const|static|mod)\b/.test(e)}function ne(e){return{...e.length>0?{linkedProjects:e}:{},references:{excludeImports:!1,excludeTests:!1}}}function te(e,n){return n.length===1?h(n[0]):b(e)}function re(e,n){let r=b(e),t=[],s=new Set;for(let o of n){let a=h(b(r,o.relativePath));for(;me(r,a);){let l=J(a,"Cargo.toml");if(_(l)){s.has(l)||(s.add(l),t.push(l));break}let f=h(a);if(f===a)break;a=f}}return t}function ie(e,n,r){let t=new Set,s=[];for(let o of r)if(!t.has(o.relativePath)){t.add(o.relativePath);try{let a=g(n,o.relativePath);e.didOpenTextDocument({uri:a,languageId:"rust",version:1,text:I(n,o.relativePath,{inputKind:"indexed Rust source file"})}),s.push(a)}catch(a){if(!z(a))throw a}}return s}async function se(e,n,r){await Promise.all(n.map(t=>e.waitForDiagnostics(t,r).catch(()=>!1)))}async function De(e,n){return(await E(e,n)).locations}async function E(e,n,r={}){try{return{locations:await e.references(n,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(t){m(t);let s=t instanceof Error?t.message:String(t);if(O(t))return{locations:[],complete:!1};if(!s.includes("content modified"))return{locations:[],complete:!0};await F(r.deadlineMs);try{return{locations:await e.references(n,oe(r)),complete:!0}}catch(o){return m(o),{locations:[],complete:!O(o)}}}}function oe(e){return{...e.retryTimeoutMs&&e.retryTimeoutMs>0?{timeoutMs:e.retryTimeoutMs}:{},...e.deadlineMs!==void 0?{deadlineMs:e.deadlineMs}:{}}}function O(e){let n=e instanceof Error?e.message:String(e);return n.includes("rust-analyzer LSP request")&&n.includes("timed out after")}async function ae(e,n,r,t={}){let s=p(n,r,!1),o=await le(e,{textDocument:s.textDocument,position:s.position},t),a=(await Promise.all(o.map(l=>ce(e,l,t)))).flat();return fe(ue(n,a))}async function le(e,n,r={}){try{return await e.prepareCallHierarchy(n,r)}catch(t){return m(t),[]}}async function ce(e,n,r={}){try{return await e.outgoingCalls(n,r)}catch(t){return m(t),[]}}async function F(e){if(e===void 0){await R(1e3);return}await P(1e3,e)}function m(e){if(e instanceof A)throw e}function ue(e,n){return n.map(r=>({symbol:r.to.name,file:L(e,r.to.uri),line:r.to.selectionRange.start.line,...r.fromRanges[0]===void 0?{}:{callsiteLine:r.fromRanges[0].start.line}}))}function fe(e){let n=new Set,r=[];for(let t of e){let s=`${t.symbol}\0${t.file}\0${t.line}\0${t.callsiteLine??""}`;n.has(s)||(n.add(s),r.push(t))}return r.sort((t,s)=>t.file.localeCompare(s.file)||t.line-s.line||t.symbol.localeCompare(s.symbol))}function me(e,n){return n===e||n.startsWith(`${e}${N}`)}async function de(){return new Promise((e,n)=>{let r=[];c.stdin.on("data",t=>r.push(t)),c.stdin.on("error",n),c.stdin.on("end",()=>e(Buffer.concat(r).toString("utf8")))})}async function pe(){try{let e=JSON.parse(await de()),n=await G(e);c.stdout.write(JSON.stringify(n))}catch(e){let n={available:!1,reason:e instanceof Error?e.message:String(e),references:[]};c.stdout.write(JSON.stringify(n)),c.exitCode=1}}c.argv[1]&&K(import.meta.url)===c.argv[1]&&pe();export{G as a,W as b,H as c,j as d,Q as e,V as f,X as g,Y as h,ne as i,te as j,re as k,ie as l,se as m,De as n,E as o,ae as p};
|
|
3
|
-
//# sourceMappingURL=chunk-BDUVI7TO.js.map
|
package/dist/chunk-CEEZJXEF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as de,c as Qe,d as Xe}from"./chunk-OSR2GEHQ.js";import{a as rt}from"./chunk-WRQXLNYE.js";import{a as mt,b as ft,c as pt,d as ye,i as V,j as Z,k as dt,l as Q,n as St}from"./chunk-SSK6LDPC.js";import{j as lt}from"./chunk-4WNW27SX.js";import{h as ut}from"./chunk-GAS2LJMP.js";import{b as gt}from"./chunk-WK46TNUM.js";import{b as Ze}from"./chunk-TQZV7KV4.js";import{C as K,I as Ye,K as Ve,T as nt,U as Y,b as me,c as fe,d as z,n as pe,p as Ge,y as Ke}from"./chunk-3L2ZBPEX.js";import{d as et,g as tt,i as Se}from"./chunk-DRENNWRG.js";import{c as ct,d as ge}from"./chunk-BE7ZZTMC.js";import{a as X,b as yt}from"./chunk-NOGJXYFO.js";import{b as ue,d as G,n as $e,p as Je}from"./chunk-RTQ7NEKG.js";import{a as He,d as le}from"./chunk-IW5XQG5G.js";import{f as it,j as st,k as at,l as ot}from"./chunk-FGA2U4OR.js";import{a as je}from"./chunk-B3PYOSCX.js";import{a as ce,c as Be,e as T}from"./chunk-HGFDYOVB.js";import{b as Oe,c as Ne,d as J}from"./chunk-JFMEXGFE.js";import{$ as qe,M as ze,_ as We}from"./chunk-KYSDI3GE.js";import{c as Ue,f as ke,g as Le}from"./chunk-7F45LJKI.js";import{randomUUID as $t}from"crypto";import{existsSync as Jt}from"fs";import{dirname as Gt}from"path";function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(typeof t.available!="boolean"||t.dependencyAvailable!==void 0&&typeof t.dependencyAvailable!="boolean"||t.tsconfigPath!==void 0&&typeof t.tsconfigPath!="string"||t.tsconfigPaths!==void 0&&(!Array.isArray(t.tsconfigPaths)||!t.tsconfigPaths.every(n=>typeof n=="string"))||t.resolvedBinary!==void 0&&typeof t.resolvedBinary!="string"||t.note!==void 0&&typeof t.note!="string")return null;if(t.available===!0){if(t.reason!==void 0)return null}else if(typeof t.reason!="string"||t.reason.length===0)return null;return t}var Kt=12e4,Yt=5;function ht(e,t,n={}){let r=new Re(e,n),i=null,s=null,a=process.env.SCIP_QUERY_SKIP_WATCH_SERVICE==="1",o=()=>(i??=gt(e,t),i),u=(c,m,S)=>{if(a)return S();try{return m(r.request(c))}catch{return a=!0,S()}},l=(c,m)=>u({kind:"references",definitions:[...c],...m?.exact?{exact:!0}:{}},S=>vt(S),()=>o().referencesForDefinitions?.(c,m)??new Map(c.map(S=>[S.symbolId,o().referencesFor(S)]))),p=c=>u({kind:"callees",definitions:[...c]},m=>vt(m),()=>o().calleesForDefinitions?.(c)??new Map(c.map(m=>[m.symbolId,o().calleesFor(m)])));return{language:"typescript",availability:()=>(s??=u({kind:"availability"},Qt,()=>o().availability()),s),importUsage:c=>u({kind:"import-usage",file:c},m=>m,()=>o().importUsage(c)),referencesFor:c=>l([c]).get(c.symbolId)??[],referencesForDefinitions:l,referenceFragmentsForFiles:c=>u({kind:"reference-fragments",files:[...c]},m=>Zt(m),()=>o().referenceFragmentsForFiles?.(c)??new Map),calleesFor:c=>p([c]).get(c.symbolId)??[],calleesForDefinitions:p,signatureFor:c=>u({kind:"signature",definition:c},Xt,()=>o().signatureFor(c)),dispose:()=>i?.dispose?.()}}var Re=class{constructor(t,n={}){this.db=t;this.runtime=n.runtime??tn,this.timeoutMs=n.timeoutMs??en(),this.mailboxLimits=n.mailboxLimits??{},this.cacheDir=Gt(t.config.dbPath),this.projectRoot=ze(t.config.projectRoot)}db;runtime;timeoutMs;cacheDir;projectRoot;mailboxLimits;request(t){let n=ct(this.cacheDir),r=yt(this.cacheDir),i=ge(n.statePath);if(!bt(i,this.projectRoot,this.runtime))throw new Error("Compatible TypeScript semantic service is not running.");let s=this.db.generation.identity;if(!s)throw new Error("Published TypeScript generation identity is unavailable.");let a=this.runtime.now(),o=a+this.timeoutMs,u=(this.runtime.monotonicNow??J)()+this.timeoutMs,l=Be(),p=st("typescript-semantic-v3",{generation:s,profileEnvironment:l,request:t}),c=at(p),m=ot(r,{mailboxVersion:it,operationKey:p,clientId:this.runtime.randomId(),enqueuedAtMs:a,deadlineAtMs:o,protocolVersion:X,id:c,generation:s,profileEnvironment:l,request:t},{nowMs:a,limits:this.mailboxLimits});for(;(this.runtime.monotonicNow??J)()<=u;){if(Jt(m.responsePath))return Vt(Le(m.responsePath,{maxBytes:this.mailboxLimits.maxItemBytes??64*1024*1024,inputKind:"TypeScript semantic mailbox response"}),c,s,p);let S=ge(n.statePath);if(!bt(S,this.projectRoot,this.runtime))throw new Error("TypeScript semantic service stopped while processing a request.");this.runtime.sleep(Yt)}throw new Error(`TypeScript semantic service timed out after ${this.timeoutMs}ms.`)}};function bt(e,t,n){let r=e?.processIdentity?n.readProcessIdentity?.(e.pid):null;return e!==null&&e.projectRoot===t&&e.typescriptSemantic?.protocolVersion===X&&n.isProcessAlive(e.pid)&&(!e.processIdentity||r!=null&&Oe(e.processIdentity,r))}function Vt(e,t,n,r){let i=JSON.parse(e);if(i.protocolVersion!==X||i.id!==t||i.operationKey!==r||i.ok===!0&&i.generation!==n)throw new Error("TypeScript semantic service wrote an incompatible response.");if(i.ok===!0)return i.response;throw new Error(typeof i.error=="string"?i.error:"TypeScript semantic service request failed.")}function vt(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid numeric map.");return new Map(e)}function Zt(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid string map.");return new Map(e)}function Qt(e){let t=Rt(e);if(!t)throw new Error("TypeScript semantic service wrote invalid availability.");return t}function Xt(e){if(e!==null&&typeof e!="string")throw new Error("TypeScript semantic service wrote an invalid signature.");return e}function en(){let e=Number(process.env.SCIP_TYPESCRIPT_SEMANTIC_TIMEOUT_MS);return Number.isInteger(e)&&e>0?e:Kt}var tn={now:Date.now,monotonicNow:J,randomId:$t,sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)},isProcessAlive:je,readProcessIdentity:Ne};function It(e){let t=new Map,n=rn(e),r=new Map;return i=>{let s=nn(i),a=r.get(s);if(a!==void 0)return a;if(!n.has(i.file))return r.set(s,i.symbol),i.symbol;let o=t.get(i.file);o||(o=sn(nt(e,i.file)),t.set(i.file,o));let u=an(o,i);return r.set(s,u),u}}function nn(e){return`${e.file}\0${e.symbol}\0${e.line}`}function rn(e){return new Set(e.all("SELECT relative_path FROM documents").map(t=>t.relative_path))}function sn(e){let t=new Map,n=new Map;for(let r of e){let i=t.get(r.leaf);i?i.push(r):t.set(r.leaf,[r]);let s=n.get(r.startLine);s?s.push(r):n.set(r.startLine,[r])}return{definitions:e,byLeaf:t,byStartLine:n}}function an(e,t){if(e.definitions.length===0)return t.symbol;let n=ln(t.symbol),r=on(e.byLeaf,n),i=cn(r,t.line);if(i)return i.symbol;let s=e.byStartLine.get(t.line)??[];return s.length===1?s[0].symbol:t.symbol}function on(e,t){let n=[],r=new Set;for(let i of t)for(let s of e.get(i)??[])r.has(s.symbolId)||(r.add(s.symbolId),n.push(s));return n}function cn(e,t){let n=null;for(let r of e)if(!(r.startLine>t||r.endLine<t)){if(r.startLine===t)return r;(!n||r.endLine-r.startLine<n.endLine-n.startLine)&&(n=r)}return n}function ln(e){let t=new Set([e]),r=e.split(/::|\.|#/).filter(Boolean).at(-1);return r&&t.add(r),t}function Ct(e,t){let r=Ve(e,t).map(i=>mn(t,i));return{usage:r,positions:fn(e,t,r)}}function Dt(e,t){return{importUsage(n){let r=e.importUsageFacts(n);if(!t||r.positions.length===0)return r.usage;let i=t.importDefinitionsForFile(n,r.positions);return i.available?un(r.usage,i.sourcePaths):r.usage}}}function un(e,t){return e.map((n,r)=>{let i=t.get(String(r));return i?{...n,sourcePath:i}:n})}function mn(e,t){let n=t.isTypeOnly===!0,r=t.kind==="side-effect"||n||t.used;return{importer:e,sourcePath:t.sourcePath,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:n,isUsed:r,isTypeUsed:n,isValueUsed:t.kind==="side-effect"||!n&&t.used,references:[]}}function fn(e,t,n){let r=Ke(e,t);if(!r)return[];let i=pn(r.rootNode),s=new Map;for(let o of i){let u=s.get(ve(o.importedName,o.localName));u?u.push(o.position):s.set(ve(o.importedName,o.localName),[o.position])}let a=[];return n.forEach((o,u)=>{let l=s.get(ve(o.importedName,o.localName??o.importedName))?.shift();l&&a.push({...l,id:String(u),file:t})}),a}function pn(e){let t=[];for(let n of e.descendantsOfType("use_declaration")){let r=n.namedChildren.find(i=>i.type!=="visibility_modifier");r&&t.push(...ee(r,""))}return t.filter(n=>n.importedName!=="*")}function ee(e,t){switch(e.type){case"identifier":case"super":case"self":case"crate":return[{importedName:e.text,localName:e.text,position:be(e,e.text)}];case"scoped_identifier":{let n=e.text.split("::").pop()??e.text;return[{importedName:n,localName:n,position:be(e,n)}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Ye(t,n.text);return r.namedChildren.flatMap(s=>ee(s,i))}case"use_list":return e.namedChildren.flatMap(n=>ee(n,t));case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);return!n||!r?[]:ee(n,t).map(i=>({...i,localName:r.text}))}case"use_wildcard":{let n=e.namedChild(0),r="*";return[{importedName:r,localName:r,position:be(n??e,r)}]}default:return[]}}function be(e,t){let n=Math.max(0,e.text.lastIndexOf(t));return{id:"",file:"",line:e.startPosition.row,column:e.startPosition.column+n+dn(t)}}function dn(e){return Math.max(0,Math.min(e.length-1,1))}function ve(e,t){return`${e}\0${t}`}import{spawnSync as he}from"child_process";import{existsSync as Ie}from"fs";import{fileURLToPath as Sn}from"url";var Ce=15e3,De=8;function wt(e,t={}){let n=t.status??pt,r=Rn(e,n),i=bn(e,n),s=vn(e,n),a=t.referenceResolver||t.calleeResolver||t.signatureResolver||!gn(t)?null:dt(e,n,{fallbackReferenceResolver:r,fallbackCalleeResolver:i,fallbackSignatureResolver:s}),o=t.referenceResolver??a??r,u=t.calleeResolver??a??i,l=t.signatureResolver??a??s,p=t.importUsageResolver??Dt(t.sourceImportUsageResolver??yn(),t.importDefinitionResolver??a),c=t.calleeSymbolResolver,m=t.sourceZeroCalleeOracle,S=t.scipOccurrenceCalleeOracle,M=new Map,D=new Map,A=null,v=null,x=()=>(A??=n(e),A),w=()=>{let g=x();return g.dependencyAvailable?v??g:g},y=g=>{if(g.length===0)return new Map;let f=q(g);try{let d=o.referencesForDefinitions(f),R=x();return v=te(R,d),d.available?new Map(d.references):V(f,d.references)}catch(d){let R=x();return v=W(R,d),L(f)}},I=g=>{if(g.length===0)return new Map;let f=q(g),d=f.filter(Mt);if(d.length===0)return O(f);let R=new Map,U=Pt(d,S),E=[];for(let b of d)D.has(b.symbolId)?R.set(b.symbolId,D.get(b.symbolId)??[]):U.has(b.symbolId)?R.set(b.symbolId,U.get(b.symbolId)??[]):xt(b,m)?R.set(b.symbolId,[]):E.push(b);if(E.length===0)return N(f,R,void 0);try{let b=u.calleesForDefinitions(E),F=x();v=te(F,b);let P=N(E,b.callees,c);for(let[j,se]of P)R.set(j,se);return N(f,R,void 0)}catch(b){let F=x();return v=W(F,b),O(f)}},C=(g,f)=>{let d=q(g),R=q(f),U=R.filter(Mt),E=new Map,b=Pt(U,S),F=[];for(let P of U)b.has(P.symbolId)?E.set(P.symbolId,b.get(P.symbolId)??[]):xt(P,m)?E.set(P.symbolId,[]):F.push(P);if(d.length===0&&F.length===0)return{references:L(d),callees:N(R,E,void 0)};try{let P=a?a.referencesAndCalleesForDefinitions(d,F):Dn(o,u,{referenceDefinitions:d,calleeDefinitions:F}),j=x();v=te(j,P);let se=P.available?new Map(P.references):V(d,P.references);for(let[ae,oe]of P.callees)E.set(ae,oe);let _e=N(R,E,c);for(let[ae,oe]of _e)D.set(ae,oe);return{references:se,callees:_e}}catch(P){let j=x();return v=W(j,P),{references:L(d),callees:O(R)}}},h=g=>{if(g.length===0)return new Map;let f=q(g);try{let d=l.signaturesForDefinitions(f),R=x();return v=te(R,d),Tt(f,d.signatures)}catch(d){let R=x();return v=W(R,d),ne(f)}};return{language:"rust",availability:w,dispose:()=>{a?.dispose()},importUsage:g=>{let f=M.get(g);if(f)return f;try{let d=p.importUsage(g);return M.set(g,d),d}catch(d){let R=x();return v=W(R,d),[]}},referencesFor:g=>y([g]).get(g.symbolId)??[],referencesForDefinitions:y,referencesAndCalleesForDefinitions:C,calleesFor:g=>I([g]).get(g.symbolId)??[],calleesForDefinitions:I,signatureFor:g=>h([g]).get(g.symbolId)??null}}function te(e,t){let n={dependencyAvailable:e.dependencyAvailable,resolvedBinary:t.resolvedBinary??e.resolvedBinary,...e.note?{note:e.note}:{}};return t.available?{available:!0,...n}:{available:!1,reason:t.reason,...n}}function W(e,t){return{available:!1,dependencyAvailable:e.dependencyAvailable,resolvedBinary:e.resolvedBinary,...e.note?{note:e.note}:{},reason:t instanceof Error?t.message:String(t)}}function gn(e){if(e.usePersistentSession!==void 0)return e.usePersistentSession;let t=process.env.SCIP_RUST_SEMANTIC_SESSION;return t!=="0"&&t!=="false"}function yn(){return{importUsageFacts:()=>({usage:[],positions:[]})}}function q(e){return e.map(t=>{let n=t;return{...t,leaf:typeof n.leaf=="string"?n.leaf:et(t.symbol),parentTypeName:n.parentTypeName??null,isFunctionLike:typeof n.isFunctionLike=="boolean"?n.isFunctionLike:tt(t.symbol),isTypeLike:n.isTypeLike??!1,kind:n.kind??null,documentation:n.documentation??null,enclosingSymbol:n.enclosingSymbol??null}})}function Mt(e){return e.isFunctionLike}function xt(e,t){if(!t)return!1;try{return t(e)}catch{return!1}}function Pt(e,t){if(!t||e.length===0)return new Map;try{return t(e)}catch{return new Map}}function Rn(e,t){return{referencesForDefinitions:n=>hn(e,t,n)}}function bn(e,t){return{calleesForDefinitions:n=>In(e,t,n)}}function vn(e,t){return{signaturesForDefinitions:n=>Cn(e,t,n)}}function hn(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),references:L(n)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,references:L(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Ce),a=re(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),o=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,De),u=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!0}),p={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,...a>0?{referenceRetryTimeoutMs:a}:{},diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:o},c=he(process.execPath,[i],{cwd:e,input:JSON.stringify(p),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,St(s,p.referenceRetryTimeoutMs),o)}),m=we(c.stdout);if(m)return{...xe(m),resolvedBinary:r.resolvedBinary,references:V(n,new Map(m.references),new Set(m.incompleteReferenceSymbolIds??[]))};let S=c.error instanceof Error?c.error.message:c.stderr.trim()||`Rust semantic worker exited with status ${c.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:S,references:L(n)}}function In(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),callees:O(n)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,callees:O(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Ce),a=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,De),o=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),u=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!1,includeCallees:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,diagnosticsTimeoutMs:o,settleDelayMs:u,concurrency:a,includeReferences:!1,includeCallees:!0},p=he(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,s,a)}),c=we(p.stdout);if(c)return{...xe(c),resolvedBinary:r.resolvedBinary,callees:N(n,new Map(c.callees??[]),void 0)};let m=p.error instanceof Error?p.error.message:p.stderr.trim()||`Rust semantic worker exited with status ${p.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:m,callees:O(n)}}function Cn(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),signatures:ne(n)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,signatures:ne(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Ce),a=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,De),o=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),u=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!1,includeCallees:!1,includeSignatures:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,diagnosticsTimeoutMs:o,settleDelayMs:u,concurrency:a,includeReferences:!1,includeCallees:!1,includeSignatures:!0},p=he(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,s,a)}),c=we(p.stdout);if(c)return{...xe(c),resolvedBinary:r.resolvedBinary,signatures:Tt(n,new Map(c.signatures??[]))};let m=p.error instanceof Error?p.error.message:p.stderr.trim()||`Rust semantic worker exited with status ${p.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:m,signatures:ne(n)}}function Dn(e,t,n){let r=n.referenceDefinitions.length>0?e.referencesForDefinitions(n.referenceDefinitions):{available:!0,references:L(n.referenceDefinitions)},i=n.calleeDefinitions.length>0?t.calleesForDefinitions(n.calleeDefinitions):{available:!0,callees:O(n.calleeDefinitions)},s={resolvedBinary:r.resolvedBinary??i.resolvedBinary,references:r.references,callees:i.callees};return r.available&&i.available?{available:!0,...s}:{available:!1,reason:(r.available?void 0:r.reason)??(i.available?void 0:i.reason)??"Rust semantic resolution was unavailable.",...s}}function L(e){return new Map(e.map(t=>[t.symbolId,[]]))}function O(e){return new Map(e.map(t=>[t.symbolId,[]]))}function ne(e){return new Map(e.map(t=>[t.symbolId,null]))}function N(e,t,n){let r=0,i=0;return T("rust.semantic.callees.complete-map",()=>{let s=new Map;for(let a of e){let o=t.get(a.symbolId)??[];o.length>0&&(r+=1),i+=o.length,s.set(a.symbolId,o.map(u=>({...u,symbol:n?n(u):u.symbol})))}return s},()=>({definitions:e.length,rows:r,callees:i,resolveSymbols:!!n}))}function Tt(e,t){return new Map(e.map(n=>[n.symbolId,t.get(n.symbolId)??null]))}function Me(){return Sn(new URL("./rust-semantic-worker.js",import.meta.url))}function xe(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function Pe(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function we(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(typeof n.available!="boolean"||!Array.isArray(n.references)||n.available===!1&&typeof n.reason!="string"||n.available===!0&&n.reason!==void 0)return null;let r={references:n.references,incompleteReferenceSymbolIds:Array.isArray(n.incompleteReferenceSymbolIds)?n.incompleteReferenceSymbolIds.filter(i=>typeof i=="number"):void 0,callees:Array.isArray(n.callees)?n.callees:void 0,signatures:Array.isArray(n.signatures)?n.signatures:void 0};return n.available===!0?{available:!0,...r}:{available:!1,reason:String(n.reason),...r}}catch{return null}}function B(e,t){return lt(e)??t}function re(e,t){if(!e)return t;let n=Number(e);return Number.isInteger(n)&&n>=0?n:t}import{existsSync as Mn}from"fs";import{deserializeSCIP as xn,SymbolRole as Pn}from"@c4312/scip";var Te=new WeakMap;function Et(e,t){let n=t.filter(wn);if(n.length===0)return new Map;let r=!1,i=0,s=0;return T("rust.scip-occurrence.callees",()=>{let a=En(e);if(r=!!a,!a)return new Map;let o=new Map;for(let u of n){let l=Tn(e,a,u);l!==null&&(o.set(u.symbolId,l),i+=1,s+=l.length)}return o},()=>({definitions:t.length,candidates:n.length,indexAvailable:r,resolvedDefinitions:i,resolvedCallees:s}))}function wn(e){return!(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||!e.isFunctionLike||e.leaf==="main"||Se(e.symbol))}function Tn(e,t,n){let r=K(e,n.relativePath);if(!r||r.language!=="rust")return null;let i=r.callables.find(l=>l.startLine!==n.startLine||l.endLine!==n.endLine?!1:l.name===n.leaf||n.leaf.endsWith(l.name)||l.name.endsWith(n.leaf));if(!i)return null;let s=r.callSites.filter(l=>l.line>=i.startLine&&l.line<=i.endLine);if(s.length===0)return null;let a=(t.occurrencesByFile.get(n.relativePath)??[]).filter(l=>l.line>=i.startLine&&l.line<=i.endLine&&l.callee.symbol!==n.symbol);if(a.some(l=>l.traitImplMember)||!An(s,a))return null;let o=[],u=new Set;for(let l of a){let p=`${l.callee.symbol}\0${l.callee.file}\0${l.callee.line}`;u.has(p)||(u.add(p),o.push(l.callee))}return o}function An(e,t){let n=At(e),r=At(t);if(n.size!==r.size)return!1;for(let[i,s]of n)if(r.get(i)!==s)return!1;return!0}function At(e){let t=new Map;for(let n of e){let r=n.calleeLeaf??n.leaf;if(!r)continue;let i=`${n.line}\0${r}`;t.set(i,(t.get(i)??0)+1)}return t}function En(e){if(Te.has(e))return Te.get(e)??null;let t=Fn(e);return Te.set(e,t),t}function Fn(e){if(!e.generation.indexPath||!Mn(e.generation.indexPath))return null;try{let t=Y(e).filter(s=>s.symbol.startsWith("rust-analyzer ")&&s.relativePath.endsWith(".rs")&&s.isFunctionLike),n=new Map(t.map(s=>[s.symbol,s])),r=xn(ke(e.generation.indexPath,{inputKind:"SCIP occurrence-callee index",maxBytes:Ue})),i=new Map;for(let s of r.documents??[]){let a=s.relativePath;if(!a||!a.endsWith(".rs")||e.isIgnored(a))continue;let o=[];for(let u of s.occurrences??[]){if(!u.symbol||(u.symbolRoles&Pn.Definition)!==0)continue;let l=n.get(u.symbol);if(!l)continue;let p=u.range?.[0];Number.isInteger(p)&&o.push({line:p,leaf:l.leaf,traitImplMember:Se(l.symbol),callee:{symbol:l.symbol,file:l.relativePath,line:l.startLine,callsiteLine:p}})}i.set(a,o)}return{occurrencesByFile:i}}catch{return null}}var ie=class{sessions=new WeakMap;getOrCreate(t,n,r){let i=_n(t,n),s=this.sessions.get(t);s||(s=new Map,this.sessions.set(t,s));let a=s.get(i);if(a)return a.hits+=1,a.lastUsedAtMs=Date.now(),a.provider;let o=Date.now(),u=r();return s.set(i,{key:i,language:n,projectRoot:t.config.projectRoot,provider:u,createdAtMs:o,lastUsedAtMs:o,hits:1}),u}sessionsFor(t){return[...this.sessions.get(t)?.values()??[]]}clear(t){let n=this.sessions.get(t);if(n)for(let r of n.values())r.provider.dispose?.();this.sessions.delete(t)}};function _n(e,t){return`${e.config.projectRoot}:${t}-workspace`}var Ft=new ie;He({name:"semantic-provider",groups:["semantic-provider"],clearAll:e=>Ft.clear(e)});function H(e,t){let n=_(t)??"typescript";return Ft.getOrCreate(e,n,()=>n==="rust"?wt(e.config.projectRoot,{sourceImportUsageResolver:{importUsageFacts:r=>Ct(e,r)},calleeSymbolResolver:It(e),sourceZeroCalleeOracle:r=>Un(e,r),scipOccurrenceCalleeOracle:r=>Et(e,r)}):ht(e,t))}function _(e){return e?Ge(e)==="rust"?"rust":Ze(e)?"typescript":null:"typescript"}function Un(e,t){let n=K(e,t.relativePath);if(!n||n.language!=="rust")return!1;let r=n.callables.find(i=>i.startLine===t.startLine&&i.endLine===t.endLine&&i.name===t.leaf)??n.callables.find(i=>i.startLine===t.startLine&&i.endLine===t.endLine);return r?!n.callSites.some(i=>i.line>=r.startLine&&i.line<=r.endLine):!1}var kn=/^[A-Za-z_][A-Za-z0-9_]*$/,_t=/\bDefault::default\b/g,Ln=/^\.\.\s*Default::default\b/;function Ut(e,t){let n=new Map,r=new Map;for(let i of t){let s=Ae(e,i,r);s!==null&&n.set(i.symbolId,s)}return n}function Ae(e,t,n=new Map){let r=Nn(t.symbol);if(!r)return null;let i=rt(e,[t.symbolId]);if(i.length===0)return null;let s=new RegExp(`(^|[^A-Za-z0-9_])${pe(r)}::default\\b`,"g"),a=new RegExp(`(^|[^A-Za-z0-9_])${pe(r)}\\s*$`),o=On(e,t.symbolId),u=[];for(let l of i){let p=Bn(e,l.relative_path,n);if(p===null)return null;let c=p.split(/\r?\n/),m=0,S=[],M=0;for(let D=l.chunk_start;D<=l.chunk_end&&D<c.length;D+=1){let v=c[D]??"",x=new Set;s.lastIndex=0;let w;for(;w=s.exec(v);)u.push({file:l.relative_path,line:D,column:w.index+w[1].length+r.length+2}),M+=1;for(let y=0;y<v.length;y+=1){let I=Ln.exec(v.slice(y));if(I){if(o&&S.includes(m)){let h=y+I[0].lastIndexOf("default");u.push({file:l.relative_path,line:D,column:h}),x.add(h),M+=1}y+=I[0].length-1;continue}let C=v[y];if(C==="{"){let h=a.test(v.slice(0,y));m+=1,h&&S.push(m);continue}if(C==="}")for(m=Math.max(0,m-1);S.length>0&&S[S.length-1]>m;)S.pop()}for(_t.lastIndex=0;w=_t.exec(v);){let y=w.index+9;if(!x.has(y))return null}}if(M===0)return null}return ut(u)}function On(e,t){return e.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",t)?.present===1}function Nn(e){let t=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(e)?.[1]??null;return!t||!kn.test(t)?null:t}function Bn(e,t,n){if(n.has(t))return n.get(t)??null;let r=e.get("SELECT text FROM documents WHERE relative_path = ?",t),i=typeof r?.text=="string"?r.text:jn(e,t);return n.set(t,i),i}function jn(e,t){try{return We(e.config.projectRoot,t,{inputKind:"indexed Rust source file"})}catch(n){if(!qe(n))throw n;return null}}function kt(e){let t=new Map;for(let n of e){let r=t.get(n.relativePath)??[];r.push(n),t.set(n.relativePath,r)}return t}var zn="typescript-import-usage-v1",Wn="typescript-signatures-v1",Ee=le("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),Lt=fe({kind:"semantic-import-usage",invalidation:z("semantic-import-usage"),serialize:e=>JSON.stringify(e),deserialize:qt}),Ot=fe({kind:"semantic-signatures",invalidation:z("semantic-signatures"),serialize:e=>JSON.stringify(e),deserialize:nr}),Nt=me({kind:"typescript-import-usage",invalidation:z("typescript-import-usage"),serialize:e=>JSON.stringify(e),deserialize:qt}),Bt=me({kind:"typescript-signatures",invalidation:z("typescript-signatures"),serialize:e=>JSON.stringify(e),deserialize:rr});var qn=le("typescript-reference-map",{clearGroups:["whole-project"]});function Hn(e){return qn.get(e,()=>{let t=G(e);if(!t)return null;let n=Y(e).filter(i=>_(i.relativePath)==="typescript"),r=Xe(e,n,i=>H(e,i));return r?{projectFingerprint:t,references:r.references,files:r.files,cacheHits:r.cacheHits,cacheMisses:r.cacheMisses,computedFiles:r.computedFiles}:null})}function Fe(e){let t=new Map,n=new Set;return{capability:(r,i)=>Ht(e,r,i),importUsage:r=>Jn(e,r),references:r=>Gn(e,r),materializeReferences:(r,i)=>zt(e,r,t,n,i),callerMap:r=>Kn(e,r,t,n),calleeMap:r=>Xn(e,r),signature:r=>er(e,r)}}function $n(e,t){if(t.size===0)return;let n=Ee.get(e,()=>new Map);for(let[r,i]of t)n.set(r,[...i])}function Ii(e,t){if(!Ee.has(e))return{hits:[],misses:[...t]};let n=Ee.get(e,()=>new Map),r=[],i=[];for(let s of t)n.has(s.symbolId)?r.push({definition:s,callees:n.get(s.symbolId)??[]}):i.push(s);return{hits:r,misses:i}}function Ci(e,t){return Fe(e).importUsage(t)}function Jn(e,t){if(_(t)==="typescript"){let s="fallback",a=0,o=0,u=0,l=0;return T("typescript.import-usage.materialize",()=>{let p=de(e,t,zn);if(p?.key){a=1;let m=Nt.read(e,t,p.key);if(m)return s="hit",o=1,m;u=1;let S=k(e,t);if(!S)return s="unavailable",[];let M=S.importUsage(t);return Nt.write(e,t,p.key,M),s="computed",M}l=1;let c=k(e,t);return c?(s="direct-fallback",c.importUsage(t)):(s="unavailable",[])},()=>({state:s,eligible:a,cacheHits:o,cacheMisses:u,fallbacks:l}))}let n=Wt(e,"semantic-import-usage",t);if(n){let s=Lt.read(e,t,n);if(s)return s}let r=k(e,t);if(!r)return[];let i=r.importUsage(t);return n&&Lt.write(e,t,n,i),i}function Di(e,t){return Fe(e).references(t)}function Gn(e,t){let n=Ae(e,t);if(n)return n;let r=ft(e,t);if(r)return r;let i=k(e,t.relativePath);return i?i.referencesFor(t):[]}function Kn(e,t,n=new Map,r=new Set){let i=new Map,s=zt(e,t,n,r),a=0;return T("semantic.callers.from-references",()=>{for(let o of t)a+=Zn(e,i,o,n.get(o.symbolId)??[])},()=>({definitions:t.length,materialized:s.definitions,inMemoryHits:s.inMemoryHits,incompleteInMemoryHits:s.incompleteInMemoryHits,resultRows:i.size,callerFiles:a})),i}function zt(e,t,n,r,i={}){let s=G(e),a=[],o=[],u=[],l=0,p=0,c=0,m=0,S=0,M=0,D=0,A=0,v=0,x=0,w=0,y=0,I=[],C=new Map,h=t.filter(f=>_(f.relativePath)==="typescript"&&!n.has(f.symbolId)&&!r.has(f.symbolId)),g=h.length>0?Hn(e):null;if(g){v=h.length,x=g.cacheHits,w=g.cacheMisses,y=g.computedFiles;for(let f of h)n.set(f.symbolId,g.references.get(f.symbolId)??[])}if(T("semantic.references.cache-scan",()=>{for(let[f,d]of kt(t)){let R=[];for(let b of d)n.has(b.symbolId)?p+=1:r.has(b.symbolId)?A+=1:R.push(b);if(R.length===0){D+=1;continue}let U=Yn(e,s,f);if(!U){for(let b of R)_(b.relativePath)||(l+=1),u.push(b);continue}M+=1;let E=$e(e,f,U);for(let b of R){let F=E.get(b.symbol)??null;if(F!==null){let P=Qn(F);if(P){c+=1,n.set(b.symbolId,P);continue}m+=1}o.push({definition:b,cacheFingerprint:U})}}},()=>({definitions:t.length,skippedUnsupportedLanguage:l,cacheHits:c,parseFailures:m,misses:o.length,unkeyed:u.length,inMemoryHits:p,incompleteInMemoryHits:A,fullyInMemoryFiles:D,cacheReadFiles:M})),o.length>0||u.length>0){I=[...u,...o.map(f=>f.definition)],C=T("semantic.references.compute-misses",()=>{let f=Vn(e,I,i);return S=f.size,f},()=>({definitions:I.length,misses:o.length,unkeyed:u.length,rows:S}));for(let f of I)C.has(f.symbolId)?(n.set(f.symbolId,C.get(f.symbolId)??[]),r.delete(f.symbolId)):r.add(f.symbolId);for(let{definition:f,cacheFingerprint:d}of o)C.has(f.symbolId)&&Ht(e,"semantic-references",f.relativePath).available&&a.push({relativePath:f.relativePath,symbol:f.symbol,projectFingerprint:d,payload:JSON.stringify(C.get(f.symbolId)??[])})}return a.length>0&&T("semantic.references.cache-write",()=>Je(e,a),()=>({entries:a.length})),C.size>0&&Qe(e,I,C,f=>H(e,f)),{definitions:t.length,inMemoryHits:p,incompleteInMemoryHits:A,cacheHits:c,misses:o.length,unkeyed:u.length,skippedUnsupportedLanguage:l,parseFailures:m,computed:S,incomplete:r.size,cacheWrites:a.length,fragmentDefinitions:v,fragmentCacheHits:x,fragmentCacheMisses:w,fragmentComputedFiles:y}}function Yn(e,t,n){if(!t)return null;let r=_(n);return r==="typescript"?t:r==="rust"?ue(JSON.stringify({kind:"semantic-references",language:r,engine:ye(e.config.projectRoot),projectFingerprint:t})):null}function Vn(e,t,n={}){let r=ce(),i=new Map,s=0,a=0,o=0,u=0,l=0,p=0,c=0,m=0,S=0;return T("semantic.references.provider-loop",()=>{let M=Ut(e,t),D=mt(e,t),A=new Map,v=n.prefetchCallees?new Map:null,x=[];for(let y of t){let I,C=()=>(I??=k(e,y.relativePath),I);if(v){let d=C();if(d?.referencesAndCalleesForDefinitions){let R=v.get(d);R?R.push(y):v.set(d,[y]),S+=1}}let h=M.get(y.symbolId);if(h){o+=1,u+=h.length,$(i,y.symbolId,h,r,d=>{c+=1,m+=d});continue}let g=D.get(y.symbolId);if(g){l+=1,p+=g.length,$(i,y.symbolId,g,r,d=>{c+=1,m+=d});continue}let f=C();if(!f){r&&(a+=1);continue}if(r&&(s+=1),f.referencesForDefinitions){let d=A.get(f);d?d.push(y):A.set(f,[y])}else x.push({provider:f,definition:y})}let w=new Set;if(v)for(let[y,I]of v){if(!y.referencesAndCalleesForDefinitions)continue;let C=A.get(y)??[],h=y.referencesAndCalleesForDefinitions(C,I);w.add(y),$n(e,h.callees);for(let g of C){if(!h.references.has(g.symbolId))continue;let f=h.references.get(g.symbolId)??[];$(i,g.symbolId,f,r,d=>{c+=1,m+=d})}}for(let[y,I]of A){if(w.has(y))continue;let C=y.referencesForDefinitions(I);for(let h of I){if(!C.has(h.symbolId))continue;let g=C.get(h.symbolId)??[];$(i,h.symbolId,g,r,f=>{c+=1,m+=f})}}for(let{provider:y,definition:I}of x){let C=y.referencesFor(I);$(i,I.symbolId,C,r,h=>{c+=1,m+=h})}return i},()=>({definitions:t.length,providerHits:s,providerMisses:a,rustDefaultFastPathRows:o,rustDefaultFastPathReferences:u,rustScipOccurrenceFastPathRows:l,rustScipOccurrenceFastPathReferences:p,prefetchCalleeDefinitions:S,definitionsWithReferences:c,referenceCount:m,rows:i.size}))}function $(e,t,n,r,i){e.set(t,n),r&&n.length>0&&i(n.length)}function Zn(e,t,n,r){let i=0;for(let s of r){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let a=t.get(n.symbolId);a||(a=new Set,t.set(n.symbolId,a));let o=a.size;a.add(s.file),a.size!==o&&(i+=1)}return i}function Qn(e){try{return JSON.parse(e)}catch{return null}}function Mi(e,t){return Fe(e).calleeMap(t)}function Xn(e,t){let n=ce(),r=new Map,i=0,s=0,a=0,o=0;return T("semantic.callees.provider-loop",()=>{let u=new Map,l=[];for(let p of t){let c=k(e,p.relativePath);if(!c){n&&(s+=1);continue}n&&(i+=1);let m=p;if(c.calleesForDefinitions){let S=u.get(c);S?S.push(m):u.set(c,[m])}else l.push({provider:c,definition:m})}for(let[p,c]of u){let m=p.calleesForDefinitions(c);for(let S of c){let M=m.get(S.symbolId)??[];jt(r,S.symbolId,M,n,D=>{a+=1,o+=D})}}for(let{provider:p,definition:c}of l){let m=p.calleesFor(c);jt(r,c.symbolId,m,n,S=>{a+=1,o+=S})}return r},()=>({definitions:t.length,providerHits:i,providerMisses:s,definitionsWithCallees:a,calleeCount:o,rows:r.size}))}function jt(e,t,n,r,i){n.length>0&&(e.set(t,n),r&&i(n.length))}function er(e,t){if(_(t.relativePath)==="typescript"){let a="fallback",o=0,u=0,l=0,p=0;return T("typescript.signature.materialize",()=>{let c=de(e,t.relativePath,Wn);if(c?.key){o=1;let S=Bt.read(e,t.relativePath,c.key)??{};if(Object.prototype.hasOwnProperty.call(S,t.symbol))return a="hit",u=1,S[t.symbol]??null;l=1;let M=k(e,t.relativePath);if(!M)return a="unavailable",null;let D=M.signatureFor(t);return Bt.write(e,t.relativePath,c.key,{...S,[t.symbol]:D}),a="computed",D}p=1;let m=k(e,t.relativePath);return m?(a="direct-fallback",m.signatureFor(t)):(a="unavailable",null)},()=>({state:a,eligible:o,cacheHits:u,cacheMisses:l,fallbacks:p}))}let n=Wt(e,"semantic-signatures",t.relativePath),r=tr(t);if(n){let a=Ot.read(e,r,n);if(a)return a.signature}let i=k(e,t.relativePath);if(!i)return null;let s=i.signatureFor(t);return n&&Ot.write(e,r,n,{signature:s}),s}function Wt(e,t,n){let r=G(e);if(!r)return null;let i=_(n);return i!=="rust"?null:ue(JSON.stringify({kind:t,language:i,engine:ye(e.config.projectRoot),projectFingerprint:r}))}function tr(e){return`${e.relativePath}\0${e.symbol}`}function qt(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function nr(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t.signature;return n!==null&&typeof n!="string"?null:{signature:n}}catch{return null}}function rr(e){try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;for(let n of Object.values(t))if(n!==null&&typeof n!="string")return null;return t}catch{return null}}function Ht(e,t,n){let r=_(n);if(!r)return{slot:t,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:t,language:r,...H(e,n).availability()}}catch(i){return{slot:t,language:r,available:!1,reason:i instanceof Error?i.message:String(i)}}}function k(e,t){if(!_(t))return null;let n=H(e,t);return n.availability().available?n:null}export{kt as a,H as b,_ as c,Fe as d,Ii as e,Ci as f,Di as g,Vn as h,Mi as i};
|
|
2
|
-
//# sourceMappingURL=chunk-CEEZJXEF.js.map
|
package/dist/chunk-CJZXN4NU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-W7CXK74K.js";import{d as fe}from"./chunk-E73UNJTF.js";import{b as te,d as oe,e as re,f as ae,g as se,h as le,j as T,k as ce,l as _}from"./chunk-DYGHBZ2N.js";import{d as ie}from"./chunk-KK7GPALL.js";import{f as ee,h as ne}from"./chunk-XRYABF57.js";import{b as C}from"./chunk-NJITK2GP.js";import{b as Q}from"./chunk-TEBQMNVI.js";import{a as U,e as W,g as P,h as A,j as X,k as Y,t as v,u as J,v as Z,w as $,x as N}from"./chunk-N2ZSIIGR.js";import{t as z,v as S}from"./chunk-ODDUPDP7.js";import{A as O,N as H,a as M,z as y}from"./chunk-ZOHS7AQV.js";import{h as B,m as D}from"./chunk-FESCRNVV.js";import{d as w,y as G}from"./chunk-JWTGMPIT.js";function j(n,e,t={}){let i=new Map;if(e&&e.length===0)return i;let r=M(n,{includeIgnored:!1}),o=ae(n),a=e??J(n),f=new Set(a.map(m=>m.symbolId)),c=Ce(a);return ge(n,i,r,o,f,c),he(n,i,a,f),ve(n,i,r,o,f,c),t.semantic!==!1&&t.semanticEvidence&&Le(i,t.semanticEvidence.callerMap(n,Ie(a))),i}function ge(n,e,t,i,r,o){for(let a of t){if(!y(a))continue;let f=z(n,a);if(f)for(let c of f){if(o&&!o.has(c.calleeLeaf))continue;let m=oe(a,i.get(c.calleeLeaf)??[]);if(!m||m.length===0)continue;let s=re(n,a,m,c.memberAccess,c.calleeQualifier);s&&r.has(s.symbolId)&&s.file!==a&&K(e,s.symbolId,a)}}}function he(n,e,t,i){let r=Me(t);for(let o of Re(n,i))n.isIgnored(o.relative_path)||De(o,r.get(o.symbol_id))||K(e,o.symbol_id,o.relative_path)}function Re(n,e){return ie(n,e?[...e]:void 0)}function Me(n){let e=new Map;for(let t of n)e.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return e}function De(n,e){return!!e&&e.docId===n.document_id&&n.chunk_start>=e.startLine&&n.chunk_end<=e.endLine}function ve(n,e,t,i,r,o){for(let a of t){if(y(a)!=="rust")continue;let f=S(n,a,{includeRustAttributeNames:!0});if(f.length!==0)for(let{name:c}of f){if(o&&!o.has(c))continue;let m=i.get(c);if(m)for(let s of m)r.has(s.symbolId)&&s.file!==a&&K(e,s.symbolId,a)}}}function K(n,e,t){let i=n.get(e);i||(i=new Set,n.set(e,i)),i.add(t)}function Ce(n){let e=new Set;for(let t of n){let i="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?W(t.symbol):"";i&&e.add(i)}return e.size>0?e:null}function Ie(n){return n.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function Le(n,e){for(let[t,i]of e){let r=n.get(t);r||(r=new Set,n.set(t,r));for(let o of i)r.add(o)}}var Fe=w("cross-file-caller-files",{clearGroups:["whole-project","source-file"]}),xe=w("source-fallback-caller-files",{clearGroups:["whole-project","source-file"]});function ue(n,e,t){let i=e.filter(o=>!n.has(o.symbolId));if(i.length>0){let o=t(i);for(let a of i)n.set(a.symbolId,o.get(a.symbolId)??new Set)}let r=new Map;for(let o of e){let a=n.get(o.symbolId);a&&a.size>0&&r.set(o.symbolId,new Set(a))}return r}function q(n,e,t={}){if(e===void 0)return j(n,e,t);let i=ue(Fe.get(n,()=>new Map),e,r=>j(n,r,{semantic:!1}));return t.semantic===!1||!t.semanticEvidence?i:me(i,t.semanticEvidence.callerMap(n,e.filter(r=>"relativePath"in r&&"symbol"in r&&"leaf"in r)))}function V(n,e,t={}){return t.skipPath?_(n,e,t):ue(xe.get(n,()=>new Map),e,i=>_(n,i))}function de(n,e,t={}){let i=q(n,e,{semantic:t.semantic,semanticEvidence:t.semanticEvidence});return t.sourceFallback===!1?i:me(i,V(n,e))}function me(n,e){let t=new Map;for(let[i,r]of n)t.set(i,new Set(r));for(let[i,r]of e){let o=t.get(i)??new Set;for(let a of r)o.add(a);t.set(i,o)}return t}function be(n,e,t){let i=e.identifierResolution==="strict"?T:ce,r=e.candidateNames?se(e.candidateNames):null,o=0,a=0,f=0,c=0,m="";for(let s of e.paths)if(o+=1,m=s,!(!y(s)&&!(e.includeVueSfc&&O(s)))&&!n.isIgnored(s)&&!e.skipPath?.(s))try{if(r&&!le(B(n,s),r))continue;a+=1;let h=(u,b,k,g)=>{if(e.candidateNames&&!e.candidateNames.has(u))return;f+=1;let R=e.resolveTargets?e.resolveTargets({sourceFile:s,name:u,kind:b,defaultTargets:g}):g();for(let E of R)c+=1,t({sourceFile:s,name:u,target:E,occurrences:k,kind:b})},x=te(n,s);for(let[u,b]of x)h(u,"identifier",b.length,()=>i(n,s,u));for(let u of S(n,s,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let b=u.kind==="cross-language-dispatch"?()=>T(n,s,u.name):()=>i(n,s,u.name);h(u.name,u.kind,u.occurrences,b)}}finally{e.afterPath?.(s),o%10===0&&G("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:m,candidateMatchedPaths:a,visitedNames:f,visitedHits:c}))}}function pe(n,e={}){let{scope:t,files:i,minLoc:r=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:a,excludeEntrySurfaces:f=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:m=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:F=!1,excludeRustTraitImplMembers:h=!1,includeSuppressed:x=!1,sortByLocDesc:u=!1}=e,b=[],k=ke(n,{scope:t,files:i,requireFunctionLikeSymbol:s,requireCallableSymbol:F}),g=new Map,R=new Map,E=l=>{let d=g.get(l);if(d!==void 0)return d;let p=ee(n,l);return g.set(l,p),p},Se=l=>{let d=R.get(l);if(d!==void 0)return d;let p=C(l);return R.set(l,p),p};for(let l of k){let d=l.relativePath;if(n.isIgnored(d)||f&&E(d)||!Ee(l,{requireFunctionLikeSymbol:s,requireCallableSymbol:F})||a!==void 0&&l.symbol===a)continue;let p=L(l);p<r||p>o||c&&we(d)||m&&ne(n,l.symbol,d)||h&&X(l.symbol)||Se(d)!=="test"&&(Y(l.symbol)||!x&&D(n,d,l.startLine)||b.push(l))}return u?b.sort((l,d)=>L(d)-L(l)):b}function ke(n,e){return e.files!==void 0?[...new Set(e.files.map(i=>i.replace(/\\/g,"/")))].sort().filter(i=>!e.scope||i.includes(e.scope)).flatMap(i=>v(n,i)):e.requireCallableSymbol?N(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?N(n,{scope:e.scope,symbolMatches:A,sqlPrefilter:"function-like"}):$(n,e.scope)}function Ee(n,e){return e.requireCallableSymbol?P(n.symbol):e.requireFunctionLikeSymbol?A(n.symbol):n.isFunctionLike}function we(n){return(n.split("/").pop()??"").includes("types")}var ye=class{constructor(e){this.db=e}db;scopedDefinitions(e){return Z(this.db,e)}definitionsForFile(e){return v(this.db,e)}productionCallableDefinitions(e={}){return pe(this.db,e)}calleeMap(e,t={}){return fe(this.db,e,{...t,semanticEvidence:I})}crossFileCallerMap(e,t={}){return q(this.db,e,{...t,semanticEvidence:I})}sourceFallbackCallerFiles(e,t={}){return V(this.db,e,t)}callerFileMap(e,t={}){return de(this.db,e,{...t,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let t=new Map;for(let r of e){if(!r.leaf)continue;let o=t.get(r.leaf)??[];o.push(r.symbolId),t.set(r.leaf,o)}let i=new Set;for(let r of M(this.db,{includeIgnored:!1}))if(y(r)==="rust")for(let{name:o}of S(this.db,r,{includeRustAttributeNames:!0}))for(let a of t.get(o)??[])i.add(a);return i}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let i=new Map(e.map(o=>[o.symbolId,o.symbol])),r=this.calleeMap(e,t);return new Set([...r.entries()].filter(([o,a])=>{let f=i.get(o);return a.some(c=>c.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return Q(this.db,e)}fileKind(e){return C(e)}hasSuppressionComment(e){return D(this.db,e.relativePath,e.startLine)}sourceFiles(){return H(this.db)}scanSourceReferences(e,t){be(this.db,e,t)}callableSignature(e){let t=U(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{V as a,me as b,ye as c};
|
|
2
|
-
//# sourceMappingURL=chunk-CJZXN4NU.js.map
|
package/dist/chunk-COF23M5F.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as P}from"./chunk-CJZXN4NU.js";import{a as C}from"./chunk-W7CXK74K.js";import{e as x,h as v,l as T}from"./chunk-NWQXSFFU.js";import{o as O}from"./chunk-DYGHBZ2N.js";import{d as A}from"./chunk-N2ZSIIGR.js";import{n as b}from"./chunk-ODDUPDP7.js";import{z as g}from"./chunk-ZOHS7AQV.js";function U(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new P(e),a=K(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=z(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:Q(),callees:Q()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?_(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?v(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),L=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let k=S(s,O(e,s,{semanticEvidence:C}).map(d=>d.file)),w=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),R=y(c,"references"),B=y(c,"callees");M(t.references,s,"references",k,p,R,i),M(t.callees,s,"callees",w,L,B,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function Q(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function K(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function z(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(x(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function M(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var E={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?E[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function _(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])j(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])j(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function j(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{U as a};
|
|
2
|
-
//# sourceMappingURL=chunk-COF23M5F.js.map
|
package/dist/chunk-DHUIOLDT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-6HFCYNYE.js";import{b as u}from"./chunk-NJITK2GP.js";import{b as p}from"./chunk-TEBQMNVI.js";import{Ca as y}from"./chunk-N5B2NILC.js";function ee(e){return b.test(e)}var b=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|uv\.lock|poetry\.lock|Pipfile\.lock|bun\.lockb?|\.SRCINFO|CHANGELOG(?:\.[a-z]+)?|.*\.(?:map|tsbuildinfo))$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function te(e,t,n={}){let{minTogether:s=4,minConfidence:i=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=x(e,{historyMode:n.historyMode,...n.head?{head:n.head}:{}}),r=g.commitHistory(),c=t!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:i,maxFilesPerCommit:l});if(!r||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,R=p(e),j=E(e),L=F(e,R,j),v=n.includeLinked===!0||c,h=[];for(let o of f){if(b.test(o.fileA)||b.test(o.fileB)||!P(e,o.fileA)||!P(e,o.fileB)||c&&!o.fileA.includes(t)&&!o.fileB.includes(t)||!c&&(u(o.fileA)==="test"||u(o.fileB)==="test"||O(o.fileA,o.fileB)||I(o.fileA,o.fileB)))continue;let m=L(o.fileA,o.fileB);if(!v&&m)continue;let C=w(o.fileA,o.fileB),S=$(o,C,m);if(h.push({...o,structurallyLinked:m,partnerClass:C.partnerClass,partnerClassReasons:C.reasons,...S?{declaredCouplingSuggestion:S}:{}}),h.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:h}}function P(e,t){return y(e.config.projectRoot,t)}function w(e,t){let n=A(e),s=A(t),i=[],a=r=>{i.includes(r)||i.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:i};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:i};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:i};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:i};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:i};let g=K(n.tokens,s.tokens).filter(r=>!Z.has(r));return k(e,t)||g.length>=2?(a(k(e,t)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:i}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:i})}function $(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!W.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${U(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function F(e,t=p(e),n=E(e)){return(s,i)=>D(t,n,s,i)}var _=/(?:^|\/)(?:locales|i18n)\//i;function T(e){return _.test(e)}function I(e,t){return T(e)&&T(t)?!0:N(e,t)}function N(e,t){if(!e.endsWith(".json")||!t.endsWith(".json"))return!1;let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(n<0||s<0)return!1;let i=e.slice(0,n),a=t.slice(0,s);if(i===a)return!1;let l=e.slice(n+1),g=t.slice(s+1);if(l!==g)return!1;let r=i.lastIndexOf("/"),c=a.lastIndexOf("/"),d=r>=0?i.slice(0,r):"",f=c>=0?a.slice(0,c):"";return d===f}function O(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let i=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return i!==""&&i===a}function E(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function D(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(i=>i.has(n)&&i.has(s))}var B=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,M=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,z=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,G=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,H=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,q=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,W=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),Z=new Set(["src","lib","app","apps","packages","frontend","backend","examples","python","typescript","javascript","test","tests","spec","index","main","utils","util","types","type","config","docs","doc","package","requirements","ts","tsx","js","jsx","mjs","cjs","vue","py","md","mdx","json","yaml","yml","toml","txt"]);function A(e){let t=e.replace(/\\/g,"/"),n=new Set;return B.test(t)&&n.add("doc"),M.test(t)&&n.add("config"),z.test(t)&&n.add("schema"),G.test(t)&&n.add("script"),H.test(t)&&n.add("model"),q.test(t)&&n.add("view"),u(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:J(t)}}function k(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),i=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return i!==""&&i===a}function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function K(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function U(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{ee as a,te as b,w as c,$ as d,F as e};
|
|
2
|
-
//# sourceMappingURL=chunk-DHUIOLDT.js.map
|
package/dist/chunk-DRENNWRG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let s=t[0],i=t[1],n=e.slice(s.length+1+i.length+1),r;if(n.startsWith("`")){let f=n.indexOf("`",1);f===-1?(r=n.slice(1),n=""):(r=n.slice(1,f),n=n.slice(f+2))}else{let f=n.indexOf(" ");f===-1?(r=n,n=""):(r=n.slice(0,f),n=n.slice(f+1))}let o,c=n.indexOf(" ");c===-1?(o=n,n=""):(o=n.slice(0,c),n=n.slice(c+1));let a=m(n);return{scheme:s,manager:i,packageName:r,version:o,descriptors:a,raw:e}}function b(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let r=e.indexOf("]",s+1);if(r===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,r),suffix:"type-param"}),s=r+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let r=e.indexOf(")",s+1);if(r!==-1&&e[r+1]!=="."){t.push({name:e.slice(s+1,r),suffix:"parameter"}),s=r+1;continue}}let i;if(e[s]==="`"){let r=e.indexOf("`",s+1);if(r===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,r),s=r+1}else{let r=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(r,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let n=e[s];if(n==="("){let r=e.indexOf(")",s+1);r!==-1&&e[r+1]==="."?(t.push({name:i,suffix:"method"}),s=r+2):r!==-1?(t.push({name:i,suffix:"method"}),s=r+1):(t.push({name:i,suffix:"term"}),s++)}else{let r=d[n];r&&t.push({name:i,suffix:r}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function y(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let n of s.descriptors){let r=g(n);r&&i.push(r)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?h(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function h(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"?!0:t!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function T(e){return p(e)==="namespace"}var x=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return x.test(e)}var S=new Set(["test","tests","_tests"]);function O(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function _(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let n=s.descriptors,r=i.descriptors;if(r.length!==n.length+1)return!1;for(let o=0;o<n.length;o++){let c=n[o],a=r[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function j(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let n=s.descriptors,r=i.descriptors;if(r.length<=n.length)return!1;for(let o=0;o<n.length;o++){let c=n[o],a=r[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,b,y as c,k as d,p as e,D as f,$ as g,T as h,M as i,O as j,_ as k,j as l};
|
|
2
|
-
//# sourceMappingURL=chunk-DRENNWRG.js.map
|
package/dist/chunk-E5R6AQ73.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-WIWY3CRX.js";import{b as f}from"./chunk-OSSESPDX.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,h as b,p,q as g}from"./chunk-N2ZSIIGR.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${e.shortName} (${e.file}:${e.startLine+1})
|
|
11
|
-
* ${e.signature??"(signature unavailable)"}
|
|
12
|
-
* ${i}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${s}';
|
|
19
|
-
import { ${e.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-E5R6AQ73.js.map
|
package/dist/chunk-E73UNJTF.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{c as K,d as O,e as Q,f as U,n as Y}from"./chunk-DYGHBZ2N.js";import{a as H}from"./chunk-TEBQMNVI.js";import{d as V,e as Z}from"./chunk-MTDBHTSF.js";import{A as J,e as $,g as B,t as N,u as G,z as W}from"./chunk-N2ZSIIGR.js";import{A as j,t as D,y as x}from"./chunk-ODDUPDP7.js";import{z as k}from"./chunk-ZOHS7AQV.js";import{d as A}from"./chunk-JWTGMPIT.js";import{d as v}from"./chunk-N5B2NILC.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-E73UNJTF.js.map
|
package/dist/chunk-EVFUMY4R.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as de}from"./chunk-CNO7TOKL.js";import{b as ue}from"./chunk-BOJ5SVE2.js";import{c as N}from"./chunk-CJZXN4NU.js";import{a as P}from"./chunk-W7CXK74K.js";import{j as le}from"./chunk-NWQXSFFU.js";import{b as ae,c as ce}from"./chunk-E73UNJTF.js";import{i as oe}from"./chunk-DYGHBZ2N.js";import{a as ie,b as re,c as se}from"./chunk-KK7GPALL.js";import{e as ee,f as te,h as ne}from"./chunk-XRYABF57.js";import{b as Q}from"./chunk-NJITK2GP.js";import{C as E,d as Z,e as $,g as G,h as J,i as K,j as q,k as V,s as X,x as Y}from"./chunk-N2ZSIIGR.js";import{y as H}from"./chunk-ODDUPDP7.js";import{D as x,a as S,z}from"./chunk-ZOHS7AQV.js";import{c as U,e as j,h as I,k as W}from"./chunk-FESCRNVV.js";import{b as w,i as B,y as b}from"./chunk-JWTGMPIT.js";import{d as L}from"./chunk-N5B2NILC.js";var _=new WeakMap,me=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ne});function pe(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=I(e,t);if(!i)return[];let o=B(e,t,i),c=me.read(e,t,o);if(c)return c;let u=n==="rust"?Ue(e,t):Fe(e,t);return me.write(e,t,o,u),u}function Ne(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Te);return n.some(r=>r===null)?null:n}catch{return null}}function Te(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Xe(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var ye=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),ke=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ae=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Fe(e,t){let n=I(e,t);if(!n||!Me(n))return[];let r=x(e,t);if(!r)return[];let i=_.get(r);if(i)return i;let o=!1,c=r.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let s=d.namedChild(0);if(!s)continue;let a=s.type==="member_expression"?s.namedChild(s.namedChildCount-1)?.text:s.text;if(a&&ye.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,s=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,s=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,s=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let p=a.namedChild(0)?.text,f=a.namedChild(1);p&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(d=p,s=a)}}d&&/^use[A-Z]/.test(d)&&s&&u.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...be(r,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(r,u),u}function Me(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of ye)if(e.includes(n)){t=!0;break}return t&&ke.test(e)?!0:e.includes("use")&&Ae.test(e)}var Oe=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Be(e){return Oe.test(e)}function be(e,t,n){let r=[],i=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let s=u[d];if(n.has(s.type)){if(Be(s.text)){r.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(s.type==="attribute_item"||s.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)i(c)};return i(e.rootNode),r}function Ue(e,t){let n=x(e,t);if(!n)return[];let r=_.get(n);if(r)return r;let i=[],o=je(n);return o?(_.set(n,o),o):(ge(n.rootNode,i,!1,!1),i.push(...be(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...qe(n.rootNode)),_.set(n,i),i)}function je(e){return Ye(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function ge(e,t,n,r){let i=n,o=r;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?We(e,t,n,r):r&&Ke(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ze(e,t,n):e.type==="mod_item"&&T(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)ge(c,t,i,o)}function We(e,t,n,r){let i=T(e),o=null;r?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(he(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Ge(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function ze(e,t,n){let r=T(e),i=e.namedChildren.find(o=>o.type==="type_identifier")?.text;r.some(Je)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),r.some(he)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function T(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){r=o;break}if(r<=0)return[];let i=[];for(let o=r-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var He=new Set(["test","bench","tokio::test","async_std::test"]),Ze=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),$e=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Ge(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Ve(e);return t?He.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:Ze.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:$e.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Je(e){return/#\[\s*derive\s*\(/.test(e)}function he(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Ke(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function qe(e){let t=Qe(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let i=r.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function Ve(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Xe(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Ye(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var fe=/\bwith\s*=\s*"([^"]+)"/g;function Qe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){fe.lastIndex=0;let r;for(;(r=fe.exec(n.text))!==null;){let i=r[1],o=i.split("::").pop()??i;o&&t.add(o)}}return t}function xe(e){let t=k(e);return(n,r,i,o)=>t(n,r,i,o)?.disposition==="exclude"}function k(e){let t=new Map,n=r=>{let i=t.get(r);if(i)return i;let o=pe(e,r),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:o,containers:c},t.set(r,i),i};return(r,i,o,c)=>{let u=n(r),l=[];for(let s of u.ranges)i>=s.startLine&&i<=s.endLine&&l.push(s);let d=new Set;c&&d.add(c);for(let s of E(o))d.add(s);for(let s of d){let a=u.containers.get(s);a&&l.push(...a)}return et(l)}}function et(e){if(e.length===0)return null;let n=e.find(r=>r.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Dt(e,t={}){w(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function _e(e,t,n={}){w(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function Se(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(K(e.symbol))return y("module-like-symbol");if(!R(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&R(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!tt(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):q(e.symbol)?y("rust-trait-impl-member"):V(e.symbol)?y("rust-test-module"):!t.includeMembers&&!nt(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function tt(e){return Q(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function R(e){return J(e)||e.endsWith("().")||e.endsWith(".")}function nt(e){return G(e.symbol)||E(e.symbol).length===0}function Ee(){return new Map}function Re(e,t,n){let r=new Map;for(let i of ie(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||v(r,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return r}function Ce(e,t,n,r={}){let i=new Set;if(r.conservative||n.size===0){for(let o of se(e,t))i.add(o.symbol_id);return i}for(let o of re(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||i.add(o.symbol_id);return i}function A(e,t){let n=e.get(t);if(!n)return!1;for(let r of n.values())if(r.occurrences>0)return!0;return!1}function C(e,t,n){let r=e.get(t);if(!r)return!1;for(let[i,o]of r)if(i!==n&&o.occurrences>0)return!0;return!1}function ve(e){return e?.occurrences??0}function v(e,t,n,r,i="source-fallback"){if(r<=0)return;let o=Le(e,t,n);o.occurrences+=r,o.sources.add(i)}function De(e,t,n,r,i){if(r<=0)return;let o=Le(e,t,n);o.occurrences=Math.max(r,o.occurrences),o.sources.add(i)}function Le(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=r.get(n);return i||(i={occurrences:0,sources:new Set},r.set(n,i)),i}var it=64,rt=300;function en(e,t={}){let{scope:n,minLoc:r=1,includeTests:i=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,s=0,a=b("dead.candidates",()=>{let m=ue(st(e,{scope:n,minLoc:r,includeTests:i,includeMembers:c}),l);return s=m.length,m},()=>({definitions:s})),p=0,f=o?b("dead.inactive-barrels",()=>{let m=new Set(ee(e));return p=m.size,m},()=>({paths:p})):new Set,F=0,g=u?Ee():b("dead.mention-reference-counts",()=>{let m=Re(e,f,a.map(D=>D.symbolId));return F=m.size,m},()=>({definitions:a.length,symbolsWithReferences:F})),M=0,Ie=u?b("dead.mentioned-symbol-ids",()=>{let m=Ce(e,a.map(D=>D.symbolId),f,{conservative:f.size===0});return M=m.size,m},()=>({definitions:a.length,referencedSymbols:M})):new Set,h=u?a.filter(m=>!Ie.has(m.symbolId)):a.filter(m=>!C(g,m.symbolId,m.relativePath));u?b("dead.source-fallback.dead-code-only",()=>mt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>dt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0}));let O=u?h.filter(m=>!A(g,m.symbolId)):h.filter(m=>!C(g,m.symbolId,m.relativePath));b("dead.caller-map-supplement",()=>bt(e,O,g,{inactiveBarrelPaths:f,includeSemantic:!u&&d}),()=>({definitions:O.length,semantic:!u&&d}));let Pe=u?h.filter(m=>!A(g,m.symbolId)):a;return ut(e,ct(Pe,g))}function st(e,t){let n=xe(e),r=[];for(let i of Y(e,{scope:t.scope,symbolMatches:R,sqlPrefilter:"function-like"}))Se(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>at(e,i),isFrameworkContractCallable:()=>de(e,i)}).accepted&&r.push(i);return r}var ot=["method_signature","abstract_method_signature","call_signature","construct_signature"];function at(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...ot]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let r=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`).trim();return r.endsWith(";")&&!r.includes("=>")&&!r.includes("{")}function ct(e,t){return e.map(n=>lt(n,t)).filter(n=>n.cross_file_refs===0).sort((n,r)=>r.loc-n.loc||n.relative_path.localeCompare(r.relative_path)||n.start_line-r.start_line)}function lt(e,t){let n=t.get(e.symbolId)??new Map,r=ve(n.get(e.relativePath)),i=0;for(let[o,c]of n)o!==e.relativePath&&(i+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:r,cross_file_refs:i}}function ut(e,t){let n=k(e),r=[],i=0,o=0,c=0,u=0,l=0,d=0;for(let s of t){if(e.isIgnored(s.relative_path))continue;if(te(e,s.relative_path)){u++;continue}if(ne(e,s.symbol,s.relative_path)){l++;continue}let a=n(s.relative_path,s.start_line,s.symbol,s.parent_type_name),p=a?.disposition==="implicit-usage"?a.reason:void 0,f=p?"implicit-usage":s.same_file_refs===0?"dead-code":"file-internal";f==="dead-code"?i++:f==="file-internal"?o++:c++,d+=s.loc,r.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:Z(s.symbol),sameFileRefs:s.same_file_refs,kind:f,...p?{implicitUsageReason:p}:{}})}return{symbols:r,counts:{total:r.length,deadCode:i,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:r.length,deadCodeCount:i,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function dt(e,t,n,r){if(t.length===0)return;let i=new N(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(i.sourceFiles());for(let l of S(e))u.add(l);i.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>r.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(pt(e,l)||v(n,l.target.symbolId,l.sourceFile,yt(l),"source-fallback"))})}function mt(e,t,n,r){if(t.length===0)return;let i=new N(e),o=X(t),c=new Set(i.sourceFiles());for(let s of S(e))c.add(s);let u=new Set(o.keys()),l=new Map,d=s=>{let a=l.get(s);return a||(a=oe(e,s),l.set(s,a)),a};i.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:s=>r.inactiveBarrelPaths.has(s),resolveTargets:({sourceFile:s,name:a,kind:p})=>{let f=o.get(a);return f?ft(s,a,f,()=>d(s),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:s=>{l.delete(s),_e(e,s)}},s=>{let a=s.kind==="identifier"&&s.sourceFile===s.target.relativePath?Math.max(0,s.occurrences-1):s.occurrences;s.kind==="identifier"&&we(e,{sourceFile:s.sourceFile,name:s.name,target:s.target,occurrences:a})||v(n,s.target.symbolId,s.sourceFile,a,"source-fallback")})}function ft(e,t,n,r,i){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!i.permissive&&n.length===1)return[...n];let c=r(),u=c.get(t);if(u)for(let d of u){let s=n.filter(a=>L(d,a.relativePath));if(s.length>0)return s}let l=new Set;for(let d of c.values())for(let s of d)l.add(s);for(let d of l){let s=n.filter(a=>L(d,a.relativePath));if(s.length>0&&s.length===n.length)return s}return i.permissive?[...n]:[]}function pt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&we(e,t)}function yt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function we(e,t){return t.occurrences>1?!1:H(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function bt(e,t,n,r){let i=r.includeSemantic!==!1,o=i&&t.length>=it&&S(e).length>=rt,c=(s,a)=>{a===s.relativePath||e.isIgnored(a)||r.inactiveBarrelPaths.has(a)||De(n,s.symbolId,a,1,"caller-map")};if(o?b("dead.caller-map.per-symbol-non-semantic",()=>{let s=ce(e,t,{semantic:!1,semanticEvidence:P});for(let a of t){let p=s.get(a.symbolId)??[];for(let f of p)c(a,f.file)}},()=>({definitions:t.length,semantic:!1,batched:!0})):b("dead.caller-map.per-symbol",()=>{for(let s of t){let a=ae(e,s,{semantic:i,semanticEvidence:P});if(a.length!==0)for(let p of a)c(s,p.file)}},()=>({definitions:t.length,semantic:i})),!o)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let s=t.filter(a=>!C(n,a.symbolId,a.relativePath));return u=s.length,s},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=le(e,l);for(let s of l){let a=d.get(s.symbolId);if(a)for(let p of a)c(s,p)}}export{Dt as a,en as b};
|
|
3
|
-
//# sourceMappingURL=chunk-EVFUMY4R.js.map
|
package/dist/chunk-FBN2FGXG.js
DELETED
package/dist/chunk-FFRKR4EQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,b as P}from"./chunk-2E7CX53V.js";import{a as C,c as B,e as a,f}from"./chunk-B3X6KU75.js";import{a as v,b as h,c as k}from"./chunk-KMVGRIO2.js";import{P as g}from"./chunk-ZOHS7AQV.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=R(c,t=>t.tokens);return P({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,tokenCountA:e.tokens.size,tokenCountB:o.tokens.size,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return B([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return C({genericWords:w,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var w=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{D as a};
|
|
2
|
-
//# sourceMappingURL=chunk-FFRKR4EQ.js.map
|
package/dist/chunk-GAS2LJMP.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-2OOY75BW.js";import{a as p}from"./chunk-JFMEXGFE.js";import{$ as h,W as d,_ as P}from"./chunk-KYSDI3GE.js";import{g as f}from"./chunk-7F45LJKI.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
|
|
2
|
-
`,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
|
|
3
|
-
//# sourceMappingURL=chunk-GAS2LJMP.js.map
|
package/dist/chunk-HVF5VBG6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as f}from"./chunk-B3X6KU75.js";import{P as d}from"./chunk-ZOHS7AQV.js";function S(n,e={}){let{minComponentLines:o=300,minFileLines:i=800,minJsxTokens:u=80,minBehaviorTokens:s=40,limit:a=20,scope:m,scanLimit:c,filePattern:p}=e;return d(n).reactProfiles({scope:m,scanLimit:c}).filter(t=>t.kind==="component").filter(t=>!p||t.file.includes(p)||t.name.includes(p)).map(t=>C(t,{minComponentLines:o,minFileLines:i,minJsxTokens:u,minBehaviorTokens:s})).filter(t=>t!==null).sort((t,r)=>r.componentLines-t.componentLines||r.fileLines-t.fileLines||t.file.localeCompare(r.file)).slice(0,a)}function C(n,e){let o=Math.max(80,Math.floor(e.minComponentLines/2)),i=f(n,x({minComponentLines:e.minComponentLines,minFileLines:e.minFileLines,minJsxTokens:e.minJsxTokens,minBehaviorTokens:e.minBehaviorTokens,substantialComponentLines:o}),"component"),{reasons:u}=i;if(u.length===0)return null;let s=i.dominantPressure,a=i.pressureKinds,m=b(n),c=R(s,a,m);return{file:n.file,component:n.name,componentLines:n.loc,fileLines:n.fileLines,jsxTokens:n.jsxTokens.size,behaviorTokens:n.behaviorTokens.size,dominantPressure:s,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:v(c,m),reasons:u,loc:n.loc}}function x(n){return[{axis:"component",value:e=>e.loc,qualifies:(e,o)=>o>=n.minComponentLines,reason:(e,o)=>`${o} component line(s)`},{axis:"file",value:e=>e.fileLines,qualifies:(e,o)=>o>=n.minFileLines&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} file line(s)`},{axis:"jsx-structure",value:e=>e.jsxTokens.size,weightedValue:(e,o)=>o*3,qualifies:(e,o)=>o>=n.minJsxTokens,reason:(e,o)=>`${o} JSX structure token(s)`},{axis:"hook-behavior",value:e=>e.behaviorTokens.size,weightedValue:(e,o)=>o*4,qualifies:(e,o)=>o>=n.minBehaviorTokens,reason:(e,o)=>`${o} behavior token(s)`}]}function b(n){let e=n.file.split(/[\\/]+/).filter(Boolean),o=e.slice(0,-1).map(r=>r.toLowerCase()),i=(e.at(-1)??n.name).replace(/\.[^.]+$/,""),s=o.findIndex(r=>k.has(r))>=0,a=o.some(r=>h.has(r));if(L(i)||L(n.name))return"component";let c=T.has(i.toLowerCase()),p=/(?:Page|Route|Screen)$/.test(n.name),l=s&&/View$/.test(n.name),t=!a&&i.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()===n.name.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()&&/(?:Page|Route|Screen|View)$/.test(i);return c||p||l||t?"route-page":"component"}function L(n){let e=n.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return e.at(-1)&&g.has(e.at(-1))?!0:[...g].some(o=>n.endsWith(P(o)))}function R(n,e,o){return n==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":e.includes("hook-behavior")?"behavior-extraction":e.includes("jsx-structure")?"jsx-decomposition":e.includes("file")?"file-decomposition":n==="jsx-structure"?"jsx-decomposition":n==="file"&&!e.includes("component")?"file-decomposition":"component-decomposition"}function v(n,e){switch(n){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return e==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),g=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),k=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),T=new Set(["page","route","screen"]);function P(n){return n.charAt(0).toUpperCase()+n.slice(1)}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-HVF5VBG6.js.map
|
package/dist/chunk-JGKUET5J.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-6HFCYNYE.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,u as B}from"./chunk-N2ZSIIGR.js";import{b as f}from"./chunk-ODDUPDP7.js";import{k as y,n as d}from"./chunk-FESCRNVV.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`)}function S(e){let t=e.indexOf("{"),o=e.lastIndexOf("}");if(t>=0&&o>t)return e.slice(t+1,o);let n=e.indexOf("=>");return n>=0?e.slice(n+2).replace(/;+\s*$/,""):e}function W(e){return S(e).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0).length}function F(e){return A("sha256").update(e).digest("hex").slice(0,16)}function z(e,t){let o=e.ageCommits??-1;return(t.ageCommits??-1)-o||e.file.localeCompare(t.file)||e.startLine-t.startLine}function b(e){return e.functions.reduce((t,o)=>t+o.loc,0)}export{H as a,M as b,I as c,v as d,P as e,E as f,S as g};
|
|
3
|
-
//# sourceMappingURL=chunk-JGKUET5J.js.map
|
package/dist/chunk-JWTGMPIT.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import{x as A}from"./chunk-N5B2NILC.js";var O=[];function y(n){n.groups.length>0&&O.push(n)}function me(n,e){let t=new Set(e.groups);for(let a of O)a.groups.some(r=>t.has(r))&&(e.file!==void 0&&a.clearFile?a.clearFile(n,e.file):a.clearAll(n))}var I=256;function w(n){let e=n.maxEntries;if(e!==void 0){if(!Number.isSafeInteger(e)||e<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${e}.`);return e}return n.clearGroups.includes("source-file")?I:void 0}function P(n,e,t){n.delete(e),n.set(e,t)}function x(n,e){if(e!==void 0)for(;n.size>e;){let t=n.keys().next().value;if(t===void 0)return;n.delete(t)}}function M(){let n=new WeakMap;return{cache:n,ensure(e){let t=n.get(e);return t||(t=new Map,n.set(e,t)),t}}}function C(n,e){let{cache:t,ensure:a}=M(),r=w(e),i={get(o,c,_){let p=a(o);if(p.has(c)){let E=p.get(c);return P(p,c,E),E}let u=_();return p.set(c,u),x(p,r),u},has(o,c){return t.get(o)?.has(c)??!1},invalidate(o,c){t.get(o)?.delete(c)},invalidateAll(o){t.delete(o)},size(o){return t.get(o)?.size??0}};return y({name:n,groups:e.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}function Ne(n,e){let t=new WeakMap,a={get(r,i){let o=t.get(r);if(o)return o.value;let c=i();return t.set(r,{value:c}),c},invalidate(r){t.delete(r)},has(r){return t.has(r)}};return y({name:n,groups:e.clearGroups,clearAll:r=>a.invalidate(r)}),a}var ee={clearGroups:["whole-project","source-file"],maxEntries:I};function Te(n){return te(n,ee)}function te(n,e){let{cache:t,ensure:a}=M(),r=w(e),i={get(o,c,_,p){let u=a(o),E=u.get(c);if(E&&E.source===_)return P(u,c,E),E.value;let F=p();return u.set(c,{source:_,value:F}),x(u,r),F},invalidate(o,c){t.get(o)?.delete(c)},invalidateAll(o){t.delete(o)}};return y({name:n,groups:e.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}import{createHash as ne}from"crypto";import{existsSync as Le,mkdirSync as re}from"fs";import{dirname as k,join as ae}from"path";import V from"better-sqlite3";var ie="evidence.db";var oe=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],D=new Set(oe);var we=512*1024*1024,ce=6e4,m=new WeakMap,se=C("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),le=C("evidence-project-fingerprint",{clearGroups:["whole-project"]}),s="evidence-v1",f="version NOT LIKE 'evidence-%'";function K(n){return ne("sha256").update(n).digest("hex")}function Pe(n,e,t){return se.get(n,e,()=>K(t))}function xe(n){return le.get(n,"current",()=>{try{if(!n.generation.metadataRaw)return null;let e=A(n.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let t=e.metadata,a=[...t.indexedLanguages??[]].sort();return K(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:a,status:t.status}))}catch(e){return h("project fingerprint unavailable",e),null}})}function h(n,e){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${e instanceof Error?e.message:String(e)}`)}function l(n){if(m.has(n))return m.get(n)??null;let e=null;try{let t=new V(n.config.evidenceDbPath??ae(k(n.config.dbPath),ie));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
-
kind TEXT NOT NULL,
|
|
12
|
-
cache_key TEXT NOT NULL,
|
|
13
|
-
project_fingerprint TEXT NOT NULL,
|
|
14
|
-
version TEXT NOT NULL,
|
|
15
|
-
payload TEXT NOT NULL,
|
|
16
|
-
PRIMARY KEY (kind, cache_key)
|
|
17
|
-
);
|
|
18
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
-
relative_path TEXT NOT NULL,
|
|
20
|
-
symbol TEXT NOT NULL,
|
|
21
|
-
content_hash TEXT NOT NULL,
|
|
22
|
-
deps_digest TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
-
relative_path TEXT NOT NULL,
|
|
29
|
-
symbol TEXT NOT NULL,
|
|
30
|
-
project_fingerprint TEXT NOT NULL,
|
|
31
|
-
version TEXT NOT NULL,
|
|
32
|
-
payload TEXT NOT NULL,
|
|
33
|
-
PRIMARY KEY (relative_path, symbol)
|
|
34
|
-
);
|
|
35
|
-
`),e={evidence:t,shared:de(n.config.sharedEvidenceDbPath),readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
|
|
36
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${f}
|
|
37
|
-
ORDER BY version DESC
|
|
38
|
-
LIMIT 1`),existsFileEvidence:t.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:t.prepare(`SELECT 1 AS present FROM file_evidence
|
|
39
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${f}
|
|
40
|
-
LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:t.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
|
|
41
|
-
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${f}
|
|
42
|
-
ORDER BY version DESC
|
|
43
|
-
LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:t.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
|
|
44
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
|
|
45
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${f}
|
|
46
|
-
ORDER BY version DESC
|
|
47
|
-
LIMIT 1`),readCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
48
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
49
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${f}
|
|
50
|
-
ORDER BY symbol, version DESC`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
51
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
|
|
52
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
|
|
53
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${f}
|
|
54
|
-
ORDER BY version DESC
|
|
55
|
-
LIMIT 1`),readReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
|
|
56
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
|
|
57
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND ${f}
|
|
58
|
-
ORDER BY symbol, version DESC`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
59
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(t){h("disabled (open failed)",t)}return m.set(n,e),e}function d(n,e,t){h(`disabled (${e})`,t),m.set(n,null)}function de(n){if(!n)return null;try{re(k(n),{recursive:!0});let e=new V(n);return e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 250"),e.pragma("synchronous = NORMAL"),e.exec(`
|
|
60
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
61
|
-
kind TEXT NOT NULL,
|
|
62
|
-
relative_path TEXT NOT NULL,
|
|
63
|
-
content_hash TEXT NOT NULL,
|
|
64
|
-
version TEXT NOT NULL,
|
|
65
|
-
payload TEXT NOT NULL,
|
|
66
|
-
last_accessed_at INTEGER NOT NULL,
|
|
67
|
-
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
68
|
-
);
|
|
69
|
-
CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
70
|
-
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
|
|
71
|
-
`),{evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:e.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
72
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
73
|
-
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
74
|
-
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:e.prepare(`UPDATE file_evidence
|
|
75
|
-
SET last_accessed_at = ?
|
|
76
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
|
|
77
|
-
AND last_accessed_at < ?`)}}catch(e){return h("shared cache disabled (open failed)",e),null}}function S(n,e,t){h(`shared cache disabled (${e})`,t);try{n.shared?.evidence.close()}catch{}n.shared=null}function Me(n,e,t,a){let r=l(n);if(!r)return null;try{let i=r.readFileEvidence.get(e,t,a,s)??r.readLegacyFileEvidence.get(e,t,a);if(i?.payload!==void 0)return i.payload;if(!D.has(e)||!r.shared)return null;try{let o=r.shared.readFileEvidence.get(e,t,a,s);return o?.payload!==void 0&&U(r.shared,e,t,a),o?.payload??null}catch(o){return S(r,"file_evidence read",o),null}}catch(i){return d(n,"file_evidence read",i),null}}function ke(n,e,t,a){let r=l(n);if(!r)return!1;try{if((r.existsFileEvidence.get(e,t,a,s)??r.existsLegacyFileEvidence.get(e,t,a))?.present!==void 0)return!0;if(!D.has(e)||!r.shared)return!1;try{return r.shared.existsFileEvidence.get(e,t,a,s)?.present===void 0?!1:(U(r.shared,e,t,a),!0)}catch(o){return S(r,"file_evidence exists",o),!1}}catch(i){return d(n,"file_evidence exists",i),!1}}function U(n,e,t,a){let r=Date.now();try{n.touchFileEvidence.run(r,e,t,a,s,r-ce)}catch(i){h("shared file_evidence recency touch skipped",i)}}function Ve(n,e,t,a,r){let i=l(n);if(i)try{if(i.writeFileEvidence.run(e,t,a,s,r),D.has(e)&&i.shared)try{i.shared.writeFileEvidence.run(e,t,a,s,r,Date.now())}catch(o){S(i,"file_evidence write",o)}}catch(o){d(n,"file_evidence write",o)}}function Ke(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{for(let r of e)t.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s,r.payload)})();try{t.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=e.filter(r=>D.has(r.kind));if(a.length>0&&t.shared)try{t.shared.evidence.transaction(()=>{for(let r of a)t.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s,r.payload,Date.now())})()}catch(r){S(t,"file_evidence batch write",r)}}catch(a){d(n,"file_evidence batch write",a)}}function Ue(n,e,t,a){let r=l(n);if(!r)return null;try{return(r.readProjectEvidence.get(e,t,a,s)??r.readLegacyProjectEvidence.get(e,t,a))?.payload??null}catch(i){return d(n,"project_evidence read",i),null}}function je(n,e,t,a,r){let i=l(n);if(i)try{i.writeProjectEvidence.run(e,t,a,s,r)}catch(o){d(n,"project_evidence write",o)}}function He(n,e,t,a){if(t===a)return 0;let r=l(n);if(!r)return 0;try{return r.rekeyProjectEvidenceKind.run(a,s,e,t).changes}catch(i){return d(n,"project_evidence kind rekey",i),0}}function We(n,e,t,a){let r=l(n);if(!r)return new Map;try{let i=r.readCalleesForFile.all(e,t,a,s),o=r.readLegacyCalleesForFile.all(e,t,a);return j([...o,...i])}catch(i){return d(n,"semantic_callees bulk read",i),new Map}}function Xe(n,e,t){let a=l(n);if(!a)return new Map;try{let r=a.readReferencesForFile.all(e,t,s),i=a.readLegacyReferencesForFile.all(e,t);return j([...i,...r])}catch(r){return d(n,"semantic_references bulk read",r),new Map}}function j(n){let e=new Map;for(let t of n)e.set(t.symbol,t.payload);return e}function Ye(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{let a=new Set;for(let r of e){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),t.dropStaleCallees.run(r.relativePath,r.contentHash)),t.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,s,r.payload)}})()}catch(a){d(n,"semantic_callees write",a)}}function Be(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{let a=new Set;for(let r of e){let i=`${r.relativePath}\0${r.projectFingerprint}`;a.has(i)||(a.add(i),t.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),t.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,s,r.payload)}})()}catch(a){d(n,"semantic_references write",a)}}import{appendFileSync as pe,mkdirSync as ue}from"fs";import{createHash as Ee,randomUUID as fe}from"crypto";import{dirname as he}from"path";import{performance as v}from"perf_hooks";var Y="SCIP_QUERY_PROFILE",B="SCIP_QUERY_PROFILE_OUT",$="SCIP_QUERY_PROFILE_COMMAND",G="SCIP_QUERY_PROFILE_CACHE_STATE",R="SCIP_QUERY_PROFILE_RUN_ID",b="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",L="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",Q=[Y,B,$,G,R,b,L],qe=new Set(Q),H=new Set,W=new Map,X=!1;function g(){let n=process.env[Y];return n==="1"||n==="true"}function ve(){return process.env[B]}function z(){return process.env[$]}function ge(){return process.env[G]}function J(){let n=process.env[R];if(n)return n;if(!g())return;let e=fe();return process.env[R]=e,e}function q(){return process.env[b]}function _e(n){let e=q();if(e)return e;if(!g())return;let t=J();if(!t)return;let a=n.projectFingerprint?"published-project":"run-only",r=Z(["profile-workload-v1",n.toolVersion,n.command,n.projectFingerprint??t]);return process.env[b]=r,process.env[L]=a,r}function Z(n){return Ee("sha256").update(JSON.stringify(n)).digest("hex").slice(0,24)}function Ze(){return Object.fromEntries(Q.flatMap(n=>{let e=process.env[n];return e===void 0?[]:[[n,e]]}))}function et(n,e,t){if(!g())return e();let a=v.now();try{let r=e();return N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...T(t)??{}}),r}catch(r){throw N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...T(t)??{}}),r}}async function tt(n,e,t){if(!g())return e();let a=v.now();try{let r=await e();return N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...T(t)??{}}),r}catch(r){throw N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...T(t)??{}}),r}}function N(n,e=ve()){let t=ye(n),a={timestamp:new Date().toISOString(),pid:process.pid,runId:J(),command:z(),cacheState:ge(),...t,...n},r=`${JSON.stringify(a)}
|
|
78
|
-
`;if(e)try{let i=he(e);H.has(i)||(ue(i,{recursive:!0}),H.add(i)),pe(e,r);return}catch(i){X||(X=!0,process.stderr.write(`[profile] failed to write ${e}: ${i instanceof Error?i.message:String(i)}
|
|
79
|
-
`));return}g()&&process.stderr.write(r)}function ye(n){let e=q()??_e({command:z()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!e)return{};let t=process.env[L],a=typeof n.name=="string"?n.name:void 0;if(!a)return{workloadIdentity:e,workloadIdentityKind:t};let r=a.split(/[.:]/,1)[0]??a,i=`${e}\0${a}`,o=W.get(i);return o||(o=Z(["profile-subsystem-v1",e,a]),W.set(i,o)),{workloadIdentity:e,workloadIdentityKind:t,subsystem:r,subsystemWorkIdentity:o}}function T(n){return typeof n=="function"?n():n}export{y as a,me as b,C as c,Ne as d,Te as e,te as f,ie as g,K as h,Pe as i,xe as j,Me as k,ke as l,Ve as m,Ke as n,Ue as o,je as p,He as q,We as r,Xe as s,Ye as t,Be as u,g as v,Z as w,Ze as x,et as y,tt as z,N as A};
|
|
80
|
-
//# sourceMappingURL=chunk-JWTGMPIT.js.map
|
package/dist/chunk-KFOYCQAJ.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var be=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]),Rt=6500,At=8e3,It=6500,Lt=3500;function Se(e,t={}){let r=t.allowNewlines??!0,n=t.allowTabs??!0,i="";for(let o=0;o<e.length;){let s=e.charCodeAt(o);if(s===27){o=Fe(e,o);continue}if(s===155){o=U(e,o+1);continue}if(s===144||s===152||s===157||s===158||s===159){o=q(e,o+1);continue}if(we(s)){s===10&&r?i+=`
|
|
2
|
-
`:s===9&&n?i+=" ":i+=be.get(s)??"\uFFFD",o+=1;continue}if(he(s)){i+="\uFFFD",o+=1;continue}i+=e[o],o+=1}return i}function Tt(e){return Se(e,{allowNewlines:!1,allowTabs:!1})}function Dt(e,t=r=>process.stdout.write(r)){t(`${e}
|
|
3
|
-
`)}function Fe(e,t){let r=e.charCodeAt(t+1);if(Number.isNaN(r))return e.length;if(r===91)return U(e,t+2);if(r===80||r===88||r===93||r===94||r===95)return q(e,t+2);let n=t+1;for(;n<e.length&&xe(e.charCodeAt(n));)n+=1;return n<e.length&&ke(e.charCodeAt(n))?n+1:t+1}function U(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(r+=1,n>=64&&n<=126)return r}return e.length}function q(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(n===7||n===156)return r+1;if(n===27&&e.charCodeAt(r+1)===92)return r+2;r+=1}return e.length}function xe(e){return e>=32&&e<=47}function ke(e){return e>=48&&e<=126}function we(e){return e<=31||e>=127&&e<=159}function he(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}import{closeSync as W,fstatSync as $,openSync as z,readFileSync as Ee,readSync as Pe}from"fs";import{createHash as _t}from"crypto";var J=8*1024*1024,Re=64*1024*1024,Ae=512*1024*1024,Ie=256*1024*1024,m=class extends Error{constructor(r,n,i,o,s){let c=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${c}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function j(e,t){K(t.maxBytes);let r=String(e),n=z(e,"r");try{let i=$(n);Le(i,t,r);let o=Ee(n),s=$(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new m(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{W(n)}}function Y(e,t,r="utf8"){return j(e,t).toString(r)}function b(e,t){return Y(e,{maxBytes:J,inputKind:t})}function G(e,t){K(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=Pe(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new m(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function X(e,t){let r=z(e,"r");try{return G(r,t)}finally{W(r)}}function P(e,t,r="utf8"){return X(e,t).toString(r)}function Le(e,t,r){if(!e.isFile())throw new m(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new m(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function K(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function Jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Yt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Gt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Te=/^[a-f0-9]{64}$/u;function Xt(e){return typeof e=="string"&&Te.test(e)}function Kt(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Vt(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var De=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function R(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!De.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function x(e,t){return e.version===t.version&&e.pid===t.pid&&e.platform===t.platform&&e.startToken===t.startToken}import{execFileSync as Oe}from"child_process";import{platform as Ne}from"os";var ve=1e3,V=16*1024,A;function Z(e,t=Q){if(!Number.isSafeInteger(e)||e<=0)return null;let r=e===process.pid&&t===Q;if(r&&A)return{...A};try{let n=_e(e,t);if(!n)return null;let i={version:1,pid:e,platform:t.platform,startToken:n};return r&&(A=i),{...i}}catch{return null}}function _e(e,t){if(t.platform==="linux"||t.platform==="android")return Ce(t.readFile(`/proc/${e}/stat`));if(t.platform==="win32"){let r=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return H(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",r]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?H(t.run("ps",["-p",String(e),"-o","lstart="])):null}function Ce(e){let t=e.lastIndexOf(")");if(t<0)return null;let n=e.slice(t+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function H(e){let t=e.trim();return t===""?null:t}var Q={platform:Ne(),readFile(e){return P(e,{maxBytes:V,inputKind:"process identity pseudo-file"})},run(e,t){return Oe(e,[...t],{encoding:"utf8",timeout:ve,maxBuffer:V,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function ee(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}import{randomUUID as Me}from"crypto";import{closeSync as Be,fsyncSync as Ue,linkSync as qe,mkdirSync as $e,openSync as We,statSync as ze,unlinkSync as Je,writeSync as je}from"fs";import{dirname as O}from"path";function S(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function p(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var L="scip-query-process-lock",T=1,k=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:ee,readProcessIdentity:Z,randomToken:()=>Me(),makeDirectory:e=>$e(e,{recursive:!0}),openFile:(e,t,r)=>We(e,t,r),writeFile:(e,t,r,n)=>je(e,t,r,n),syncFile:e=>Ue(e),closeFile:e=>Be(e),linkFile:(e,t)=>qe(e,t),readFile:e=>b(e,"process lock record"),statFile:e=>{let t=ze(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>Je(e)});function te(e,t){let r=t.runtime??k;r.makeDirectory(O(e));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:re(e,t,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=y(e,{parseLegacy:t.parseLegacy,runtime:r});if(i===0&&Ge(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:y(e,{parseLegacy:t.parseLegacy,runtime:r})}}function y(e,t={}){let r=t.runtime??k,n,i;try{n=r.statFile(e),i=r.readFile(e)}catch(l){return l.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=Ye(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Ve(s),parsed:o};let c=t.parseLegacy?.(o)??null;return c?{state:"legacy",raw:i,identity:n,owner:c,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function Ye(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.protocol!==L||t.version!==T||typeof t.kind!="string"||t.kind.trim()===""||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.token!="string"||t.token.trim()===""||typeof t.startedAt!="string"||!Number.isFinite(Date.parse(t.startedAt))||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||Array.isArray(t.detail)))return null;let r=t.processIdentity===void 0?null:R(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{protocol:L,version:T,kind:t.kind,pid:t.pid,token:t.token,...r?{processIdentity:r}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function Ge(e,t,r={}){let n=r.runtime??k;if(!D(t,n))return!1;let i=Ke(`${e}.reclaim`,n);if(!i)return!1;try{let o=y(e,{parseLegacy:r.parseLegacy,runtime:n});return!ie(t,o)||!D(o,n)?!1:N(e,n)}finally{i.release()}}function re(e,t,r){let n=t.directoryDurability??"durable",i=t.pid??process.pid,o=r.randomToken(),s=t.processIdentity===void 0?r.readProcessIdentity(i):t.processIdentity,c={protocol:L,version:T,kind:t.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},l=`${e}.${o}.candidate`,a=r.openFile(l,"wx",384),u;try{S(a,Buffer.from(`${JSON.stringify(c)}
|
|
4
|
-
`),r,"process lock"),r.syncFile(a)}catch(d){u=d}try{r.closeFile(a)}catch(d){u??=d}if(u!==void 0)throw I(l,r),u;try{r.linkFile(l,e)}catch(d){throw I(l,r),d}if(I(l,r),n==="durable")try{oe(O(e),r)}catch(d){throw Xe(e,c,r),d}let f=!1;return{path:e,record:c,release:()=>f?!1:(f=!0,ne(e,c,r,n))}}function Xe(e,t,r=k){return ne(e,t,r,"durable")}function ne(e,t,r,n){let i=y(e,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==t.pid||i.record.token!==t.token||t.processIdentity&&(!i.record.processIdentity||!x(t.processIdentity,i.record.processIdentity))?!1:N(e,r,n)}function Ke(e,t){for(let r=0;r<2;r+=1)try{return re(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST")return null;let i=y(e,{runtime:t});if(r>0||!D(i,t))return null;let o=y(e,{runtime:t});if(!ie(i,o)||!N(e,t))return null}return null}function D(e,t){if(e.state==="missing")return!1;if(e.owner){if(!t.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let r=t.readProcessIdentity(e.owner.pid);return r!==null&&!x(e.owner.processIdentity,r)}return!1}function ie(e,t){return e.state===t.state&&e.raw===t.raw&&e.identity!==void 0&&t.identity!==void 0&&e.identity.dev===t.identity.dev&&e.identity.ino===t.identity.ino&&e.identity.size===t.identity.size&&e.identity.mtimeMs===t.identity.mtimeMs}function Ve(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function oe(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!p(n,process.platform))throw n}finally{t.closeFile(r)}}function N(e,t,r="durable"){try{return t.removeFile(e),r==="durable"&&oe(O(e),t),!0}catch{return!1}}function I(e,t){try{t.removeFile(e)}catch{}}import{randomUUID as rt}from"crypto";import{closeSync as nt,existsSync as it,fsyncSync as ot,linkSync as st,mkdirSync as ct,openSync as at,renameSync as lt,unlinkSync as ut,writeSync as dt}from"fs";import{dirname as ae}from"path";import{closeSync as He,existsSync as Qe,fsyncSync as Ze,mkdirSync as et,openSync as tt}from"fs";import{dirname as se}from"path";var ce=Object.freeze({platform:process.platform,pathExists:e=>Qe(e),makeDirectory:e=>et(e,{recursive:!0}),openFile:(e,t,r)=>tt(e,t,r),syncFile:e=>Ze(e),closeFile:e=>He(e)});function w(e,t=ce){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=se(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=F(i,g(se(o),t));return i}function g(e,t=ce){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(p(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function F(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}var le=Object.freeze({platform:process.platform,randomToken:()=>rt(),pathExists:e=>it(e),makeDirectory:e=>ct(e,{recursive:!0}),openFile:(e,t,r)=>at(e,t,r),writeFile:(e,t,r,n)=>dt(e,t,r,n),syncFile:e=>ot(e),closeFile:e=>nt(e),renameFile:(e,t)=>lt(e,t),linkFile:(e,t)=>st(e,t),removeFile:e=>ut(e)});function ue(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le,o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.renameFile(c,e),u=!1;let f=n==="durable"?F(s,g(o,i)):"not-requested";return de(n,f)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function hr(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le;if(!i.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"exclusive atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.linkFile(c,e);let f=n==="durable"?g(o,i):"not-requested";i.removeFile(c),u=!1;let d=n==="durable"?F(s,f,g(o,i)):"not-requested";return de(n,d)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function de(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function h(e,t,r={}){ue(e,mt(t,r),{durability:"visibility",runtime:r.runtime})}function mt(e,t){let r=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${r}
|
|
5
|
-
`:r}import{createHash as ft}from"crypto";import{existsSync as _,mkdirSync as pt,rmSync as yt}from"fs";import{tmpdir as gt}from"os";import{isAbsolute as bt,join as pe,resolve as E}from"path";var ye=1,St="SCIP_QUERY_SESSION",me="SCIP_QUERY_SESSION_DIR",Ft=128,xt=8,kt=32768,fe=new Map;function _r(e,t,r,n=!0,i){if(!n||e!=="anchors"&&e!=="system-map")return;let o=B();if(!o)return;let s=ge(t),c=M(s,o);if(e==="system-map"){r?yt(c,{force:!0}):_(c)&&i&&v(c,()=>{let l=C(c,s,o);l&&h(c,{...l,pendingMapContinuation:i,mapExecution:void 0,updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})});return}v(c,()=>{let l=wt(s,o),a={version:ye,projectRoot:s,sessionIdentity:o,mapRequired:!0,...l.length>0?{recommendedMapCommands:l}:{},updatedAt:new Date().toISOString()};h(c,a,{spacing:2,trailingNewline:!0})})}function Cr(e,t=!0){if(!t)return;let r=B();if(!r)return;let n=ge(e),i=M(n,r);_(i)&&v(i,()=>{let o=C(i,n,r);if(o){if(o.pendingMapContinuation)throw new Error(["MAP TRANSPORT INCOMPLETE","The selected system map has already been computed. Restarting it would repeat the same repository work.",`Continue exactly: ${o.pendingMapContinuation}`].join(`
|
|
6
|
-
`));if(o.mapExecution&&Et(o.mapExecution.processId))throw new Error(["NAVIGATION MAP ALREADY RUNNING","A selected system map is already computing in this SCIP_QUERY_SESSION.","Poll the existing terminal execution. Do not launch a duplicate map or inspect in parallel."].join(`
|
|
7
|
-
`));h(i,{...o,mapExecution:{processId:process.pid,startedAt:new Date().toISOString()},updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})}})}function Mr(e,t,r=!0){if(!r)return;let n=B();if(!n)return;let i=M(E(e),n);if(!_(i))return;let o=C(i,E(e),n);if(!o?.mapRequired)return;let s=o.recommendedMapCommands?.length?["This refusal is a recoverable protocol step, not evidence that the requested code cannot be explored.","Run exactly one of the ranked map commands below, then finish every emitted continuation:",...o.recommendedMapCommands.map((c,l)=>` [${l+1}] ${c}`)]:[`Do not retry ${t}. Run one printed next-abstraction system-map command and finish every emitted continuation first.`];throw new Error(["NAVIGATION MAP REQUIRED","An anchors locator completed in this SCIP_QUERY_SESSION, but its selected system map has not reached transport completion.",`Do not retry ${t}.`,...s,"The map must complete before the agent can choose source detail; map and detail exploration cannot run concurrently."].join(`
|
|
8
|
-
`))}function C(e,t,r){try{let n=JSON.parse(b(e,"navigation session state"));return n.version===ye&&n.projectRoot===t&&n.sessionIdentity===r&&n.mapRequired===!0&&(n.recommendedMapCommands===void 0||Array.isArray(n.recommendedMapCommands)&&n.recommendedMapCommands.length<=xt&&n.recommendedMapCommands.every(i=>typeof i=="string"&&i.startsWith("scip-query system-map ")&&i.length<=kt))&&(n.pendingMapContinuation===void 0||typeof n.pendingMapContinuation=="string")&&(n.mapExecution===void 0||typeof n.mapExecution=="object"&&n.mapExecution!==null&&Number.isSafeInteger(n.mapExecution.processId)&&typeof n.mapExecution.startedAt=="string")?n:null}catch{return null}}function wt(e,t){let r=ht(e,t),n=fe.get(r)??[];return fe.delete(r),n}function ht(e,t){return`${e}\0${t}`}function Et(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function M(e,t){let r=Pt();pt(r,{recursive:!0,mode:448});let n=ft("sha256").update(e).update("\0").update(t).digest("hex");return pe(r,`navigation-${n}.json`)}function Pt(){let e=process.env[me];if(!e)return pe(gt(),`scip-query-source-sessions-${process.getuid?.()??"user"}`);if(!bt(e))throw new Error(`${me} must be an absolute path.`);return E(e)}function ge(e){let t=process.env.SCIP_QUERY_PROJECT_ROOT?.trim();return E(t||e)}function B(){let e=process.env[St]?.trim();if(e&&!(e.length>Ft||!/^[A-Za-z0-9._:-]+$/u.test(e)))return`explicit:${e}`}function v(e,t){let r=te(`${e}.lock`,{kind:"navigation-session",detail:{state:e.slice(-17,-5)}});if(r.kind!=="acquired")throw new Error("Navigation session state is busy. Retry the completed command.");try{t()}finally{r.lock.release()}}export{Rt as a,At as b,It as c,Lt as d,Tt as e,Dt as f,S as g,ce as h,w as i,g as j,F as k,J as l,m,Y as n,b as o,Jt as p,jt as q,Yt as r,Gt as s,Xt as t,Kt as u,Vt as v,R as w,x,Z as y,ee as z,te as A,y as B,hr as C,h as D,_r as E,Cr as F,Mr as G};
|
|
9
|
-
//# sourceMappingURL=chunk-KFOYCQAJ.js.map
|