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-TQZV7KV4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var R=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function C(n){let t=n.toLowerCase();return R.some(e=>t.endsWith(e))}import{createRequire as b}from"module";var d=b(import.meta.url),c,l;function F(){if(c!==void 0)return c;try{c=d("ts-morph")}catch{c=null}return c}function j(){if(l)return l;let n=F();if(!n)return"ts-morph:unavailable";let t="unknown";try{t=d("ts-morph/package.json").version??"unknown"}catch{}return l=`ts-morph:${t}:typescript:${n.ts.version}`,l}function v(n,t){return t.map(e=>({tsconfigPath:e,project:new n.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0})}))}function $(n,t,e){return{language:"typescript",availability:()=>({available:!1,reason:n,tsconfigPath:t,tsconfigPaths:e}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function w(n,t){let e=M(n);for(let r of t.values())e.add(r);return e.finish()}function M(n){let t=new Map(n.map(r=>[r.symbol,r])),e=new Map(n.map(r=>[r.symbolId,[]]));return{add(r){for(let o of r){let a=t.get(o.targetSymbol);a&&e.get(a.symbolId).push(o.location)}},finish(){for(let[r,o]of e)e.set(r,h(o));return e}}}function D(n,t,e){let r=g(n,t),o=g(n,e),a=[...r].filter(s=>!o.has(s)).sort(),i=[...o].filter(s=>!r.has(s)).sort(),f=y(n,t),m=y(n,e),u=[...f].filter(s=>!m.has(s)).sort(),p=[...m].filter(s=>!f.has(s)).sort();return{passed:a.length===0&&i.length===0,expectedCount:r.size,actualCount:o.size,missing:a,extra:i,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:f.size,actualCount:m.size,missing:u,extra:p}}}function y(n,t){let e=new Set;for(let r of n)for(let o of t.get(r.symbolId)??[])o.file!==r.relativePath&&e.add(`${r.symbol}\0${o.file}`);return e}function k(n,t,e){let r=new Set(e),o=new Map(e.map(a=>[a,[]]));for(let a of n)for(let i of t.get(a.symbolId)??[])r.has(i.file)&&o.get(i.file).push({targetSymbol:a.symbol,location:i});for(let[a,i]of o)o.set(a,x(i));return o}function g(n,t){let e=new Set;for(let r of n)for(let o of t.get(r.symbolId)??[])e.add(`${r.symbol}\0${o.file}\0${o.line}\0${o.column}`);return e}function h(n){let t=new Map;for(let e of n)t.set(`${e.file}\0${e.line}\0${e.column}`,e);return[...t.values()].sort(S)}function x(n){let t=new Map;for(let e of n){let{location:r}=e;t.set(`${e.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,e)}return[...t.values()].sort((e,r)=>e.targetSymbol.localeCompare(r.targetSymbol)||S(e.location,r.location))}function S(n,t){return n.file.localeCompare(t.file)||n.line-t.line||n.column-t.column}export{R as a,C as b,F as c,j as d,v as e,$ as f,w as g,M as h,D as i,k as j};
|
|
2
|
-
//# sourceMappingURL=chunk-TQZV7KV4.js.map
|
package/dist/chunk-TY7CRN3Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as Q,m as X,v as P,x as I}from"./chunk-IZDPJ2QI.js";import{a as L,b as G,d as R}from"./chunk-GUFSG5TX.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{G as H,H as W,T as Y,ba as J,c as O,da as K,e as q,ga as z,r as U}from"./chunk-KYSDI3GE.js";import{a as V,g as F,h as S}from"./chunk-7F45LJKI.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
|
|
2
|
-
//# sourceMappingURL=chunk-TY7CRN3Z.js.map
|
package/dist/chunk-W7CXK74K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as B,b as J,c as y,e as b,f as O,h as T,k as _,l as z}from"./chunk-NWQXSFFU.js";import{y as N}from"./chunk-WB3WYIRE.js";import{b as U}from"./chunk-TEBQMNVI.js";import{h as d}from"./chunk-FESCRNVV.js";import{c as j,h as v,i as g,r as A,t as P,v as $,y as m}from"./chunk-JWTGMPIT.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=$(),i=new Map,o=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:l}of o.hits)E+=1,l.length>0&&(k+=1,H+=l.length,i.set(e.symbolId,l));let h=K(t,o.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,l]of B(o.misses)){if(!y(e)){a&&(u+=l.length);continue}let R=d(t,e);if(!R){a&&(c+=l.length),n.push(...l);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...l);continue}let Y=A(t,e,x,C);for(let D of l){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,l]of F)i.set(e,l);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,o=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v2-callsite-line";function G(t,s){let a=y(s);if(a==="typescript")return N(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=j("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(o=>`${o}:${g(t,o,d(t,o))}`);return v(i.join("|"))})}export{ce as a};
|
|
2
|
-
//# sourceMappingURL=chunk-W7CXK74K.js.map
|
package/dist/chunk-WB3WYIRE.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as L,b as fe,e as ye,h as X,k as we,m as ve}from"./chunk-TRNAEQ6P.js";import{b as N}from"./chunk-TEBQMNVI.js";import{B as Fe,a as Me}from"./chunk-ZOHS7AQV.js";import{c as Re,e as Ie}from"./chunk-FESCRNVV.js";import{b as Se,d as xe,h as Y,y as Z}from"./chunk-JWTGMPIT.js";import{G as me,J as x,S as ge,T,U as G,g as ae,i as ce,o as de,q as c,u as le,v as ue,wa as be,x as pe,xa as he}from"./chunk-N5B2NILC.js";import{execFileSync as Te}from"child_process";import{createHash as nt}from"crypto";import{existsSync as C,statSync as rt}from"fs";import{createRequire as it}from"module";import{platform as ot}from"os";import{dirname as Pe,join as A}from"path";var st=it(import.meta.url),Rn={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function Q(t){return[t.indexerBinary,...t.binaryAliases??[]]}function at(t){let e=Q(t);return e.length===1?e[0]:e.join(" or ")}function ee(t){for(let e of Q(t)){let n=ve(e);if(n)return n}return dt(t)}function In(t){return ee(t)!==null||ct(t)}function ct(t){return Ae(t)!==null}function dt(t){let e=Ae(t);if(!e)return null;let r=JSON.parse(x(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return A(Pe(e),r);for(let i of Q(t)){let o=r[i];if(o)return A(Pe(e),o)}return null}function Ae(t){if(!t.bundledNpmPackage)return null;try{return st.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function lt(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return r}return null}function ut(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return Be(e,n,r)}return null}function Fn(t,e){let n=pt(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function pt(t,e){try{return Be(t,e.relativePath,e.configuredPath)}catch{return null}}function Be(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=be(t,e,r),o=he(t,e,r),s=rt(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:nt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function ft(t,e,n={}){return(n.trustProjectTools?ut(t,e)?.canonicalPath:null)??ee(t)}function wn(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||te(n,e))return e;let r=Ee(n,e);return r?{...e,DOTNET_ROOT:r}:e}function vn(t,e,n={}){let r=at(t),i=e?ft(t,e,n):ee(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&<(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=mt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function mt(t){if(te(t,process.env))return{runnable:!0};let e=Ee(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=De(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ee(t,e){for(let n of De(e))if(te(t,{...e,DOTNET_ROOT:n}))return n;return null}function De(t){let e=[],n=t.DOTNET_ROOT;if(n&&C(n)&&e.push(n),ot()==="darwin"&&we("brew"))try{let r=Te("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=A(r,"libexec");C(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function te(t,e){try{return Te(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}import{getHeapStatistics as Ft}from"v8";var yt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return yt.some(n=>e.endsWith(n))}function q(t){let e=_(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(d=>[d.path,d])),i=t.snapshot.files.filter(d=>{let m=ae(d.path,["typescript"]);return m==="config"||m==="ambient"}).map(d=>d.path),o=_([...e,...i]),s=o.find(d=>!r.has(d)),a=new Set(t.snapshot.files.map(d=>d.path)).size!==t.snapshot.files.length,l=!s&&o.some(d=>ke(r.get(d))),u=Y(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:_(t.snapshot.typescriptProjects),membership:e})),p,f;return{identityFor(d,m){if(!n.has(d))return R("target-outside-project");if(a)return R("duplicate-input-path");if(s)return R("missing-input-fingerprint");if(l)return R("unreadable-input");let h=[],S,V;if(t.graph===null)h.push("dependency-graph-unavailable"),V="whole-project",S=o;else{let P=d===p&&f?f:gt(d,t.graph);if(p=d,f=P,P.find(K=>!r.has(K)))return R("missing-input-fingerprint");if(S=_([...P,...i]),S.some(K=>ke(r.get(K))))return R("unreadable-input");V="dependency-closure"}let tt=S.map(P=>bt(r.get(P)));return{version:1,key:Y(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:u,inputs:tt})),mode:V,inputFiles:S,reasons:h}}}}function gt(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function bt(t){return t.semanticHash===void 0?{path:t.path,size:t.size,hash:t.hash}:{path:t.path,semanticHash:t.semanticHash}}function ke(t){return t.size<0||t.hash==="unreadable"}function R(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function _(t){return[...new Set(t)].sort()}import{createRequire as ht}from"module";var je=ht(import.meta.url),B,$;function St(){if(B!==void 0)return B;try{B=je("ts-morph")}catch{B=null}return B}function W(){if($)return $;let t=St();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=je("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function kn(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function jn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var xt=xe("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function H(t,e,n){let r=xt.get(t,()=>Mt(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function I(t){return Me(t,{includeIgnored:!1}).filter(O).sort()}function Mt(t){try{if(!t.generation.metadataRaw)return null;let e=pe(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=ce(e.metadata.fingerprint);return n?{builder:q({projectFiles:I(t),snapshot:n,graph:N(t),engineIdentity:W()}),identities:new Map}:null}catch{return null}}function Ce(t,e){let n=ne(t);for(let r of e.values())n.add(r);return n.finish()}function ne(t){let e=new Map(t.map(r=>[r.symbol,r])),n=new Map(t.map(r=>[r.symbolId,[]]));return{add(r){for(let i of r){let o=e.get(i.targetSymbol);o&&n.get(o.symbolId).push(i.location)}},finish(){for(let[r,i]of n)n.set(r,Rt(i));return n}}}function Oe(t,e,n){let r=Ne(t,e),i=Ne(t,n),o=[...r].filter(f=>!i.has(f)).sort(),s=[...i].filter(f=>!r.has(f)).sort(),a=Le(t,e),l=Le(t,n),u=[...a].filter(f=>!l.has(f)).sort(),p=[...l].filter(f=>!a.has(f)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:a.size,actualCount:l.size,missing:u,extra:p}}}function Le(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function Un(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,It(s));return i}function Ne(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function Rt(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(_e)}function It(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||_e(n.location,r.location))}function _e(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var J="typescript-reference-fragment-v2",qe=128,D=Re({kind:"typescript-reference-fragments",invalidation:Ie("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Et});function or(t,e,n,r=t,i,o=new Set(n.keys())){let s=I(t),a=q({projectFiles:s,snapshot:e,graph:i??N(t),engineIdentity:W()}),l=[],u=0;for(let[f,d]of n){let m=a.identityFor(f,J).key;if(!m){u+=1;continue}l.push({relativePath:f,contentHash:m,value:[...d]})}let p=s.filter(f=>!o.has(f)&&!n.has(f)).length;return D.writeBatch(r,l),{affectedFiles:l.length,carriedFiles:p,skippedAffectedFiles:u}}function sr(t,e,n,r){let i=e.filter(s=>O(s.relativePath));if(i.length===0)return E("no TypeScript definitions");let o=E("shadow did not run");return Z("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=E("TypeScript reference fragment provider is unavailable"),o;let a=I(t),l=new Set(a),u=new Map;for(let m of $e(a)){let h=s.referenceFragmentsForFiles(m);if(m.some(S=>!h.has(S)))return o=E("TypeScript reference fragment provider returned an incomplete batch"),o;for(let S of m)u.set(S,h.get(S)??[])}let p=Ce(i,u),f=Oe(i,wt(n,l),p);if(!f.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...f},o;let d=[];for(let m of a){let h=H(t,m,J);h?.key&&d.push({relativePath:m,contentHash:h.key,value:u.get(m)??[]})}return D.writeBatch(t,d),o={state:"passing",files:a.length,keyedFiles:d.length,writtenFiles:d.length,...f},o}catch(s){return o=E(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function wt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function ar(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return Z("typescript.reference-fragments.materialize",()=>{try{let l=I(t);i=l.length;let u=ne(e),p=[];for(let d of l){let m=H(t,d,J);if(!m?.key)return null;let h=D.read(t,d,m.key);h===null?(s+=1,p.push({file:d,contentHash:m.key})):(o+=1,u.add(h))}return s===0?(r="hit",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):At(t,p,n,d=>{for(let{fragments:m}of d)u.add(m);a+=d.length})?(r="computed",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):null}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function $e(t){let e=[];for(let n=0;n<t.length;n+=qe)e.push(t.slice(n,n+qe));return e}var vt=.75;function Pt(t){return{heapUsedFraction:()=>{let e=Ft();return e.heap_size_limit>0?e.used_heap_size/e.heap_size_limit:0},collect:Fe,release:()=>Se(t,{groups:["semantic-provider"]})}}function Tt(t,e=vt){return t.heapUsedFraction()<e||t.collect()&&t.heapUsedFraction()<e?!1:(t.release(),!0)}function At(t,e,n,r,i=Pt(t)){for(let o of $e(e)){let s=Bt(t,o,n);if(!s)return!1;r(s),Tt(i)}return!0}function Bt(t,e,n){let r=e.map(({file:s})=>s),i=n(r[0]);if(!i.availability().available||!i.referenceFragmentsForFiles)return null;let o=i.referenceFragmentsForFiles(r);return r.some(s=>!o.has(s))?null:(D.writeBatch(t,e.map(({file:s,contentHash:a})=>({relativePath:s,contentHash:a,value:o.get(s)??[]}))),r.map(s=>({file:s,fragments:o.get(s)??[]})))}function cr(t){let e=I(t),n=0;for(let r of e){let i=H(t,r,J);if(!i?.key)return null;D.has(t,r,i.key)||(n+=1)}return{files:e.length,missing:n}}function E(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Et(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Dt)?null:e}catch{return null}}function Dt(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as jt,randomUUID as Ve}from"crypto";import{closeSync as mr,existsSync as v,fstatSync as yr,lstatSync as j,mkdirSync as gr,openSync as br,readdirSync as w,readSync as hr,renameSync as Ke,rmSync as M}from"fs";import{basename as U,dirname as Lt,join as y}from"path";function We(t){return re(t,kt)}function re(t,e){return Array.isArray(t)?`[${t.map(n=>re(n,e)).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([n],[r])=>e(n,r)).map(([n,r])=>`${JSON.stringify(n)}:${re(r,e)}`).join(",")}}`:JSON.stringify(t)}function kt(t,e){return t.localeCompare(e)}var Nt=1,Ct=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),F=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Ot=".owner.json",_t={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function wr(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function qt(t={}){let e={...Ct,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function Ge(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ge(n));return G(...e)}function vr(t,e){return jt("sha256").update(We({namespace:t,payload:e})).digest("hex")}function Xe(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function Pr(t,e,n={}){let r=qt(n.limits),i=n.nowMs??Date.now(),o=Ge(t);return Kt(e),Wt(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??ye,n.durability??"durable",()=>{$t(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),l=He(t,e.id);if(l){let d=Je(l,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:d.deadlineAtMs??e.deadlineAtMs}}let u=`${JSON.stringify(e)}
|
|
2
|
-
`,p=Buffer.byteLength(u),f=Ye(t);if(p>r.maxItemBytes)throw new F("item-too-large",f,r,p);if(f.totalItems+1>r.maxItems)throw new F("item-capacity",f,r,p);if(f.totalBytes+p>r.maxBytes)throw new F("byte-capacity",f,r,p);n.onBeforePublish?.();try{let d=n.durability??"durable",m=X(s,u,{durability:d}),h=d==="durable"?G(o,m.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:m.achievedDurability,directorySync:h}}catch(d){if(d.code!=="EEXIST")throw d;let m=He(t,e.id);if(!m)throw d;let h=Je(m,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function $t(t,e,n,r=_t){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of oe(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(v(a)){M(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||zt(t,s.ownerId,r)!=="dead")continue;let l=y(t.pendingDir,s.originalFile);try{Ke(s.path,l),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;M(s.path,{force:!0})}T(Lt(s.path)),T(t.pendingDir),o--}o=Ue(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Ue(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of Ze(s)){if(o<=0)break;if(!U(a).includes(".tmp-"))continue;let l;try{l=j(a).mtimeMs}catch(u){if(u.code==="ENOENT")continue;throw u}l+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--)}}return Gt(t.inflightDir),i}function Ye(t){Ge(t);let e=[...k(t.pendingDir).map(l=>({path:l,pending:!0})),...k(t.legacyRequestDir).map(l=>({path:l,pending:!0}))],n=oe(t.inflightDir).map(l=>({path:l.path,pending:!1})),r=k(t.responseDir).map(l=>({path:l,pending:!1})),i=k(t.deadLetterDir).map(l=>({path:l,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let l of e){let u=se(l.path);if(!u){s++;continue}let p=u.enqueuedAtMs;if(p===void 0)try{p=j(l.path).mtimeMs}catch(f){if(f.code==="ENOENT")continue;throw f}a=a===void 0?p:Math.min(a,p)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((l,u)=>l+Xt(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Wt(t,e,n,r,i,o){let s=y(t.rootDir,".admission.lock"),a=`${process.pid}-${Ve()}`,l=r()+Math.max(0,n);for(;!Ht(t.rootDir,s,a,i);){if(Jt(s),r()>=l)throw new F("admission-busy",Ye(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{ie(s).ownerToken===a&&(M(s,{recursive:!0,force:!0}),i==="durable"&&T(t.rootDir))}catch{}}}function Ht(t,e,n,r){let i=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
3
|
-
`;try{return X(e,i,{durability:r}),!0}catch(o){if(o.code==="EEXIST")return!1;try{ie(e).ownerToken===n&&(M(e,{force:!0}),r==="durable"&&T(t))}catch{}throw o}}function Jt(t){let e=null;try{let r=ie(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||Ut(e))return;let n=`${t}.stale-${Ve()}`;try{Ke(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}M(n,{recursive:!0,force:!0})}function ie(t){try{return JSON.parse(x(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof me&&e.reason==="not-regular"))throw e;return JSON.parse(x(y(t,"owner.json"),"mailbox lock owner record"))}}function Ut(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function zt(t,e,n){let r=Vt(y(t.inflightDir,Qe(e),Ot));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?fe(r.processIdentity,i)?"live":"dead":"unknown"}function Vt(t){try{let e=JSON.parse(x(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:L(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function He(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(v(n))return n;for(let n of oe(t.inflightDir))if(n.requestId===e)return n.path;return null}function Je(t,e,n){let r=se(t);if(r?.operationKey===e)return r;if(U(t)===`${Xe(e)}.json`)return{id:n,operationKey:e};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function Kt(t){if(t.mailboxVersion!==Nt||t.id!==Xe(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function oe(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=ze(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of w(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=ze(s[1]),l=Number(s[2]);if(a===null||U(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(l))continue;let u=y(i,o.name),p=se(u)??{id:U(a,".json")},f;try{f=j(u)}catch(d){if(d.code==="ENOENT")continue;throw d}e.push({requestId:p.id,ownerId:r,path:u,originalFile:a,claimedAtMs:f.mtimeMs,claimExpiresAtMs:l,byteLength:f.size,...p.operationKey?{operationKey:p.operationKey}:{},...p.clientId?{clientId:p.clientId}:{},...p.enqueuedAtMs===void 0?{}:{enqueuedAtMs:p.enqueuedAtMs},...p.deadlineAtMs===void 0?{}:{deadlineAtMs:p.deadlineAtMs},legacy:p.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function se(t){try{let e=JSON.parse(x(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Ue(t,e,n,r,i){for(let o of k(t)){if(e<=0)break;let s;try{s=j(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function k(t){return v(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function Ze(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...Ze(r))}return e.sort()}function Gt(t){if(v(t))for(let e of w(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);w(n).some(r=>r.endsWith(".claim"))||M(n,{recursive:!0,force:!0})}}function Xt(t){try{return j(t).size}catch{return 0}}function Qe(t){return Buffer.from(t,"utf8").toString("base64url")}function ze(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return Qe(e)===t?e:null}catch{return null}}import{join as z}from"path";var jr=1e4,Yt="watch.lock",Zt="watch-state.json",Qt="watch-activity.json",en="watch-refresh-requests";function Lr(t){return{lockPath:z(t,Yt),statePath:z(t,Zt),activityPath:z(t,Qt),refreshRequestsPath:z(t,en)}}function Nr(t){try{return tn(JSON.parse(x(t,"watch service state")))}catch{return null}}function tn(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!g(e.startedAt)||!g(e.heartbeatAt)||!g(e.lastActivityAt)||!nn(e.watcher)||e.idleDeadlineAt!==void 0&&!g(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=L(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!rn(e.lastError)||e.lastRefresh!==void 0&&!on(e.lastRefresh)||e.reindexActivity!==void 0&&!sn(e.reindexActivity)||e.refreshRequests!==void 0&&!cn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!dn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!ln(e.typescriptIndex)?null:e}function g(t){return de(t)}function nn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return b(e.changedFiles)&&b(e.reindexAt);case"indexing":return b(e.startedAt);case"cooldown":return b(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return b(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&c(e.rebuilt)&&c(e.estimatedWriteBytes);case"draining":return b(e.startedAt)&&typeof e.reason=="string";default:return!1}}function rn(t){if(!t||typeof t!="object")return!1;let e=t;return g(e.at)&&typeof e.message=="string"}function on(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&g(e.startedAt)&&g(e.completedAt)&&b(e.durationMs)}function sn(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!c(e.recordsRead)||e.invalidRecords!==void 0&&!c(e.invalidRecords)||e.skippedRecords!==void 0&&!c(e.skippedRecords)||e.readErrors!==void 0&&!c(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!c(e.ignoredPartialTailBytes)||!g(e.windowStartedAt)||!g(e.windowEndedAt)||!c(e.runs)||!c(e.rebuilt)||e.fullRebuilds!==void 0&&!c(e.fullRebuilds)||!c(e.reused)||!c(e.failed)||!c(e.suppressed)||!b(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!c(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!c(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!c(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!g(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!g(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!c(e.attributedRuns)||e.unattributedRuns!==void 0&&!c(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!c(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!an(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||c(n))}function an(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!ue.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!c(r.runs)||!c(r.rebuilt)||!c(r.reused)||!c(r.producedOutputBytes)||!le(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function cn(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.claimed)&&c(e.completed)&&c(e.expired)&&c(e.invalid)&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function dn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&b(e.requests)&&b(e.sessionsCreated)&&b(e.sessionsReused)&&b(e.sessionsRefreshed)&&b(e.sessionsReplaced)&&b(e.projectsCreated)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||et(e.mailbox))}function ln(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&c(e.requests)&&c(e.sessionsCreated)&&c(e.sessionsReplaced)&&(e.sessionsEvicted===void 0||c(e.sessionsEvicted))&&(e.activeSessions===void 0||c(e.activeSessions))&&(e.maxActiveSessions===void 0||c(e.maxActiveSessions))&&(e.heapUsedBytes===void 0||c(e.heapUsedBytes))&&(e.heapLimitBytes===void 0||c(e.heapLimitBytes))&&(e.softMemoryLimitBytes===void 0||c(e.softMemoryLimitBytes))&&(e.retireRequested===void 0||typeof e.retireRequested=="boolean")&&c(e.initializations)&&c(e.programUpdates)&&c(e.documentsEmitted)&&c(e.documentsRemoved)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastDurationMs===void 0||b(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||et(e.mailbox))}function et(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.inflight)&&c(e.responses)&&c(e.deadLetters)&&c(e.invalid)&&c(e.totalItems)&&b(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function b(t){return typeof t=="number"&&Number.isFinite(t)}export{Rn as a,at as b,ee as c,In as d,lt as e,ut as f,Fn as g,wn as h,vn as i,We as j,Nt as k,wr as l,vr as m,Xe as n,Pr as o,jr as p,Lr as q,Nr as r,yt as s,O as t,St as u,kn as v,jn as w,Un as x,H as y,or as z,sr as A,ar as B,cr as C};
|
|
4
|
-
//# sourceMappingURL=chunk-WB3WYIRE.js.map
|
package/dist/chunk-WK46TNUM.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as H,b as O,c as pe,e as de,f as U,j as ue}from"./chunk-TQZV7KV4.js";import{T as v,U as ye,c as se,d as ae,e as ce,f as le,g as _,n as fe}from"./chunk-3L2ZBPEX.js";import{a as A}from"./chunk-YXPUP5G2.js";import{d as w,e as me}from"./chunk-DRENNWRG.js";import{d as oe}from"./chunk-RTQ7NEKG.js";import{c as ie}from"./chunk-IW5XQG5G.js";import{a as j,e as I}from"./chunk-HGFDYOVB.js";import{$ as K,W as re}from"./chunk-KYSDI3GE.js";import{h as ne}from"./chunk-7F45LJKI.js";import{existsSync as E}from"fs";import b from"path";var W=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(o,e){let t=e?b.dirname(b.join(o,e)):o,r=b.resolve(o);for(;t.startsWith(r);){for(let s of W){let a=b.join(t,s);if(E(a))return a}let i=b.dirname(t);if(i===t)break;t=i}for(let i of W){let s=b.join(o,i);if(E(s))return s}return null}function ge(o){let e=o.config.projectRoot,n=new Set(He(e,o.config.semantic?.typescript?.tsconfigs)),t=A(o,{includeIgnored:!1,extensions:H});for(let r of t){let i=z(e,r);i&&n.add(b.resolve(i))}if(n.size===0){let r=z(e);r&&n.add(b.resolve(r))}return[...n].filter(r=>!he(e,r)).sort((r,i)=>r.localeCompare(i))}function He(o,e=[]){let n=new Set;for(let t of e){let r=b.isAbsolute(t)?t:b.join(o,t);E(r)&&n.add(b.resolve(r))}for(let t of Oe(o))for(let r of W){let i=b.join(t,r);E(i)&&n.add(b.resolve(i))}if(n.size===0){let t=z(o);t&&n.add(b.resolve(t))}return[...n].filter(t=>!he(o,t)).sort((t,r)=>t.localeCompare(r))}function Oe(o){let e=b.join(o,"package.json");if(!E(e))return[];let n;try{n=JSON.parse(ne(e,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>le(o,r))}function he(o,e){let n=b.relative(o,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function x(o,e,n){if(o.has(e))return o.get(e);let t=n();return o.set(e,t),t}import Me from"path";import{realpathSync as Se}from"fs";function Ue(o,e){return o.getReferences().map(n=>{let t=n.getNode();return B(t,e)})}function Be(o){let e=o;return typeof e.findReferences=="function"?e.findReferences():[]}function Ie(o,e,n,t){let r=[];for(let i of Be(o))for(let s of Ue(i,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let i of n)r.push(i);return P(r)}function xe(o,e,n,t){let r=[],i=n?.getStart();for(let s of o.getReferences()){let a=s.getNode();L(t,a.getSourceFile().getFilePath())===e&&(i!==void 0&&a.getStart()===i||r.push({location:B(a,t),node:a}))}return r}function B(o,e){let n=o.getSourceFile(),t=n.getLineAndColumnAtPos(o.getStart());return{file:L(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function Fe(o,e,n){let t=o.getSourceFile(),r=q(t,o),i=o.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),a=t.getFullText().split(`
|
|
2
|
-
`),c=[];for(let l=0;l<a.length;l++){if(l===r)continue;let f=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)c.push({file:e,line:l,column:p.index})}return P(c.filter(l=>L(n,Me.join(n,l.file))===e))}function V(o){for(let e=o;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(o,e){return o.getLineAndColumnAtPos(e.getStart()).line-1}function P(o){let e=new Set,n=[];for(let t of o){let r=`${t.file}:${t.line}:${t.column}`;e.has(r)||(e.add(r),n.push(t))}return n}function L(o,e){let n=o||process.cwd(),t=be(n,e);if(t)return t;try{return be(Se(n),Se(e))}catch{return null}}function be(o,e){let n=Me.relative(o,e).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Te(o,e,n,t){let r=$e(e,t);return r.size===0?new Map:Ke(o,n,r)}function $e(o,e){let n=new Map;for(let t of v(o,e)){let r=w(t.symbol)??t.leaf;if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(t)}return n}function Ke(o,e,n){let t=new Map,r=new Map;return e.forEachDescendant(i=>{for(let s of _e(o,i)){let a=n.get(s);if(!a)continue;let c=q(e,i);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=r.get(l.symbolId);p!==void 0&&p<=f||(r.set(l.symbolId,f),t.set(l.symbolId,i))}}}),t}function _e(o,e){let n=[],t=r=>{r&&!n.includes(r)&&n.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();t(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();t(r)}return o.Node.isIdentifier(e)&&t(e.getText()),n}var We=ie("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(o,e,n,t){let r=J(o,e),i=Y(r.get(t)??[],n);if(i)return i;let s=[];for(let a of r.values())for(let c of a)((c.leaf||w(c.symbol)||"").includes(t)||c.symbol.includes(t))&&s.push(c);return Y(s,n)}function G(o,e,n,t){return Y(J(o,e).get(t)??[],n)}function De(o,e){let n=new Map;for(let[t,r]of J(o,e)){let i=r[0];i&&n.set(t,i)}return n}function J(o,e){return We.get(o,e,()=>{let n=new Map;for(let t of v(o,e)){let r=t.leaf||w(t.symbol);if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push({...t,leaf:r})}for(let t of n.values())t.sort((r,i)=>r.startLine-i.startLine||r.endLine-i.endLine||r.symbolId-i.symbolId);return n})}function Y(o,e){let n=null,t=Number.POSITIVE_INFINITY;for(let r of o){let i=Math.abs(r.startLine-e);(i<t||i===t&&n&&r.startLine<n.startLine)&&(n=r,t=i)}return n}import ze from"path";import{realpathSync as Ve}from"fs";function Re(o,e){let n=new Map,t=null,r=null,i=()=>(r??=A(o,{extensions:H}),r),s=()=>(t??=I("typescript.source-file-index",()=>qe(o.config.projectRoot,e,i()),()=>({projects:e.length,indexedDocuments:i().length})),t),a=c=>O(c)?x(n,c,()=>{let l=Ne(o.config.projectRoot,c);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&X(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:i}}function qe(o,e,n){let t=e.map(({project:r})=>{let i=new Map;for(let s of r.getSourceFiles())X(i,s);return{project:r,sourceFiles:i}});for(let r of n){let i=Ne(o,r);if(i)for(let s of t){if(s.sourceFiles.has(i))break;let a=s.project.addSourceFileAtPathIfExists(i)??null;if(a){X(s.sourceFiles,a);break}}}return t}function X(o,e){let n=Q(e.getFilePath());o.set(n,e);try{o.set(Q(Ve(n)),e)}catch(t){if(!K(t))throw t}}function Ne(o,e){try{return Q(re(o,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function Q(o){return ze.resolve(o)}function Z(o,e){for(let n of o)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function Ce(o){let e=`${o.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}var Ye=32;function tn(o,e){let n=I("typescript.provider.load",()=>pe());if(!n)return U("ts-morph is not installed");let t=I("typescript.provider.tsconfig-discovery",()=>ge(o));if(t.length===0)return U("no tsconfig found");try{let r=I("typescript.provider.project-bundles",()=>de(n,t),()=>({tsconfigs:t.length}));return Ge(o,n,r)}catch(r){return U(r instanceof Error?r.message:String(r),t[0],t)}}function Ge(o,e,n,t={}){return I("typescript.provider.construct",()=>new ee(o,e,n),()=>({tsconfigs:n.length,reusedProjects:t.reusedProjects===!0}))}var ee=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=ce(e.config.projectRoot),this.sourceFiles=Re(e,t)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return x(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=Xe();return I("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return x(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e,n={}){let t=new Map,r=j(),i=[];for(let f of e){let p=this.referencesCache.get(f.symbolId);p?t.set(f.symbolId,p):i.push(f)}if(i.length===0)return t;let s=i,a=n.exact?[]:i.filter(f=>!Pe(f));if(a.length>=Ye){let f=this.referencesForDefinitionsBySymbolScan(a);for(let p of a){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}if(s=i.filter(p=>Pe(p)),s.length===0)return t}let c=new Map;for(let f of s){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Le();I("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){r&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;r&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,r?d:void 0);this.referencesCache.set(y.symbolId,u),t.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...Ee(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}}return t}referenceFragmentsForFiles(e){let n=ye(this.db).filter(i=>O(i.relativePath)),t=e.filter(i=>this.sourceFiles.sourceFile(i)!==null),r=this.referencesForDefinitionsBySymbolScan(n,t);return ue(n,r,t)}referencesForDefinitionsBySymbolScan(e,n){let t=j(),r=Le(),i=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)i.set(c.symbolId,[]);return I("typescript.references-map.inverted-scan",()=>{let c=t?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of e){let g=l.get(u.symbolId)??[];if(g.length>0){let T=i.get(u.symbolId)??[];T.push(...g),i.set(u.symbolId,T)}t&&(r.packageReferenceCount+=g.length)}t&&(r.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(e),S=new Set(e.map(u=>u.leaf).filter(Boolean)),y=t?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(t&&(r.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,s,a,d,S,f,p,i,t?r:void 0))}t&&(r.scanMs+=m.now()-y);let h=t?m.now():0;this.addHierarchyMemberReferences(e,i,t?r:void 0),t&&(r.hierarchyMs+=m.now()-h);for(let[u,g]of i){let T=P(g);i.set(u,T),t&&(r.referenceCount+=T.length)}},()=>({definitions:e.length,...Ee(r)})),i}addReferencesFromSourceFileScan(e,n,t,r,i,s,a,c,l,f){let p=this.compilerCheckerForSourceFile(e),d=e.compilerNode,S=et(e),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!s.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;a.has(u)?g=a.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),a.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let T=x(c,u,()=>this.compilerSymbolKeys(u)),N=null,k=null,C=g&&t.has(g.symbolId)?r.get(g.symbolId):void 0;if(C&&(N=$(d,h),!ve(C,n,N))){let R=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:R.line,column:R.character};let D=l.get(C.symbolId)??[];D.push(k),l.set(C.symbolId,D),f&&(f.requestedHits+=1)}for(let R of T)for(let D of i.get(R)?.values()??[]){if(N??=$(d,h),ve(D,n,N))continue;if(!k){let F=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:F.line,column:F.character}}let M=l.get(D.symbolId)??[];M.push(k),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsMemo=null;hierarchyTargetsForDefinitions(e){let n=ot(e);if(this.hierarchyTargetsMemo?.key===n)return this.hierarchyTargetsMemo.targets;let t=oe(this.db),r=`definitions:${n}`,i=!1,s=I("typescript.references-map.hierarchy-targets",()=>{if(t){let c=we.read(this.db,r,t);if(c&&c.projectRoot===this.db.config.projectRoot)return i=!0,it(c,e)}let a=this.computeHierarchyTargets(e);return t&&we.write(this.db,r,t,{version:Ae,projectRoot:this.db.config.projectRoot,entries:[...a].map(([c,l])=>[c,[...l.values()].map(f=>f.symbol)])}),a},()=>({definitions:e.length,hit:i}));return this.hierarchyTargetsMemo={key:n,targets:s},s}computeHierarchyTargets(e){let n=new Map;for(let t of e){let r=this.nodeForDefinition(t),i=r?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(r.getSourceFile()),c=a.getSymbolAtLocation(i.name);if(c)for(let l of this.hierarchyMemberSymbols(a,s,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(t.symbolId,t),n.set(f,p)}}return n}hierarchyMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(!i.has(a)){i.add(a),r.add(c);for(let f of l){let p=f.getProperty(t.name);p&&s(f,p,this.hierarchyAncestorTypesForType(e,f))}}};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}addHierarchyMemberReferences(e,n,t){let r=new Map;for(let i of e){let s=this.nodeForDefinition(i),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(a.name);if(!f)continue;let p=a.getSourceFile(),d=p.getLineAndCharacterOfPosition(a.name.getStart(p)),S={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},y=n.get(i.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),t&&(t.hierarchyReferences+=1);n.set(i.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=r.get(u)??new Map;g.set(i.symbolId,S),r.set(u,g)}t&&(t.hierarchyDefinitions+=1)}for(let i of r.values())if(!(i.size<2)){t&&(t.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let a=n.get(s.symbolId)??[];for(let c of i.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),t&&(t.hierarchyReferences+=1));n.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(i.has(a))return;i.add(a);let f=!1;for(let p of l){let d=p.getProperty(t.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(e,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))r.add(p)};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}compilerSymbolKeys(e){return(e.declarations??[]).map(n=>{let t=n.getSourceFile();return`${t.fileName}\0${n.getStart(t)}\0${e.name}`})}compilerSymbolLocations(e){let n=[];for(let t of e.declarations??[]){let r=t.getSourceFile(),i=L(this.db.config.projectRoot,r.fileName);if(!i)continue;let s=t.name,a=r.getLineAndCharacterOfPosition((s??t).getStart(r));n.push({file:i,line:a.line,column:a.character})}return n}baseTypes(e,n){try{return e.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(e,n){let t=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(n)));for(let r of n.heritageClauses??[])for(let i of r.types)t.add(e.getTypeAtLocation(i));return[...t]}hierarchyAncestorTypesForType(e,n){let t=new Set(this.baseTypes(e,n));for(let r of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(r))for(let i of r.heritageClauses??[])for(let s of i.types)t.add(e.getTypeAtLocation(s));return[...t]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let r=e.getSymbolAtLocation(n);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return x(this.calleesCache,e.symbolId,()=>x(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map,t=new Map;for(let r of e){let i=t.get(r.relativePath);i?i.push(r):t.set(r.relativePath,[r])}for(let[r,i]of t){let s=this.fileCalleesCache.get(r),a=new Set(i.map(l=>l.symbolId)),c=s??this.calleeMapForFile(r,a);for(let l of i){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(e,n,t){let r=t?m.now():0,i=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-r,t.packageReferenceCount+=i.length),!n)return i;let s=t?m.now():0,a=Ie(n,e,i,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return x(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let t=n.getType().getCallSignatures()[0];if(!t)return null;let r=t.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return je(c)}),i=t.getReturnType().getText(n);return`(${r.join(",")})=>${je(i)}`})}importUsageForSourceFile(e,n,t){let r=[],i=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=_(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of te(s)){t.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?t.bindingSymbols+=1:t.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(r.push(p),c||!l.localName||!f)continue;let d=i.get(l.localName);d?d.push(p):i.set(l.localName,[p])}}return i.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=i.get(s.getText());if(!a||Qe(s))return;t.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:B(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),r.map(s=>s.typeOnlyDeclaration?Je(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let r=t.identifier?t.identifier.findReferences():[],i=[];for(let s of r)for(let a of xe(s,e,t.identifier,this.db.config.projectRoot))i.push(a);return this.valueImportUsageFromLocations(e,n,t,i)}valueImportUsageFromLocations(e,n,t,r){let i=r.some(c=>!V(c.node)),s=r.some(c=>V(c.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||r.length>0,isTypeUsed:a||s,isValueUsed:i,references:r.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let n=new Map,t=new Set;for(let i of e){let s=this.sourceFiles.sourceFile(i);if(s)for(let a of s.getImportDeclarations()){let c=Z(this.workspacePackages,a.getModuleSpecifierValue());c&&t.add(c)}}if(t.size===0)return n;let r=this.packageExportsForNames(t);for(let i of e)this.addPackageImportReferencesForDocument(n,r,i);for(let[i,s]of n)n.set(i,P(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,r]of e)e.set(t,P(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let r=this.sourceFiles.sourceFileMatch(t);if(r)for(let i of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,i)}addPackageImportReferencesForDeclaration(e,n,t,r){let i=Z(this.workspacePackages,r.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let a of te(r)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=Fe(a.identifier,t,this.db.config.projectRoot);l.length>0&&st(e,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let n=new Map;for(let t of this.workspacePackages){if(!e.has(t.name))continue;let r=new Map;for(let i of Ce(t))this.collectPackageExports(t,i,r,new Set);r.size>0&&n.set(t.name,r)}return n}collectPackageExports(e,n,t,r){if(r.has(n))return;r.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?_(this.db,n,a):n;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,t,r);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=t.get(d);y||(y=new Set,t.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(e,n){return x(this.indexedDefinitionLeafCache,e,()=>De(this.db,e)).get(n)??null}nodeForDefinition(e){return x(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return x(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?Te(this.tsMorph,this.db,n,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,n,t=!1){let r=e.name,i=n?m.now():0,s=e.declarations??[];n&&(n.declarationsMs+=m.now()-i,n.declarationChecks+=s.length);for(let a of s){let c=n?m.now():0,l=a.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(a.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(a),y=t?G(this.db,f,p,r)??(S&&S!==r?G(this.db,f,p,S):null):ke(this.db,f,p,r);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(e){let n=e.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(e,n){let t=j(),r=0,i=0,s=0,a=0,c=0,l=0,f=0,p=0,d=t?nt():void 0;return I("typescript.callee-map.file",()=>{let S=t?m.now():0,y=this.sourceFiles.sourceFile(e);if(t&&(c=Math.round(m.now()-S)),!y)return new Map;let h=t?m.now():0,u=v(this.db,e).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(t&&(l=Math.round(m.now()-h)),r=u.length,u.length===0)return new Map;let g=new Map,T=t?m.now():0,N=this.compilerCheckerForSourceFile(y),k=y.compilerNode;t&&(f=Math.round(m.now()-T));let C=new Map,R=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){t&&(i+=1);let F=this.semanticCalleeForCallNode(N,k,u,M,C,n,d);F&&(t&&(s+=1),Ze(g,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,R)},D=t?m.now():0;R(k),t&&(p=Math.round(m.now()-D));for(let[M,F]of g)g.set(M,at(F));return a=g.size,g},()=>({relativePath:e,definitions:r,callNodes:i,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??r,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?rt(d):{}}))}semanticCalleeForCallNode(e,n,t,r,i,s,a){let c=a?m.now():0,l=tt(t,$(n,r));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let f=r.expression,p=this.compilerSymbolForExpression(e,f,a),d=null;if(p)if(a&&(a.targetSymbolHits+=1),i.has(p))a&&(a.compilerSymbolCacheHits+=1),d=i.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let S=a?m.now():0;d=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-S),i.set(p,d)}else a&&(a.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:$(n,r)}}:null}compilerSymbolForExpression(e,n,t){let r=t?m.now():0,i=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-r),i)return i;t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let n=e.getProject(),t=this.compilerCheckerCache.get(n);return t||(t=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,t)),t}};function te(o){let e=[],n=o.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});let t=o.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});for(let r of o.getNamedImports()){let i=r.getNameNode(),a=r.getAliasNode()??(i.getKindName()==="Identifier"?i:null);e.push({identifier:a,importedName:i.getText(),localName:a?.getText()??i.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(o.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Je(o,e,n){return{importer:o,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Xe(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Qe(o){for(let e=o;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function Ze(o,e,n){let t=o.get(e);t||(t=[],o.set(e,t)),t.push(n)}function et(o){let e=new Set;for(let n of o.getImportDeclarations())for(let t of te(n))t.localName&&e.add(t.localName);return e}function tt(o,e){let n=null;for(let t of o)e<t.startLine||e>t.endLine||(!n||t.startLine>=n.startLine)&&(n=t);return n}function $(o,e){return o.getLineAndCharacterOfPosition(e.getStart(o)).line}function ve(o,e,n){return e===o.relativePath&&n>=o.startLine&&n<=o.endLine}function Pe(o){return o.symbol.includes("#")?me(o.symbol)==="type"&&o.relativePath.endsWith(".d.ts"):!1}function nt(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function rt(o){return{...o,callerLookupMs:Math.round(o.callerLookupMs),expressionSymbolMs:Math.round(o.expressionSymbolMs),typeSymbolMs:Math.round(o.typeSymbolMs),targetLookupMs:Math.round(o.targetLookupMs),declarationsMs:Math.round(o.declarationsMs),declarationLocationMs:Math.round(o.declarationLocationMs),indexedLookupMs:Math.round(o.indexedLookupMs)}}function Le(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}var Ae=1,we=se({kind:"typescript-hierarchy-targets",invalidation:ae("typescript-hierarchy-targets"),serialize:o=>JSON.stringify(o),deserialize:o=>{try{let e=JSON.parse(o);return e.version!==Ae||typeof e.projectRoot!="string"||!Array.isArray(e.entries)?null:e}catch{return null}}});function it(o,e){let n=new Map(e.map(r=>[r.symbol,r])),t=new Map;for(let[r,i]of o.entries){let s=new Map;for(let a of i){let c=n.get(a);c&&s.set(c.symbolId,c)}s.size>0&&t.set(r,s)}return t}function ot(o){let e=2166136261;for(let n of o)e^=n.symbolId,e=Math.imul(e,16777619)>>>0;return`${o.length}:${e.toString(16)}`}function Ee(o){return{...o,scanMs:Math.round(o.scanMs),packageRefsMs:Math.round(o.packageRefsMs),semanticRefsMs:Math.round(o.semanticRefsMs),hierarchyMs:Math.round(o.hierarchyMs)}}function st(o,e,n){for(let t of e){let r=o.get(t)??[];r.push(...n),o.set(t,r)}}function at(o){let e=new Set,n=[];for(let t of o){let r=`${t.symbol}|${t.file}|${t.line}|${t.callsiteLine??""}`;e.has(r)||(e.add(r),n.push(t))}return n}function je(o){return o.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,tn as b,Ge as c};
|
|
3
|
-
//# sourceMappingURL=chunk-WK46TNUM.js.map
|
package/dist/chunk-WYCTJDVR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as N,c as y,d as b,e as O,g as T,h as _,i as z}from"./chunk-CEEZJXEF.js";import{a as B}from"./chunk-OSR2GEHQ.js";import{b as U}from"./chunk-2GRUZAQF.js";import{d as J}from"./chunk-SSK6LDPC.js";import{i as d}from"./chunk-3L2ZBPEX.js";import{b as v,c as g,m as $,o as P}from"./chunk-RTQ7NEKG.js";import{c as A}from"./chunk-IW5XQG5G.js";import{a as j,e as m}from"./chunk-HGFDYOVB.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=j(),i=new Map,o=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:l}of o.hits)E+=1,l.length>0&&(k+=1,H+=l.length,i.set(e.symbolId,l));let h=K(t,o.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,l]of N(o.misses)){if(!y(e)){a&&(u+=l.length);continue}let R=d(t,e);if(!R){a&&(c+=l.length),n.push(...l);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...l);continue}let Y=$(t,e,x,C);for(let D of l){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,l]of F)i.set(e,l);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,o=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v2-callsite-line";function G(t,s){let a=y(s);if(a==="typescript")return B(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(o=>`${o}:${g(t,o,d(t,o))}`);return v(i.join("|"))})}export{ce as a,q as b};
|
|
2
|
-
//# sourceMappingURL=chunk-WYCTJDVR.js.map
|
package/dist/chunk-XRYABF57.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-NJITK2GP.js";import{a as T}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-TEBQMNVI.js";import{a as A,e as h,t as D}from"./chunk-N2ZSIIGR.js";import{x as O}from"./chunk-ODDUPDP7.js";import{a as m}from"./chunk-ZOHS7AQV.js";import{k as j}from"./chunk-FESCRNVV.js";import{d as u}from"./chunk-JWTGMPIT.js";import{Aa as S,Ba as w,Ca as _,c as l}from"./chunk-N5B2NILC.js";import{existsSync as b,readdirSync as M}from"fs";import{join as d}from"path";var it={files:new Set,pathPrefixes:[]},at={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,ot=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],ct=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ut=4,ft=u("package-surface",{clearGroups:["whole-project"]}),lt=u("package-operational-surface",{clearGroups:["whole-project"]});function $(t){return ft.get(t,()=>pt(t.config.projectRoot))}function x(t,e){let n=$(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function I(t,e){return $(t).files.has(e)}function gt(t){return lt.get(t,()=>dt(t.config.projectRoot))}function ce(t,e){return gt(t).reasonsByFile.get(e)??[]}function pt(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of St(r))U(t,s,i,e,n);return e.size===0&&n.length===0?it:{files:e,pathPrefixes:n}}function dt(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=mt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of ht(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?at:{reasonsByFile:e}}function L(t){let e=[],n=X(t,"");return n&&e.push({manifest:n,packageRoot:""}),V(t,"",e,0),e}function V(t,e,n,r){if(r>=ut)return;let s=d(t,e);if(b(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||ct.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=X(t,a);o&&n.push({manifest:o,packageRoot:a}),V(t,a,n,r+1)}}function X(t,e){let n;try{n=S(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!w(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function St(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function mt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function ht(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;U(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function U(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(ot,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of C)bt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function bt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||b(d(t,s)))return;let i=C.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);yt(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function yt(t,e,n,r,s){let i=f(n,`${r}/index${s}`);b(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!b(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as Pt}from"fs";import{dirname as xt,join as k}from"path";var Et={rootFiles:new Set,sourcePrefixes:[]},kt=new Set([".git",".scipquery","node_modules","target"]),Rt=6,Tt=u("rust-library-surface",{clearGroups:["whole-project"]});function W(t,e,n){if(!n.endsWith(".rs")||!jt(wt(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Ot(j(t,n)[r.startLine]??""):!1}function wt(t){return Tt.get(t,()=>_t(t.config.projectRoot))}function _t(t){let e=new Set,n=new Set;for(let r of Nt(t)){let s=S(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=At(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!Dt(s)&&_(t,a)?a:null;if(!o)continue;e.add(o);let c=xt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?Et:{rootFiles:e,sourcePrefixes:[...n].sort()}}function jt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:vt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Ot(t){return/^\s*pub\s+(?!\()/.test(t)}function Nt(t){if(!E(t))return[];let e=[];return H(t,"",e,0),e}function H(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let i of Pt(s,{withFileTypes:!0})){if(!i.isDirectory()||kt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;H(t,a,n,r+1)}}function At(t){let e=!1;for(let n of t.split(`
|
|
2
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Dt(t){let e=!1;for(let n of t.split(`
|
|
3
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function vt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Ft(t){return p(t)==="barrel"}function q(t){return Mt.get(t,()=>{let n=m(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=N(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Mt=u("live-barrels",{clearGroups:["whole-project"]});function Ct(t,e){return q(t).has(l(e))}function Ne(t){let e=q(t);return m(t,{includeIgnored:!1}).filter(n=>Ft(n)&&!e.has(n)&&!$t(t,n))}function $t(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
-
FROM defn_enclosing_ranges der
|
|
5
|
-
JOIN documents d ON d.id = der.document_id
|
|
6
|
-
WHERE d.relative_path = ?
|
|
7
|
-
AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function Ae(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||ee(n)||Ct(t,n)}function It(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Xt(t,e,r)&&s.push("transitive-package-surface"),W(t,e,r)&&s.push("rust-public-library"),te(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>re(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return T(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function De(t,e,n){return It(t,e,n).length>0}var Lt=u("package-surface-reachability",{clearGroups:["whole-project"]}),Vt=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Xt(t,e,n){let r=Bt(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function ve(t,e,n){let r=Ut(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function Bt(t){return Lt.get(t,()=>Y(t,e=>x(t,e)))}function Ut(t){return Vt.get(t,()=>Y(t,e=>I(t,e)))}function Y(t,e){let n=new Map,r=[];for(let s of m(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of O(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Gt(i,a);o!==void 0&&Wt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Gt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Wt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Z=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Ht=new Set(["default","generateMetadata","generateStaticParams"]),Kt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),qt=new Set(["default","middleware","config"]),Yt=new Set(["register","onRequestError"]),Zt=new Set(["onRouterTransitionStart"]),Jt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Qt=new Set(["load","actions","entries",...Z]),zt=new Set(["default"]);function te(t,e){let n=h(t);return n===""?!1:J(e)?Z.has(n):Q(e)?Ht.has(n):z(e)?Kt.has(n):tt(e)?qt.has(n):et(e)?Yt.has(n):nt(e)?Zt.has(n):rt(e)?Jt.has(n):st(e)?Qt.has(n):ne(e)?zt.has(n):!1}function ee(t){return J(t)||Q(t)||z(t)||tt(t)||et(t)||nt(t)||rt(t)||st(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function z(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return R(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function et(t){return R(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function nt(t){return R(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function R(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function rt(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ne(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function re(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(K(r)+"/")&&t.includes(K(s)+".")}function K(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ce as b,Ft as c,Ct as d,Ne as e,Ae as f,It as g,De as h,ve as i,ee as j};
|
|
8
|
-
//# sourceMappingURL=chunk-XRYABF57.js.map
|
package/dist/chunk-YPWHBBIS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-7KCZELVM.js";import{a as h,b as u}from"./chunk-MV3CDXPI.js";import{a as t}from"./chunk-WYCTJDVR.js";import{a as m}from"./chunk-HOENASQM.js";import{c,g as d}from"./chunk-DRENNWRG.js";function C(a,v,y={}){let l=m(a,v);if(!l)return null;let o=y.semantic!==!1,b=u(a,l,{semantic:o,semanticEvidence:t}).filter(e=>d(e.symbol)).slice(0,50),g=p(h(a,l,{limit:50,additive:!0,callableOnly:!0,semantic:o,semanticEvidence:t})),s=b.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source!=="caller-map-inversion"?"reference-candidate":e.callEvidence==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="caller-map-inversion"&&e.callEvidence!=="scip-chunk"?"exact":"candidate",evidenceSource:e.callEvidence??e.source})),r=g.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source}));return{symbol:l.symbol,shortName:c(l.symbol),callers:s.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callees:r.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callerEvidence:s,calleeEvidence:r,coverage:{scope:"indexed-static-call-graph",blindSpots:["unresolved dynamic dispatch and reflection","external or unindexed callees without a resolved symbol identity","SCIP chunk co-occurrence is retained only as candidate call evidence"]}}}export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-YPWHBBIS.js.map
|
package/dist/chunk-YSH6U3L4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as He}from"./chunk-DIRJWYBM.js";import{b as Pe,c as ge}from"./chunk-TPFHAQ2G.js";import{c as je}from"./chunk-OR2E3AGZ.js";import{d as Te}from"./chunk-6VVV4WRR.js";import{i as We}from"./chunk-VUPHCS7Y.js";import{e as E}from"./chunk-BOJ5SVE2.js";import{c as Ue}from"./chunk-CJZXN4NU.js";import{d as Ke,e as Be,f as ze}from"./chunk-DYGHBZ2N.js";import{a as x,b as U}from"./chunk-NJITK2GP.js";import{A as qe,d as te,i as oe,t as be}from"./chunk-N2ZSIIGR.js";import{A as Xe,n as Q}from"./chunk-ODDUPDP7.js";import{J as $e}from"./chunk-ZOHS7AQV.js";import{j as Re,k as we}from"./chunk-FESCRNVV.js";import{d as Ge}from"./chunk-N5B2NILC.js";var Ye=4,bn=3,gn=12,Sn=48,vn=64,J=10,V=6,An=24,Mn=320,Ie=6,Dn=12,Ln=1,Cn=4,Rn=7,wn=12,_e="source-construct:",Tn=96,Pn=32,Qe=4,In=32,xn=8,Ve=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function Bt(n,e,i={}){let a=En(e),r=bt(e);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=i.limit??Ye,t=i.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let s=new Ue(n),m=s.scopedDefinitions(i.scope).filter(g=>!oe(g.symbol)),l=[...m],c=new Map(l.map(g=>[g.symbol,g])),d=new Map;for(let g of m)Ze(d,g,a);let u=je(n,{scope:i.scope});for(let g of u.files){let fe=be(n,g.relativePath).filter(O=>!oe(O.symbol));if(fe.length===0)continue;let ne=Re(g.text);for(let O=0;O<ne.length;O+=1){let pe=T(ne[O]??""),ae=a.filter(N=>pe.has(N));if(ae.length===0)continue;let L=qe(fe,O);if(!(!L||oe(L.symbol)))for(let N of ae)le(d,L,N,"source",g.relativePath,O)}}let h=Je(d),y=[...d.values()].map(g=>Se(g,h,r)).sort(R),b=kn(u.files,y,a),v=-1;for(let g of b){let z=be(n,g.relativePath),fe=z.filter(L=>!oe(L.symbol)),ne=Q(n,g.relativePath)?.callables??[],O=new Map,pe=L=>{let N=`${L.startLine}\0${L.endLine}\0${L.name}`,Y=O.get(N);if(Y)return Y;let G=Fn(g.relativePath,z,L,()=>v--);return G?(O.set(N,G),l.push(G),c.set(G.symbol,G),Ze(d,G,a),G):null};for(let L of ne){let N=T(L.name);a.some(Y=>N.has(Y))&&pe(L)}if(ne.length===0)continue;let ae=Re(g.text);for(let L=0;L<ae.length;L+=1){let N=T(ae[L]??""),Y=a.filter(Ce=>N.has(Ce));if(Y.length===0)continue;let G=$e(ne,L),ce=G?pe(G):null;if(!ce)continue;let Ne=en(fe,L);if(en(Ne?[Ne,ce]:[ce],L)?.symbol===ce.symbol)for(let Ce of Y)le(d,ce,Ce,"source",g.relativePath,L)}}let S=Je(d),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of d.values()){let z=M.get(g.definition.relativePath);z&&(g.sourceCharacters=z.slice(g.definition.startLine,g.definition.endLine+1).join(`
|
|
2
|
-
`).length)}let f=[...d.values()].map(g=>Se(g,S,r)).sort(R),C=Math.min(f.length,Math.max(gn,o*bn)),A=t?f:re([...f.slice(0,C),...[...f].sort(Ee).slice(0,Math.max(Sn,C)),...mt(f,a),...dt(f,a,S)]),P=A.length,I=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=_n(l),F=On(n,s,A,I,c,H,new Set(d.keys()),i.semantic!==!1),B=$n(F,A,d,S,c),k=Xn(B,S,a),q=et(n,s,F,d,S,l,c,i.semantic!==!1),D=[...Kn(n,s,B,c,S,i.semantic!==!1),...k,...B,...q].map(g=>({...g,queryPathMatches:ht(g)})).sort((g,z)=>Z(g,z,S)),_=t?D:yt(D,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-P),ye=Math.max(0,D.length-_.length)+ee,pn=t?f.length:Math.min(f.length,o+Ye);return{query:e,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:_,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:P,omittedRootCount:ee,omittedGroupCount:ye,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:ye===0?null:`scip-query anchors ${De(e)}${i.scope?` --scope ${De(i.scope)}`:""} --limit ${pn}`}}function En(n){let e=Le(n).filter(i=>!Ve.has(i.toLocaleLowerCase())).map(Oe).filter(i=>i.length>=3&&!Ve.has(i));return[...new Set(e)]}function Ze(n,e,i){let a=T(e.leaf),r=T(e.relativePath),o=T(e.documentation??"");for(let s of i)a.has(s)&&le(n,e,s,"symbol"),r.has(s)&&le(n,e,s,"path"),o.has(s)&&le(n,e,s,"documentation");let t=n.get(e.symbol);t&&(t.symbolPhraseLength=St(e.leaf,i))}function le(n,e,i,a,r,o){let t=n.get(e.symbol)??{definition:e,matches:new Map,symbolPhraseLength:0},s=t.matches.get(i)??{sources:new Set,locations:new Map};s.sources.add(a),r!==void 0&&o!==void 0&&s.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(i,s),n.set(e.symbol,t)}function Je(n){let e=new Map;for(let i of n.values())for(let a of i.matches.keys())e.set(a,(e.get(a)??0)+1);return e}function Fn(n,e,i,a){let r=e[0]?.documentId;if(r===void 0||e.find(s=>s.isFunctionLike&&s.leaf===i.name&&s.startLine===i.startLine&&s.endLine===i.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${_e}${n}:${i.startLine}:${i.endLine}:${i.name}`,relativePath:n,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:i.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function kn(n,e,i){let a=new Set(e.slice(0,Tn).map(t=>t.file)),r=new Set(i),o=n.map(t=>{let s=T(t.relativePath),m=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(m),c=[...s].filter(u=>r.has(u)).length,d=[...l].filter(u=>r.has(u)).length;return{file:t,score:d*4+c}}).filter(t=>t.score>0).sort((t,s)=>s.score-t.score||x(U(t.file.relativePath))-x(U(s.file.relativePath))||t.file.relativePath.localeCompare(s.file.relativePath)).slice(0,Pn);for(let t of o)a.add(t.file.relativePath);return n.filter(t=>a.has(t.relativePath))}function _n(n){let e=new Map;for(let i of n){if(!$(i))continue;let a=`${i.relativePath}\0${E(i.leaf)}`,r=e.get(a)??[];r.push(i),e.set(a,r)}return e}function en(n,e){return n.filter(i=>i.startLine<=e&&i.endLine>=e).sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine)||Number($(a))-Number($(i))||i.startLine-a.startLine||i.symbol.localeCompare(a.symbol))[0]}function $(n){return n.symbol.startsWith(_e)}function W(n){return $(n)?n.leaf:te(n.symbol)}function Se(n,e,i=[]){let a=n.definition,r=[...n.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(vt),locations:[...c.locations.values()].sort(fn).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),s=r.reduce((l,c)=>l+1/Math.max(1,e.get(c.term)??1),0),m=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,e.get(c.term)??1),0);return{symbol:a.symbol,label:W(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:U(a.relativePath),matches:r,focusLocations:Dt(n,e),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:n.symbolPhraseLength,identityMatchedTerms:o,rarity:s,symbolRarity:m,queryPathMatches:gt(a.relativePath,i),...n.sourceCharacters===void 0?{}:{sourceCharacters:n.sourceCharacters}}}function On(n,e,i,a,r,o,t,s){let m=a.filter(b=>!$(b)),l=e.calleeMap(m,{additive:!1,semantic:s}),c=new Map,d=new Map;for(let b of i){let v=r.get(b.symbol),S=v?$(v)?nn(n,v,r,o,1):ve(n,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!$(v)||$(f))&&d.set(f.symbol,f)}}let u=[...d.values()],h=e.calleeMap(u.filter(b=>!$(b)),{additive:!1,semantic:s}),y=new Map;for(let b of u)y.set(b.symbol,$(b)?nn(n,b,r,o,2):ve(n,b,h.get(b.symbolId)??[],r,2,t));return i.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=K([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function ve(n,e,i,a,r,o=new Set){let t=new Map;for(let s of i){let m=a.get(s.symbol);if(!m?.isFunctionLike||m.symbol===e.symbol||s.source==="ast-callsite"&&!Gn(n,e,m,s.callsiteLine))continue;let l=t.get(m.symbol);(!l||pt(s,l)<0)&&t.set(m.symbol,s)}return[...t.entries()].map(([s,m])=>{let l=a.get(s);return{kind:"call",fromSymbol:e.symbol,fromLabel:te(e.symbol),fromFile:e.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:ke(m.source),evidence:m.source,callsiteLine:m.callsiteLine??Nn(n,e,l)}}).sort((s,m)=>Number(o.has(m.toSymbol))-Number(o.has(s.toSymbol))||X(s,m)).slice(0,vn)}function nn(n,e,i,a,r){let o=ge(n,e.relativePath,e.startLine,e.endLine).targets.flatMap(t=>{let s=i.get(t.definition.symbol)??t.definition;return!s.isFunctionLike||s.symbol===e.symbol?[]:[{kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:s.symbol,toLabel:W(s),toFile:s.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of Pe(n,e.relativePath,{ranges:[{startLine:e.startLine,endLine:e.endLine}],excludeIndexedTargets:!1}).targets){let s=[...a.get(`${t.targetFile}\0${E(t.calleeLeaf)}`)??[],...be(n,t.targetFile).filter(m=>m.isFunctionLike&&E(m.leaf)===t.calleeLeaf)].find(m=>m.startLine===t.targetStartLine&&m.endLine===t.targetEndLine);!s||s.symbol===e.symbol||o.push({kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:s.symbol,toLabel:W(s),toFile:s.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(n,e.relativePath)?.callSites??[]){if(t.line<e.startLine||t.line>e.endLine||t.memberAccess)continue;let s=(a.get(`${e.relativePath}\0${E(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==e.symbol);if(s.length!==1)continue;let m=s[0];o.push({kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:m.symbol,toLabel:W(m),toFile:m.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return K(o).sort(X)}function Nn(n,e,i){let a=E(i.leaf);return Q(n,e.relativePath)?.callSites.find(r=>r.line>=e.startLine&&r.line<=e.endLine&&E(r.calleeLeaf)===a)?.line??null}function Gn(n,e,i,a){if(a===void 0)return!1;let r=E(i.leaf);return Q(n,e.relativePath)?.callSites.some(o=>{if(o.line!==a)return!1;if(E(o.calleeLeaf)===r)return!0;let t=Xe(n,e.relativePath,o.calleeLeaf);return t!==null&&E(t.importedName)===r&&Ge(t.sourcePath,i.relativePath)})??!1}function $n(n,e,i,a,r){let o=new Map(e.map((c,d)=>[c.symbol,d])),t=e.map((c,d)=>d),s=c=>{let d=c;for(;t[d]!==d;)d=t[d];for(;t[c]!==c;){let u=t[c];t[c]=d,c=u}return d},m=(c,d)=>{let u=s(c),h=s(d);u!==h&&(t[h]=u)};for(let c of n){let d=o.get(c.root.symbol);if(d!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&m(d,h)}}let l=new Map;for(let c=0;c<e.length;c+=1){let d=s(c),u=l.get(d)??[];u.push(e[c]),l.set(d,u)}return[...l.values()].map((c,d)=>{let u=new Set(c.map(f=>f.symbol)),h=K(n.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=i.get(f);if(C)y.has(f)||y.set(f,Se(C,a));else{let A=r.get(f);A&&y.set(f,hn(A))}}let b=at(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=it(h,b,u,y);return{id:`anchor-set:${d+1}:${de(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:he(b,h,S)}})}function Xn(n,e,i){let a=new Map(i.map((o,t)=>[o,t])),r=[];for(let o=0;o<n.length;o+=1){let t=n[o],s=tn(t);if(s.size!==0)for(let m=o+1;m<n.length;m+=1){let l=n[m],c=tn(l),d=[...s].filter(A=>c.has(A));if(d.length===0||![...s].some(A=>!c.has(A))||![...c].some(A=>!s.has(A)))continue;let u=qn(t,l);if(u.length<2)continue;let h=K([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=d.sort((A,P)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(P)??Number.MAX_SAFE_INTEGER)||A.localeCompare(P)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>e.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${de(t.roots[0])}:${de(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:he(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,e)).slice(0,wn).map(o=>o.group)}function tn(n){return new Set(n.roots.flatMap(e=>e.matches.filter(i=>i.sources.includes("path")).map(i=>i.term)))}function qn(n,e){return re([on(n),on(e)].filter(i=>i!==void 0))}function on(n){let e=new Set(n.keyAnchors.map(a=>a.symbol)),i=new Map;for(let a of n.relations)!e.has(a.fromSymbol)||!e.has(a.toSymbol)||i.set(a.fromSymbol,(i.get(a.fromSymbol)??0)+1);return[...n.keyAnchors].sort((a,r)=>+((i.get(r.symbol)??0)>0)-+((i.get(a.symbol)??0)>0)||rn(r)-rn(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(i.get(r.symbol)??0)-(i.get(a.symbol)??0)||R(a,r))[0]}function rn(n){return n.matchedTerms.length+n.identityMatchedTerms.length*2+(n.queryPathMatches?.length??0)*4}function Kn(n,e,i,a,r,o){let t=We(n);if(!t||t.links.length===0||i.length<2)return[];let s=new Map(t.observations.map(h=>[h.id,h])),m=new Map,l=new Map,c=[...i].sort((h,y)=>Z(h,y,r)).slice(0,Dn),d=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of d){let b=s.get(y.from),v=s.get(y.to);if(!b||!v||!Bn(h,b,a))continue;let S=zn(h,b,a);if(!S)continue;let M=m.get(v.id)??jn(n,e,v,a,o,Cn);if(m.set(v.id,M),M.reachedSymbols.size===0)continue;let f=i.filter(D=>D.id!==h.id&&Un(D).some(_=>M.reachedSymbols.has(_))&&xe(S,D)>=2).sort((D,_)=>xe(S,_)-xe(S,D)||Z(D,_,r)).slice(0,Ln);if(f.length===0)continue;let C=[h.id,b.id,...f.map(D=>D.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(ue)),P=Zn(me(v),A,M.relations);if(P.length===0)continue;let I=Vn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=K([I,...M.relations,...h.relations,...f.flatMap(D=>D.relations)]),F=Jn([I,...P],H,h,f),B=re([S,...f.flatMap(D=>D.roots)]).sort(R),k=re([S,...f.flatMap(D=>D.keyAnchors)]).slice(0,Rn),q=[...new Set([...S.matchedTerms,...f.flatMap(D=>D.matchedTerms)])].sort(),ie=Wn(n,e,S,a,o);B.length===0||k.length<2||l.set(C,{id:`cross-boundary-set:${de(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:B,keyAnchors:k,candidateOwnerCount:k.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:q,relations:F,relationCount:H.length,omittedRelations:Math.max(0,H.length-F.length),systemMapCommand:he(k,H,q)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Bn(n,e,i){let a=new Set(ue(n));return e.owner.symbol&&a.has(e.owner.symbol)?!0:[...a].map(r=>i.get(r)).some(r=>r?.relativePath===e.source.file&&r.startLine<=e.source.startLine&&r.endLine>=e.source.endLine)}function zn(n,e,i){let a=re([...n.roots,...n.keyAnchors]);if(e.owner.symbol){let r=a.find(o=>o.symbol===e.owner.symbol);if(r)return r}return a.find(r=>{let o=i.get(r.symbol);return o?.relativePath===e.source.file&&o.startLine<=e.source.startLine&&o.endLine>=e.source.endLine})??null}function ue(n){return[...new Set([...n.roots.map(e=>e.symbol),...n.keyAnchors.map(e=>e.symbol),...n.relations.flatMap(e=>[e.fromSymbol,e.toSymbol])])]}function Un(n){return[...new Set([...n.roots,...n.keyAnchors].map(e=>e.symbol))]}function xe(n,e){let i=T(n.leaf),a=[...e.roots,...e.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let s of i)o.has(s)&&(t+=1);r=Math.max(r,t)}return r}function Wn(n,e,i,a,r){let o=a.get(i.symbol);if(!o?.isFunctionLike)return[];let t=e.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let s=T(i.leaf);return[...t].filter(m=>m!==i.file&&U(m)!=="test").flatMap(m=>{let l=Q(n,m);return(l?.callSites??[]).filter(c=>E(c.calleeLeaf)===E(i.leaf)).flatMap(c=>{let d=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!d)return[];let u=[...T(d.name)].filter(h=>s.has(h)).length;return u>=2?[{name:d.name,file:m,line:d.startLine,endLine:d.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((m,l)=>l.overlap-m.overlap||m.file.localeCompare(l.file)||m.line-l.line).slice(0,1).map(({name:m,file:l,line:c,endLine:d,callsiteLine:u})=>({name:m,file:l,line:c,endLine:d,callsiteLine:u}))}function jn(n,e,i,a,r,o){let t=Hn(n,i,a),s=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:me(i),fromLabel:Ae(i),fromFile:i.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),m=Yn(n,i);s.push(...m.relations);let l=un([...t.map(u=>u.definition),...m.definitions]),c=l,d=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=e.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=ve(n,b,h.get(b.symbolId)??[],a,u);s.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!d.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)d.add(b.symbol)}return{entryDefinitions:l,relations:K(s),reachedSymbols:new Set([...l.map(u=>u.symbol),...s.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Hn(n,e,i){let a=e.owner.symbol?i.get(e.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:e.source.startLine}];let r=we(n,e.source.file),o=Te(n,e.source.file,0,Math.max(0,r.length-1),[e.source.startLine]),t=ge(n,e.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),s=Q(n,e.source.file),m=ze(n),l=(s?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let d=Ke(e.source.file,m.get(c.calleeLeaf)??[]),u=Be(n,e.source.file,d,c.memberAccess,c.calleeQualifier),h=u?i.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Qn([...t,...l])}function Yn(n,e){let i=we(n,e.source.file),a=Te(n,e.source.file,0,Math.max(0,i.length-1),[e.source.startLine]),r=Pe(n,e.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let s of r){let m=`source-construct:${s.targetFile}:${s.targetStartLine}:${s.targetEndLine}:${s.calleeLeaf}`;t.push({kind:"call",fromSymbol:me(e),fromLabel:Ae(e),fromFile:e.source.file,toSymbol:m,toLabel:s.calleeLeaf,toFile:s.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:s.line});let l=ge(n,s.targetFile,s.targetStartLine,s.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:m,fromLabel:s.calleeLeaf,fromFile:s.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:un(o),relations:K(t)}}function Qn(n){return[...new Map(n.map(e=>[e.definition.symbol,e])).values()]}function un(n){return[...new Map(n.map(e=>[e.symbol,e])).values()]}function me(n){return n.owner.symbol??n.id}function Ae(n){return n.owner.name??`${n.source.file}:${n.source.startLine+1}`}function Vn(n,e,i,a,r){return{kind:"runtime-boundary",fromSymbol:me(n),fromLabel:Ae(n),fromFile:n.source.file,toSymbol:me(e),toLabel:Ae(e),toFile:e.source.file,depth:1,strength:r,evidence:`runtime-boundary:${i}`,callsiteLine:n.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Zn(n,e,i){let a=new Map;for(let t of i){let s=a.get(t.fromSymbol)??[];s.push(t),a.set(t.fromSymbol,s)}let r=[{symbol:n,path:[]}],o=new Set([n]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&e.has(t.symbol))return t.path;for(let s of(a.get(t.symbol)??[]).sort(X))o.has(s.toSymbol)||(o.add(s.toSymbol),r.push({symbol:s.toSymbol,path:[...t.path,s]}))}return[]}function Jn(n,e,i,a){let r=K(n),o=new Set([i,...a].flatMap(t=>[...ue(t),...t.keyAnchors.map(s=>s.symbol)]));for(let t of e){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(s=>s.fromSymbol===t.fromSymbol&&s.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function et(n,e,i,a,r,o,t,s){let m=i.filter(c=>!c.root.symbol.startsWith(_e)).map(c=>({root:c.root,relations:c.relations.filter(d=>d.depth===1&&d.fromSymbol===c.root.symbol)}));return nt(m).flatMap((c,d)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,ye])=>ye-w||tt(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,An);if(y.length===0)return[];let b=e.callerFileMap(y,{semantic:s,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(ot).slice(0,Mn),M=e.calleeMap(S,{additive:!1,semantic:s}),f=new Set(y.map(p=>p.symbol)),C=K(S.flatMap(p=>ve(n,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let P=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),I=C.filter(p=>P.has(p.fromSymbol));if(P.size<2||I.length===0)return[];let F=[...new Set(I.map(p=>p.toSymbol))].map(p=>Me(p,a,r,t)).filter(p=>p!==null).sort(R),B=[...P].map(p=>Me(p,a,r,t)).filter(p=>p!==null),k=rt(B,I),q=k.slice(0,Ie),ie=k.slice(Ie);if(F.length===0||q.length===0)return[];let D=[...new Set([...F.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),_=st(I,q);return[{id:`effect-owner-set:${d+1}:${de(F[0])}`,kind:"shared-callee-owners",roots:F,keyAnchors:q,candidateOwnerCount:k.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Lt(ie,Ie),upstreamEntries:[],matchedTerms:D,relations:_,relationCount:I.length,omittedRelations:Math.max(0,I.length-_.length),systemMapCommand:he(q,I,D)}]})}function nt(n){let e=n.map((t,s)=>s),i=t=>{for(;e[t]!==t;)e[t]=e[e[t]],t=e[t];return t},a=(t,s)=>{let m=i(t),l=i(s);m!==l&&(e[l]=m)},r=n.map(t=>new Set(t.relations.map(s=>s.toSymbol)));for(let t=0;t<n.length;t+=1)for(let s=t+1;s<n.length;s+=1){let m=0;for(let l of r[t]??[])if((r[s]??new Set).has(l)&&(m+=1),m>=2)break;m>=2&&a(t,s)}let o=new Map;for(let t=0;t<n.length;t+=1){let s=i(t),m=o.get(s)??[];m.push(n[t]),o.set(s,m)}return[...o.values()].filter(t=>t.length>=2)}function tt(n,e,i,a,r){let o=Me(n,i,a,r),t=Me(e,i,a,r);return o?t?R(o,t):-1:t?1:n.localeCompare(e)}function ot(n,e){return x(U(n.relativePath))-x(U(e.relativePath))||n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine}function Me(n,e,i,a){let r=e.get(n);if(r)return Se(r,i);let o=a.get(n);return o?hn(o):null}function rt(n,e){let i=new Map;for(let r of e){let o=i.get(r.toSymbol)??new Set;o.add(r.fromSymbol),i.set(r.toSymbol,o)}let a=new Map;for(let r of e){let o=i.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...n].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function st(n,e){let i=new Map(e.map((t,s)=>[t.symbol,s])),a=e.map(t=>n.filter(s=>s.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let s=t[o];if(s&&r.push(s),r.length>=J)break}o+=1}return r.sort((t,s)=>i.get(t.fromSymbol)-i.get(s.fromSymbol)||X(t,s))}function it(n,e,i,a){let r=new Map(e.map((s,m)=>[s.symbol,m])),o=new Map;for(let s of n)o.set(s.fromSymbol,(o.get(s.fromSymbol)??0)+1);return[...n].sort((s,m)=>{let l=c=>{let d=0;return r.has(c.fromSymbol)&&(d+=100),i.has(c.toSymbol)&&(d+=60),d+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(d+=25),c.fromFile!==c.toFile&&(d+=15),c.strength==="exact"&&(d+=5),d};return l(m)-l(s)||X(s,m)}).slice(0,J).sort((s,m)=>(r.get(s.fromSymbol)??V)-(r.get(m.fromSymbol)??V)||s.depth-m.depth||(s.callsiteLine??Number.MAX_SAFE_INTEGER)-(m.callsiteLine??Number.MAX_SAFE_INTEGER)||X(s,m))}function hn(n){return{symbol:n.symbol,label:W(n),leaf:n.leaf,file:n.relativePath,line:n.startLine,endLine:n.endLine,kind:n.isFunctionLike?"callable":n.isTypeLike?"type":"symbol",fileKind:U(n.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function at(n,e,i){let a=[...n].sort(R),r=[],o=new Map;for(let c of e)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,s=new Set,m=c=>{if(!(!c||r.some(d=>d.symbol===c.symbol))){r.push(c);for(let d of c.matchedTerms)t.add(d);for(let d of c.symbolMatchedTerms)s.add(d)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(d=>!r.some(u=>u.symbol===d.symbol)).sort((d,u)=>u.symbolMatchedTerms.filter(h=>!s.has(h)).length-d.symbolMatchedTerms.filter(h=>!s.has(h)).length||u.symbolPhraseLength-d.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(d.symbol)??0)||Ee(d,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(d=>s.has(d)))break;m(c)}if(m(a[0]),r.length>=2){let c=ct(r[0].symbol,r[1].symbol,e,i);for(let d of c?.slice(1,-1)??[]){if(r.length>=V)break;m(i.get(d))}if(r.length<V){let d=new Set(r.map(y=>y.symbol)),u=new Set(e.filter(y=>y.depth===1&&d.has(y.fromSymbol)&&d.has(y.toSymbol)).map(y=>y.fromSymbol)),h=e.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!d.has(y.toSymbol)).map(y=>({relation:y,candidate:i.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||Ee(y.candidate,b.candidate))[0]?.candidate;m(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(d=>!r.some(u=>u.symbol===d.symbol)).sort((d,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-d.matchedTerms.filter(h=>!t.has(h)).length||R(d,u))[0];if(!c||c.matchedTerms.every(d=>t.has(d)))break;m(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),d=[...i.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&e.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!d)break;m(d)}if(r.length<2){let c=r[0],d=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:lt(u.symbol,c.symbol,e)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;m(d)}return r}function ct(n,e,i,a){let r=new Map;for(let s of i){let m=r.get(s.fromSymbol)??new Set;m.add(s.toSymbol),r.set(s.fromSymbol,m);let l=r.get(s.toSymbol)??new Set;l.add(s.fromSymbol),r.set(s.toSymbol,l)}let o=[{path:[n],cost:0}],t=new Map([[n,0]]);for(;o.length>0;){o.sort((c,d)=>c.cost-d.cost||c.path.length-d.path.length);let{path:s,cost:m}=o.shift(),l=s.at(-1);if(l===e)return s;for(let c of r.get(l)??[]){let d=a.get(c),u=c===e?1:!d||d.matchedTerms.length===0?9:d.symbolPhraseLength>=2?1:d.identityMatchedTerms.length>=2?2:4,h=m+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...s,c],cost:h}))}}return null}function lt(n,e,i){let a=new Map;for(let t of i){let s=a.get(t.fromSymbol)??[];s.push(t.toSymbol),a.set(t.fromSymbol,s)}let r=[[n]],o=new Set([n]);for(;r.length>0;){let t=r.shift(),s=t.at(-1);if(s===e)return t;for(let m of a.get(s)??[])o.has(m)||(o.add(m),r.push([...t,m]))}return null}function R(n,e){return(e.queryPathMatches?.length??0)-(n.queryPathMatches?.length??0)||e.identityMatchedTerms.length-n.identityMatchedTerms.length||e.matchedTerms.length-n.matchedTerms.length||e.rarity-n.rarity||se(n.kind)-se(e.kind)||x(n.fileKind)-x(e.fileKind)||n.file.localeCompare(e.file)||n.line-e.line}function Ee(n,e){return e.symbolPhraseLength-n.symbolPhraseLength||e.symbolMatchedTerms.length-n.symbolMatchedTerms.length||se(n.kind)-se(e.kind)||e.symbolRarity-n.symbolRarity||R(n,e)}function mt(n,e){return e.flatMap(i=>{let a=n.filter(t=>t.matchedTerms.includes(i)).sort((t,s)=>ut(t,s,i)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=Qe))return r;for(let t of a)if(!r.some(s=>s.symbol===t.symbol)&&(r.push(t),r.length>=Qe))break;return r})}function dt(n,e,i){let a=new Set(e),r=new Map;for(let o of n){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(m=>a.has(m)))continue;let s=r.get(o.file)??[];s.push(o),r.set(o.file,s)}return[...r.entries()].map(([o,t])=>{let s=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),m=[...T(s)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...m.map(l=>i.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>x(o.fileCandidates[0].fileKind)-x(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,xn)).slice(0,In)}function ut(n,e,i){return sn(n,i)-sn(e,i)||x(n.fileKind)-x(e.fileKind)||e.symbolPhraseLength-n.symbolPhraseLength||se(n.kind)-se(e.kind)||R(n,e)}function sn(n,e){let i=n.matches.find(a=>a.term===e)?.sources??[];return Math.min(...i.map(Fe),Number.MAX_SAFE_INTEGER)}function re(n){return[...new Map(n.map(e=>[e.symbol,e])).values()]}function Z(n,e,i){let a=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms));return(e.queryPathMatches?.length??0)-(n.queryPathMatches?.length??0)||mn(n.kind)-mn(e.kind)||cn(n)-cn(e)||ln(n)-ln(e)||(n.kind==="parallel-paths"&&e.kind==="parallel-paths"?(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(e.parallelOrchestrationSides??0)-(n.parallelOrchestrationSides??0)||(e.parallelSharedPathTerms?.length??0)-(n.parallelSharedPathTerms?.length??0):0)||an(e,i)-an(n,i)||e.matchedTerms.length-n.matchedTerms.length||Math.max(...e.roots.map(o=>o.symbolPhraseLength))-Math.max(...n.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(n.roots[0],e.roots[0])||e.roots.length-n.roots.length||n.relationCount-e.relationCount||n.id.localeCompare(e.id)}function an(n,e){return n.matchedTerms.reduce((i,a)=>i+1/Math.max(1,e.get(a)??1),0)}function ht(n){return[...new Set(n.roots.flatMap(e=>e.queryPathMatches??[]))].sort()}function cn(n){let e=n.keyAnchors.length>0?n.keyAnchors:n.roots;return Math.max(...e.map(i=>x(i.fileKind)))}function ln(n){return n.kind==="parallel-paths"?2-(n.parallelConnectedSides??0):n.kind!=="connected-flow"||n.relationCount>0?0:1}function yt(n,e,i){let a=n.slice(0,e);if(e<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=n.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(ue(o)),s=r.map(l=>({group:l,overlap:ft(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:d,overlap:u})=>u-c||Z(l,d,i))[0]?.group;if(!s)continue;let m=a.length-1;for(;m>=0&&a[m]===o;)m-=1;return m<0?a:(a[m]=s,[...a].sort((l,c)=>Z(l,c,i)))}return a}function ft(n,e){return ue(n).filter(i=>e.has(i)).length}function mn(n){switch(n){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(n,e){return n.depth-e.depth||j(e.strength)-j(n.strength)||n.fromLabel.localeCompare(e.fromLabel)||n.toLabel.localeCompare(e.toLabel)||(n.callsiteLine??Number.MAX_SAFE_INTEGER)-(e.callsiteLine??Number.MAX_SAFE_INTEGER)}function pt(n,e){return j(ke(e.source))-j(ke(n.source))||(n.callsiteLine??Number.MAX_SAFE_INTEGER)-(e.callsiteLine??Number.MAX_SAFE_INTEGER)||n.symbol.localeCompare(e.symbol)}function K(n){let e=new Map;for(let i of n){let a=`${i.fromSymbol}\0${i.toSymbol}`,r=e.get(a);(!r||X(i,r)<0)&&e.set(a,i)}return[...e.values()]}function Le(n){return n.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function bt(n){let e=n.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(e.map(i=>i.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function gt(n,e){let i=n.replace(/\\/gu,"/").toLocaleLowerCase();return e.filter(a=>{let r=i.indexOf(a);if(r<0)return!1;let o=r===0?"/":i[r-1],t=i[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function St(n,e){let i=Le(n).map(Oe),a=0;for(let r=0;r<i.length;r+=1)for(let o=0;o<e.length;o+=1){let t=0;for(;r+t<i.length&&o+t<e.length&&i[r+t]===e[o+t];)t+=1;a=Math.max(a,t)}return a}function T(n){return new Set(Le(n).flatMap(yn).filter(e=>e.length>=3))}function yn(n){let e=Oe(n);return e.length>4&&e.endsWith("e")?[e,e.slice(0,-1)]:[e]}function Oe(n){let e=n.toLocaleLowerCase();return e.length>5&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("ied")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("ed")?dn(e.slice(0,-2)):e.length>5&&e.endsWith("ing")?dn(e.slice(0,-3)):e.length>4&&e.endsWith("ers")||e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function dn(n){if(n.length<2)return n;let e=n.at(-1),i=n.at(-2);return e===i&&!"aeiou".includes(e)?n.slice(0,-1):n}function vt(n,e){return Fe(n)-Fe(e)}function Fe(n){switch(n){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(n){return n==="callable"?0:n==="type"?1:2}function ke(n){return n==="semantic-callee"||n==="scip-chunk"?"exact":"derived"}function j(n){return n==="exact"?2:1}function fn(n,e){return n.file.localeCompare(e.file)||n.line-e.line}function de(n){return`${n.file}:${n.line+1}`}function he(n,e=[],i=[]){let a=n.map(t=>`--symbol ${De(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(n.map(t=>t.symbol)),o=n.flatMap(t=>(t.sourceCharacters??0)>He?At(t,e,i,r).map(s=>`--focus-at ${De(`${s.file}:${s.line+1}`)}`):[]);return`scip-query system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function At(n,e,i,a){let r=new Set(i),o=e.filter(l=>l.fromSymbol===n.symbol&&l.callsiteLine!==null&&l.callsiteLine>=n.line&&l.callsiteLine<=n.endLine).map(l=>({file:n.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(Le(Mt(l.toLabel)).flatMap(yn).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),s=[...t.length>0?t:o,...t.length>0?[]:n.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],m=[];for(let l of s)if(!m.some(c=>c.file===l.file&&c.line===l.line)&&(m.push({file:l.file,line:l.line}),m.length>=3))break;return m}function Mt(n){return n.slice(Math.max(n.lastIndexOf(":"),n.lastIndexOf("."))+1)}function Dt(n,e){let i=new Map;for(let[o,t]of n.matches)for(let s of t.locations.values()){if(s.file!==n.definition.relativePath||s.line<n.definition.startLine||s.line>n.definition.endLine)continue;let m=`${s.file}\0${s.line}`,l=i.get(m)??{...s,matchedTerms:new Set};l.matchedTerms.add(o),i.set(m,l)}let a=[...i.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((s,m)=>s+1/Math.max(1,e.get(m)??1),0)-[...o.matchedTerms].reduce((s,m)=>s+1/Math.max(1,e.get(m)??1),0)||fn(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Lt(n,e){let i=[];for(let a=0;a<n.length;a+=e)i.push(he(n.slice(a,a+e)));return i}function De(n){return`'${n.replaceAll("'",`'"'"'`)}'`}export{Bt as a,En as b};
|
|
3
|
-
//# sourceMappingURL=chunk-YSH6U3L4.js.map
|
package/dist/chunk-YU5DZUZI.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as F}from"./chunk-W7CXK74K.js";import{c as E}from"./chunk-E73UNJTF.js";import{a as M,c as x}from"./chunk-OSSESPDX.js";import{A,d as S,f as R,t as N}from"./chunk-N2ZSIIGR.js";import{z as w}from"./chunk-ZOHS7AQV.js";function K(t,o,n={}){return _(t,o,n).rows}function q(t,o,n={}){return _(t,o,n)}function _(t,o,n){let{maxDepth:i=5,scope:a}=n,c=i===Number.MAX_SAFE_INTEGER,r=c?null:500,h=M(t,o);if(!h)return{rows:[],coverage:{status:"incomplete",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:0,perSymbolEvidenceLimit:r,remainingFrontierSymbols:0,reasons:["The requested symbol could not be resolved."]}};let m=[],u=new Set([h.symbolId]),s=new Set,e=[h],f=0,b=!1;for(let d=1;d<=i&&e.length!==0;d++){f=d;let p=[],C=E(t,e,{...c?{}:{limit:r+1},semanticEvidence:F});for(let v of e){let g=C.get(v.symbolId)??[];r!==null&&g.length>r&&(b=!0);let $=r===null?g:g.slice(0,r);for(let l of P(t,v,a,$)){let D=`${l.file}|${l.shortName}`;if(l.symbolId!==null){if(u.has(l.symbolId))continue;u.add(l.symbolId)}else if(s.has(D))continue;s.add(D),m.push({symbol:l.symbol,shortName:l.shortName,file:l.file,depth:d}),l.symbolId!==null&&l.symbolMatch&&p.push(l.symbolMatch)}}e=p}m.sort((d,p)=>d.depth-p.depth||d.file.localeCompare(p.file));let I=e.length>0,y=[];return I&&y.push(`${e.length} symbol(s) remain eligible beyond depth ${i}.`),b&&y.push(`At least one symbol had more than ${r} incoming evidence row(s).`),y.length===0&&y.push("The discovered reverse evidence frontier was exhausted."),{rows:m,coverage:{status:I||b?"bounded":"accounted",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:f,perSymbolEvidenceLimit:r,remainingFrontierSymbols:e.length,reasons:y}}}function P(t,o,n,i){let a=i.filter(s=>!t.isIgnored(s.file)).filter(s=>!n||s.file.includes(n)),c=new Set(a.map(s=>s.file)),r=[];for(let s of L(t,o,n)){if(c.has(s))continue;let e=N(t,s),f=e.length>0?A(e,e[0].startLine):null;r.push({symbol:f?.symbol??s,file:s})}let h=[...a,...r],m=[],u=new Set;for(let s of h){let e=x(t,s.symbol);if(!e){let b=`${s.file}|${s.symbol}`;if(u.has(b))continue;u.add(b),m.push({symbolId:null,symbol:s.symbol,shortName:S(s.symbol),file:s.file,symbolMatch:null});continue}if(e.symbolId===o.symbolId||t.isIgnored(e.relativePath)||!T(e))continue;let f=`${e.symbolId}|${e.relativePath}`;u.has(f)||(u.add(f),m.push({symbolId:e.symbolId,symbol:e.symbol,shortName:S(e.symbol),file:e.relativePath,symbolMatch:e}))}return m}function L(t,o,n){let i=n?"AND consumer_d.relative_path LIKE ?":"",a=[o.symbolId,o.documentId];return n&&a.push(`%${n}%`),new Set(t.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
AND c.document_id != ?
|
|
8
|
-
${t.pathExclusionsFor("consumer_d")}
|
|
9
|
-
${i}`,...a).map(c=>c.relative_path).filter(c=>!t.isIgnored(c)))}function T(t){if(t.symbol.startsWith("scip-clojure ")||w(t.relativePath)==="clojure")return!0;let o=R(t.symbol);return o==="method"||o==="type"||t.symbol.endsWith("().")}export{K as a,q as b};
|
|
10
|
-
//# sourceMappingURL=chunk-YU5DZUZI.js.map
|