scip-query 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +257 -0
- package/README.md +11 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-XI2CSWEY.js +2 -0
- package/dist/call-graph-UONR6JR5.js +2 -0
- package/dist/{chunk-FGNCOQUX.js → chunk-2E7CX53V.js} +2 -2
- package/dist/chunk-2GRUZAQF.js +43 -0
- package/dist/{chunk-DPWKKNKI.js → chunk-2LDBDR6J.js} +2 -2
- package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
- package/dist/{chunk-XGGBK66W.js → chunk-2R3V3PSD.js} +2 -2
- package/dist/chunk-2WC2OEDO.js +4 -0
- package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
- package/dist/{chunk-2RE5OCHZ.js → chunk-3D3QG236.js} +2 -2
- package/dist/{chunk-D2MVJSP4.js → chunk-3FHOF22C.js} +2 -2
- package/dist/{chunk-7XZGZBSQ.js → chunk-3JKSW6LJ.js} +2 -2
- package/dist/chunk-3L2ZBPEX.js +133 -0
- package/dist/{chunk-NVSZNESQ.js → chunk-3PJABJSU.js} +2 -2
- package/dist/{chunk-WOOAY3PA.js → chunk-3SVF22I5.js} +2 -2
- package/dist/{chunk-YAGYMBEX.js → chunk-3WR4E3A3.js} +2 -2
- package/dist/chunk-4FTZ4P5G.js +2 -0
- package/dist/{chunk-F24G5NBE.js → chunk-4ILJCCXV.js} +2 -2
- package/dist/chunk-4UX2F3JX.js +2 -0
- package/dist/chunk-4WNW27SX.js +2 -0
- package/dist/chunk-5ENOG4VP.js +61 -0
- package/dist/{chunk-RHHCLWQ6.js → chunk-64BFSI5I.js} +2 -2
- package/dist/chunk-66DVSJQG.js +455 -0
- package/dist/{chunk-ISWFRGJ6.js → chunk-6HFCYNYE.js} +2 -2
- package/dist/{chunk-Y2VM4CJC.js → chunk-6I6L7Z62.js} +2 -2
- package/dist/{chunk-CKRWA452.js → chunk-6PQNKL3G.js} +2 -2
- package/dist/{chunk-GPGRZJ3R.js → chunk-6V5CNXL6.js} +2 -2
- package/dist/chunk-6VVV4WRR.js +4 -0
- package/dist/{chunk-BDGTPN27.js → chunk-7BWFZPPZ.js} +2 -2
- package/dist/{chunk-25GWKRUZ.js → chunk-7CYG22FH.js} +2 -2
- package/dist/chunk-7F45LJKI.js +2 -0
- package/dist/{chunk-4TQU4TX2.js → chunk-7IWV2EG3.js} +2 -2
- package/dist/{chunk-UDY7MIAW.js → chunk-AFHTBORT.js} +2 -2
- package/dist/chunk-AVRYW5OZ.js +2 -0
- package/dist/chunk-B3PYOSCX.js +2 -0
- package/dist/{chunk-RNKPYYYE.js → chunk-B5D7QPBE.js} +2 -2
- package/dist/{chunk-FFJQZG6J.js → chunk-BBCIS4DX.js} +2 -2
- package/dist/chunk-BDUVI7TO.js +3 -0
- package/dist/{chunk-BVFYEEBH.js → chunk-BE7ZZTMC.js} +2 -2
- package/dist/{chunk-NEIQPFBI.js → chunk-BHVUJOCQ.js} +2 -2
- package/dist/chunk-BKVWUP7Y.js +2 -0
- package/dist/{chunk-IJMD6BRI.js → chunk-BQGB4HBD.js} +2 -2
- package/dist/{chunk-ERCYGVAM.js → chunk-BRV7PIFF.js} +2 -2
- package/dist/chunk-CEEZJXEF.js +2 -0
- package/dist/{chunk-BTVKZGWT.js → chunk-CIYLO6SI.js} +2 -2
- package/dist/chunk-CJZXN4NU.js +2 -0
- package/dist/{chunk-VXJJTQYE.js → chunk-CNO7TOKL.js} +2 -2
- package/dist/{chunk-ZZ3Z7D56.js → chunk-COF23M5F.js} +2 -2
- package/dist/{chunk-ZGW4HLPD.js → chunk-CWFP7GM5.js} +2 -2
- package/dist/chunk-D2DHWI3D.js +2 -0
- package/dist/{chunk-Q55NF3ZG.js → chunk-D4N5SQ2M.js} +2 -2
- package/dist/{chunk-LXQUF2RP.js → chunk-DBRSYFXR.js} +2 -2
- package/dist/{chunk-PXXYQK55.js → chunk-DHUIOLDT.js} +2 -2
- package/dist/{chunk-KZYID5KV.js → chunk-DIRJWYBM.js} +2 -2
- package/dist/{chunk-IKVNEGTW.js → chunk-DIUFNHRJ.js} +2 -2
- package/dist/{chunk-CLG6DWVS.js → chunk-DTZCKZEU.js} +2 -2
- package/dist/{chunk-Z2PZVKPR.js → chunk-DULC3QFP.js} +2 -2
- package/dist/{chunk-AYPDH2LU.js → chunk-DYGHBZ2N.js} +2 -2
- package/dist/{chunk-JJ62MTQH.js → chunk-E5R6AQ73.js} +2 -2
- package/dist/{chunk-BWVQP3LB.js → chunk-E73UNJTF.js} +2 -2
- package/dist/{chunk-GVOMSPGL.js → chunk-EG2CPZMJ.js} +2 -2
- package/dist/{chunk-56NQAEPJ.js → chunk-EKV5HX33.js} +2 -2
- package/dist/{chunk-GDRJB3SB.js → chunk-EQHFIL6T.js} +2 -2
- package/dist/{chunk-EWWY2ZFL.js → chunk-ESIQ66Z7.js} +2 -2
- package/dist/chunk-EVFUMY4R.js +3 -0
- package/dist/{chunk-ZYM4HOFA.js → chunk-F7DY272B.js} +2 -2
- package/dist/chunk-FBN2FGXG.js +2 -0
- package/dist/{chunk-AZS7YPCB.js → chunk-FDLOBR6P.js} +2 -2
- package/dist/chunk-FESCRNVV.js +5 -0
- package/dist/{chunk-URSGGIZX.js → chunk-FFRKR4EQ.js} +2 -2
- package/dist/chunk-FGA2U4OR.js +8 -0
- package/dist/{chunk-7YQOCABQ.js → chunk-FIQRSHVM.js} +2 -2
- package/dist/{chunk-KFVSJX25.js → chunk-FPYLNQPT.js} +2 -2
- package/dist/{chunk-FELGD32K.js → chunk-FRUSVINH.js} +2 -2
- package/dist/chunk-GAS2LJMP.js +3 -0
- package/dist/{chunk-OTSPRVNW.js → chunk-GSP44ENC.js} +2 -2
- package/dist/{chunk-K3XFWJI2.js → chunk-GUFSG5TX.js} +2 -2
- package/dist/chunk-GYIZ4NXB.js +2 -0
- package/dist/{chunk-2OXVP5U5.js → chunk-GZIUDL6G.js} +2 -2
- package/dist/chunk-HCXEQRFF.js +18 -0
- package/dist/{chunk-LO5JSW2C.js → chunk-HEHOQQKH.js} +2 -2
- package/dist/{chunk-U2N2KE7A.js → chunk-HKGFPJ4T.js} +2 -2
- package/dist/chunk-HLZTEXRA.js +2 -0
- package/dist/{chunk-EELPBR7E.js → chunk-HOENASQM.js} +2 -2
- package/dist/{chunk-VTCIYFEK.js → chunk-HVF5VBG6.js} +2 -2
- package/dist/{chunk-TH6IC56G.js → chunk-HYO3NP5Q.js} +2 -2
- package/dist/{chunk-OPSAW5DT.js → chunk-I55I7XXP.js} +2 -2
- package/dist/{chunk-DEAB5TGT.js → chunk-IDFEUFKS.js} +2 -2
- package/dist/{chunk-DJAO2OZJ.js → chunk-IHGQTTVW.js} +2 -2
- package/dist/{chunk-XU75YQN4.js → chunk-IICPE7B2.js} +2 -2
- package/dist/{chunk-GY7CCCEZ.js → chunk-IL676XCC.js} +2 -2
- package/dist/{chunk-4HE7MVWD.js → chunk-ILTDAWEF.js} +2 -2
- package/dist/chunk-IZDPJ2QI.js +2 -0
- package/dist/{chunk-5YRQIE2B.js → chunk-J66VOFW6.js} +2 -2
- package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
- package/dist/{chunk-QLBSG7U5.js → chunk-JGKUET5J.js} +2 -2
- package/dist/{chunk-VZ7NXSHV.js → chunk-JS4PGXMV.js} +2 -2
- package/dist/{chunk-ZAZGGSM3.js → chunk-JTQVMR42.js} +2 -2
- package/dist/chunk-JWTGMPIT.js +80 -0
- package/dist/{chunk-5ZMBRQFC.js → chunk-JYR66JN5.js} +2 -2
- package/dist/chunk-KLFEXGQA.js +2 -0
- package/dist/chunk-KYSDI3GE.js +5 -0
- package/dist/{chunk-MSR2QRUE.js → chunk-L6PJPETJ.js} +2 -2
- package/dist/{chunk-VU6LIWHT.js → chunk-LDVT66YM.js} +2 -2
- package/dist/chunk-LEECKFCJ.js +2 -0
- package/dist/{chunk-H7CG6LOE.js → chunk-LMZ5PRUV.js} +2 -2
- package/dist/{chunk-ZPASRBLF.js → chunk-LQRQN2XA.js} +2 -2
- package/dist/{chunk-HISEUIL2.js → chunk-LXABEJX3.js} +2 -2
- package/dist/{chunk-WHADK6OS.js → chunk-M2O5NY6W.js} +2 -2
- package/dist/{chunk-Y334QQU5.js → chunk-MNV5FSBW.js} +2 -2
- package/dist/{chunk-RYOYJMGF.js → chunk-MPQ4OTBM.js} +2 -2
- package/dist/{chunk-6NC3YSPY.js → chunk-MV3CDXPI.js} +2 -2
- package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
- package/dist/chunk-N2ZSIIGR.js +117 -0
- package/dist/chunk-N5B2NILC.js +5 -0
- package/dist/{chunk-Q6T2CAJL.js → chunk-NJITK2GP.js} +2 -2
- package/dist/{chunk-ENWQWA2R.js → chunk-NOGJXYFO.js} +2 -2
- package/dist/{chunk-V4NG5OMS.js → chunk-NOYBFVJA.js} +106 -106
- package/dist/chunk-NWQXSFFU.js +3 -0
- package/dist/chunk-ODDUPDP7.js +13 -0
- package/dist/{chunk-A77SCPW2.js → chunk-OLIWTZI3.js} +2 -2
- package/dist/{chunk-XFMVKFSF.js → chunk-OLNV6I6U.js} +2 -2
- package/dist/{chunk-QKT4UI2Y.js → chunk-OR2E3AGZ.js} +2 -2
- package/dist/chunk-OSR2GEHQ.js +2 -0
- package/dist/{chunk-5H5WTJSD.js → chunk-OSSESPDX.js} +2 -2
- package/dist/{chunk-KQHJEU6V.js → chunk-OWOOWNJ5.js} +2 -2
- package/dist/{chunk-GRX7JOXQ.js → chunk-P42EIXTA.js} +2 -2
- package/dist/{chunk-AQ2PORIO.js → chunk-PJFGPYTU.js} +2 -2
- package/dist/{chunk-LRI5OMPE.js → chunk-PP7KNN7L.js} +2 -2
- package/dist/{chunk-PLJUQFQN.js → chunk-PU7T5QYQ.js} +2 -2
- package/dist/{chunk-JUN5DOAK.js → chunk-PWWAJSKV.js} +2 -2
- package/dist/{chunk-7IQXARSQ.js → chunk-PZL5T7SU.js} +2 -2
- package/dist/{chunk-UAQ4T73O.js → chunk-QBE3YX64.js} +2 -2
- package/dist/{chunk-3TJY6M3B.js → chunk-QGVTFRY2.js} +2 -2
- package/dist/chunk-QOJONDS7.js +2 -0
- package/dist/chunk-QU5XRYB5.js +4 -0
- package/dist/{chunk-2KVU55CW.js → chunk-QUU5OBVK.js} +2 -2
- package/dist/{chunk-Q5TA4OY4.js → chunk-RBLQNW26.js} +2 -2
- package/dist/chunk-RTQ7NEKG.js +81 -0
- package/dist/{chunk-F24QUEQP.js → chunk-SQXRS7BG.js} +2 -2
- package/dist/chunk-SSK6LDPC.js +2 -0
- package/dist/chunk-SZHGTCPP.js +7 -0
- package/dist/chunk-T4N4P2K5.js +16 -0
- package/dist/chunk-TA3QKLLU.js +2 -0
- package/dist/chunk-TEBQMNVI.js +43 -0
- package/dist/{chunk-NK3JMP22.js → chunk-TPFHAQ2G.js} +2 -2
- package/dist/chunk-TQPCBMWT.js +5 -0
- package/dist/{chunk-HG722PO7.js → chunk-TRNAEQ6P.js} +2 -2
- package/dist/chunk-TY7CRN3Z.js +2 -0
- package/dist/{chunk-7XA3OM44.js → chunk-UHFYCMZO.js} +2 -2
- package/dist/{chunk-ARVO6TTW.js → chunk-UICY4GTQ.js} +2 -2
- package/dist/{chunk-SWK4XPUS.js → chunk-UVGEWT4Y.js} +2 -2
- package/dist/{chunk-GIQ6CSL4.js → chunk-UXW33INU.js} +2 -2
- package/dist/{chunk-RDULNRSJ.js → chunk-VMPRET3I.js} +2 -2
- package/dist/{chunk-I6UTXNHU.js → chunk-VNLGKHS6.js} +2 -2
- package/dist/{chunk-44T4DUAA.js → chunk-VQILFTEH.js} +2 -2
- package/dist/{chunk-N7FP5H5U.js → chunk-VUPHCS7Y.js} +8 -8
- package/dist/{chunk-JAT6C3VX.js → chunk-VVZSBTSU.js} +2 -2
- package/dist/{chunk-FBCVASUG.js → chunk-VZRNID6A.js} +2 -2
- package/dist/{chunk-TUQIPUDS.js → chunk-W5OXRYGE.js} +2 -2
- package/dist/chunk-W6STWDQI.js +57 -0
- package/dist/chunk-W7CXK74K.js +2 -0
- package/dist/chunk-WB3WYIRE.js +4 -0
- package/dist/{chunk-C76O5MDS.js → chunk-WDNVY4E7.js} +2 -2
- package/dist/{chunk-TAYD3AE7.js → chunk-WIWY3CRX.js} +2 -2
- package/dist/chunk-WK46TNUM.js +3 -0
- package/dist/chunk-WNTFFKAX.js +12 -0
- package/dist/{chunk-JFQBRL3J.js → chunk-WOIKCX6A.js} +2 -2
- package/dist/{chunk-PIFTZEEM.js → chunk-WUN6KBHV.js} +2 -2
- package/dist/chunk-WYCTJDVR.js +2 -0
- package/dist/chunk-WYPL7GF7.js +2 -0
- package/dist/{chunk-XN22RGSR.js → chunk-XBGWL66K.js} +2 -2
- package/dist/{chunk-R6M456QG.js → chunk-XDQMU3BT.js} +2 -2
- package/dist/{chunk-XJX6LGHL.js → chunk-XFA4SSO3.js} +2 -2
- package/dist/{chunk-2YC7YNKT.js → chunk-XGZEP6GR.js} +2 -2
- package/dist/chunk-XPDPNWTQ.js +368 -0
- package/dist/chunk-XRYABF57.js +8 -0
- package/dist/{chunk-YIHNPKWD.js → chunk-YBGKCQIS.js} +2 -2
- package/dist/{chunk-2XCGSDIT.js → chunk-YEN6CYC7.js} +2 -2
- package/dist/{chunk-VMWUV6WB.js → chunk-YF5IB2LF.js} +2 -2
- package/dist/{chunk-TNG2FYS5.js → chunk-YI2AWIHC.js} +2 -2
- package/dist/{chunk-EELG7D3Q.js → chunk-YPWBKGFU.js} +2 -2
- package/dist/{chunk-GQIDEID3.js → chunk-YPWHBBIS.js} +2 -2
- package/dist/{chunk-TKDNDQA7.js → chunk-YSH6U3L4.js} +2 -2
- package/dist/{chunk-BUTEIZKP.js → chunk-YU5DZUZI.js} +2 -2
- package/dist/chunk-YWO5DDRC.js +16 -0
- package/dist/{chunk-6HRZQLOI.js → chunk-Z4CDXYNQ.js} +2 -2
- package/dist/{chunk-XSWYJCAK.js → chunk-ZF5KHH7C.js} +2 -2
- package/dist/chunk-ZOHS7AQV.js +21 -0
- package/dist/{chunk-7U2YQSDE.js → chunk-ZTI4SBFV.js} +2 -2
- package/dist/cli-main.js +2 -2
- package/dist/code-MI6F2TTU.js +2 -0
- package/dist/code-result-json-FXALY4HE.js +2 -0
- package/dist/{command-descriptors-ORNTVNYV.js → command-descriptors-P34VABY5.js} +136 -135
- package/dist/dataflow-4KEMJPC6.js +2 -0
- package/dist/dependence-slice-R7FPWD5M.js +2 -0
- package/dist/deps-7EMQUYUT.js +2 -0
- package/dist/direct-navigation-6YO234F2.js +3 -0
- package/dist/entry-map-KOOLR26E.js +2 -0
- package/dist/files-OPIPJIGZ.js +2 -0
- package/dist/hierarchy-QPD2CAER.js +2 -0
- package/dist/imports-M6HUXRXC.js +2 -0
- package/dist/index.js +1 -1
- package/dist/members-I5MEFOCT.js +2 -0
- package/dist/methods-5JYGGHXA.js +2 -0
- package/dist/output-continuation-command-UPQAAKBP.js +3 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-UKKQ5PLS.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +9 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-server.js +3 -3
- package/dist/refs-PSU4JZZW.js +2 -0
- package/dist/refs-pagination-JG6CJMRC.js +2 -0
- package/dist/reindex-worker.js +25 -25
- package/dist/reindex.d.ts +3 -2
- package/dist/reindex.js +35 -35
- package/dist/runtime.d.ts +34 -2
- package/dist/runtime.js +4 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
- package/dist/slice-HYRATV64.js +2 -0
- package/dist/surface-VTGDYWF5.js +2 -0
- package/dist/symbol-resolution-WD5EU5JE.js +2 -0
- package/dist/system-LRQNFOR2.js +2 -0
- package/dist/trace-F4B6OLL4.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-VRPZY72V.js +2 -0
- package/dist/watch-server.js +3 -3
- package/package.json +1 -1
- package/dist/by-kind-4IYG2SKW.js +0 -2
- package/dist/call-graph-WQNXMNNN.js +0 -2
- package/dist/chunk-2BTJALUS.js +0 -454
- package/dist/chunk-3QXC54FQ.js +0 -3
- package/dist/chunk-42W3LFUK.js +0 -13
- package/dist/chunk-4GAQ6FI4.js +0 -43
- package/dist/chunk-6VEFRPTD.js +0 -5
- package/dist/chunk-7C26EKLZ.js +0 -4
- package/dist/chunk-7JYHQAH2.js +0 -22
- package/dist/chunk-7KSO2OAP.js +0 -2
- package/dist/chunk-AK3PYTIK.js +0 -5
- package/dist/chunk-AMIMMNA4.js +0 -11
- package/dist/chunk-AUY5BL74.js +0 -2
- package/dist/chunk-BDHFVH2M.js +0 -18
- package/dist/chunk-BECZLYNU.js +0 -8
- package/dist/chunk-BYDAFMSR.js +0 -57
- package/dist/chunk-BZYSGZRK.js +0 -2
- package/dist/chunk-C7IJMOFP.js +0 -134
- package/dist/chunk-CBBHFNLX.js +0 -2
- package/dist/chunk-D35XIZGN.js +0 -2
- package/dist/chunk-DKM723YF.js +0 -79
- package/dist/chunk-E44IVWIJ.js +0 -367
- package/dist/chunk-EDMB6SSO.js +0 -7
- package/dist/chunk-EETGXQY7.js +0 -3
- package/dist/chunk-FKGQOTKD.js +0 -2
- package/dist/chunk-GH5YSGZL.js +0 -5
- package/dist/chunk-HCVJR2V4.js +0 -3
- package/dist/chunk-HXOU4XNH.js +0 -3
- package/dist/chunk-IMKZEXZG.js +0 -2
- package/dist/chunk-ISIQLPJ2.js +0 -61
- package/dist/chunk-IXESDH3J.js +0 -2
- package/dist/chunk-JT6XX7QY.js +0 -8
- package/dist/chunk-MHIEP7EG.js +0 -4
- package/dist/chunk-OJNK5ALA.js +0 -2
- package/dist/chunk-OXYAWIEA.js +0 -2
- package/dist/chunk-OZETODHH.js +0 -2
- package/dist/chunk-PBUH2P5S.js +0 -3
- package/dist/chunk-PLYUVM4F.js +0 -2
- package/dist/chunk-Q7GBK5T7.js +0 -81
- package/dist/chunk-QWKHW6VZ.js +0 -2
- package/dist/chunk-RPL3ARU7.js +0 -16
- package/dist/chunk-SVHTMVA4.js +0 -4
- package/dist/chunk-T6QD2ZQB.js +0 -43
- package/dist/chunk-TD7VKJ2Y.js +0 -117
- package/dist/chunk-TUSPIVZ3.js +0 -4
- package/dist/chunk-UT7TADJX.js +0 -2
- package/dist/chunk-VUSKPCUB.js +0 -2
- package/dist/chunk-WN3TCGJ4.js +0 -2
- package/dist/chunk-WSLEJSFR.js +0 -2
- package/dist/chunk-WYZIHUPZ.js +0 -16
- package/dist/chunk-XE33FV5W.js +0 -2
- package/dist/chunk-Z2AWCTN6.js +0 -2
- package/dist/chunk-ZOXKSQQB.js +0 -2
- package/dist/code-EQJFDT6I.js +0 -2
- package/dist/code-result-json-7UWIWBOO.js +0 -2
- package/dist/dataflow-6VL54GX5.js +0 -2
- package/dist/dependence-slice-DT2NUHD2.js +0 -2
- package/dist/deps-DB7H5IKC.js +0 -2
- package/dist/direct-navigation-O3LUAYWQ.js +0 -3
- package/dist/entry-map-6K62RV3D.js +0 -2
- package/dist/files-MSLD7MO6.js +0 -2
- package/dist/hierarchy-IVBXAKFA.js +0 -2
- package/dist/imports-FRAVZ3Y2.js +0 -2
- package/dist/members-KJOJDYGO.js +0 -2
- package/dist/methods-2AYABBT3.js +0 -2
- package/dist/output-continuation-command-JHMPH6NC.js +0 -3
- package/dist/project-reindex-HYO4WD7Z.js +0 -3
- package/dist/refs-ARMA6XUJ.js +0 -2
- package/dist/refs-pagination-VUGIWN6U.js +0 -2
- package/dist/slice-YOB5YFAM.js +0 -2
- package/dist/surface-VY5EFWTW.js +0 -2
- package/dist/symbol-resolution-DGQN4XIV.js +0 -2
- package/dist/system-2KQ3QD2P.js +0 -2
- package/dist/trace-HTIPTXAE.js +0 -2
- package/dist/value-flow-5FV3VQI7.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as le}from"./chunk-ZAZGGSM3.js";import{a as de}from"./chunk-3TJY6M3B.js";import{a as pe}from"./chunk-U2N2KE7A.js";import{a as he}from"./chunk-6YTSKJJ3.js";import{a as ge}from"./chunk-UT7TADJX.js";import{a as se}from"./chunk-VTCIYFEK.js";import{a as ue}from"./chunk-H7CG6LOE.js";import{a as ce}from"./chunk-ZYM4HOFA.js";import{a as oe}from"./chunk-URSGGIZX.js";import{a as ae}from"./chunk-7XZGZBSQ.js";import{a as ne}from"./chunk-OPSAW5DT.js";import{a as me}from"./chunk-PLJUQFQN.js";import{a as ie}from"./chunk-NVSZNESQ.js";import{a as re}from"./chunk-GY7CCCEZ.js";import{a as J}from"./chunk-ZPASRBLF.js";import{b as ee}from"./chunk-OJNK5ALA.js";import{a as Z}from"./chunk-QLBSG7U5.js";import{b as te}from"./chunk-XDAUYDFT.js";import{a as M,b as U}from"./chunk-3QXC54FQ.js";import{b as Y}from"./chunk-PXXYQK55.js";import{a as K}from"./chunk-ISWFRGJ6.js";import{a as X}from"./chunk-7C26EKLZ.js";import{f as Q}from"./chunk-6VEFRPTD.js";import{a as W}from"./chunk-OTSPRVNW.js";import{f as A,h as T}from"./chunk-BECZLYNU.js";import{a as G}from"./chunk-42W3LFUK.js";import{C as O,z as j}from"./chunk-7JYHQAH2.js";import{B as k}from"./chunk-Q7GBK5T7.js";import{xa as q,ya as z}from"./chunk-GH5YSGZL.js";import{readdirSync as Ye}from"fs";import{basename as Xe,join as fe}from"path";function Qe(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(s=>!i.has(s)).sort(),a=t.allowExtra?[]:[...i].filter(s=>!n.has(s)).sort();return{missing:o,extra:a}}function Je(e,r){let t=Ze(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=ot(e.config.projectRoot,r.mustEqual),n=Qe(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function ve(e,r){return r.map(t=>Je(e,t))}function Ze(e,r,t){return t.type==="markdown-list"?nt(e,r,t.marker):et(e,r,t)}function et(e,r,t){if(!k(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=j(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=O(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?tt(o,t.identifier):it(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function be(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function tt(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type==="object")return rt(n)}return null}function rt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(ye(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function it(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(ye(a.text));return[...o].sort()}return null}function ye(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function nt(e,r,t){let i=k(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=Se(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:xe(n)}}function Se(e,r){let t=G(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function xe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function ot(e,r){switch(r.type){case"top-level-dirs":return Ce(fe(e,r.path));case"file-glob":return[...new Set(W(e,r.pattern).map(t=>Xe(t)))].sort();case"registered-commands":return at(e);case"builtin-skills":return Ce(fe(e,"skills"))}}function Ce(e){let r;try{r=Ye(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function at(e){let r;try{r=q(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!z(i))throw i;return[]}let t=Se(r,"COMMAND REFERENCE");return t?xe(t):[]}function h(e){return e.scoreCount??e.count}function B(e){let r=lt(e),{breakdown:t,pressure:i}=dt(e),n=He(t,"risk"),o=He(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:h(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:h(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:h(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:st(e),validation:ut(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}function st(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ct(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ct(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:p(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ut(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[v,g]of Object.entries(r))i.has(v)?n+=g.fixChanges:(o+=g.fixChanges,a+=1);let s=i.size>0?p(n/i.size):0,l=a>0?p(o/a):0,S={};for(let[v,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let b=0;for(let R of f)b+=r[R]?.fixChanges??0;let x=p(b/f.size);S[v]={flaggedFiles:f.size,fixDensity:x,lift:l>0?p(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?p(s/l):null,byCategory:S,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function p(e){return Math.round(e*100)/100}function Ee(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function E(e,r="existing shared infrastructure discount"){let t=h(e);return Math.abs(t-e.count)<.01?"":` (${Ee(t)} score-weighted after ${r})`}function y(e,r){let t=h(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Ee(t)} score-weighted)`}function lt(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${E(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${E(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} single-consumer symbols${E(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+E({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var we={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function He(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function dt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(d,w,C)=>{w>0&&i.push({axis:d,points:w,detail:C,kind:we[d]??"hygiene"})},a=(d,w,C,je,Oe,We,Ue)=>{let H=Math.max(je,1);if(C<=H)return;let D=C/H,P=Math.min(Oe,Math.ceil(Math.log2(D)*We));if(P<=0)return;let Ke=we[d]??"hygiene";n.push({axis:d,category:w,kind:Ke,count:C,threshold:p(H),ratio:p(D),extraPenalty:P}),o(d,P,`${C} ${Ue} exceed pressure threshold ${p(H)} (${p(D)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let v=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(v*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let g=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(g*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let f=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(f)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let b=h(e.reactHookCandidates),x=b/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(x)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Fe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Fe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let _=h(e.vueComposableCandidates),qe=_/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(qe)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=h(e.wrappers);o("wrappers",Math.min(3,I),y(e.wrappers,"wrapper candidate(s)"));let F=h(e.passthroughs);o("passthroughs",Math.min(3,F),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Ge=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Ge*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(d/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:d},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",d,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",b,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",_,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var m={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as mt}from"v8";var pt=64*1024*1024;function $(){let e=globalThis.gc;if(!e)return;let r=mt();r.heap_size_limit-r.used_heap_size<pt||e()}var ht=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Le(e=new Set(["indexed-graph","source-facts"])){return ht.map(r=>{let t=r.relationRequirements.map(n=>{let o=te(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var gt=50,ft=25e3,Ct=2500,Re=2500,De=50,vt=10,bt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ae={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:xt(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:wt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:Ht(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Et(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:Rt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:Dt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Pt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:kt(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:At(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Tt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Mt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Bt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Lt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:$t(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Vt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Nt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:qt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:zt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:_t(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:It(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ft(e,t)})};function zr(e,r={}){return Te(e,r.full!==!1,(t,i)=>{let n=St(e,r.scope,t,i);return B(n)})}function Gr(e,r,t={}){return yt(e,[r],t)[0]}function yt(e,r,t={}){return Te(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ae[a](e,t.scope,o,i))})}function Te(e,r,t){let i=he(e),n=Gt(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),$()}}function jr(e){return B(Me(e))}function Me(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Le(),dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Pe(e,"git-evidence")?.gitEvidence??null,suppressions:Pe(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Pe(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function St(e,r,t,i){return Me(bt.map(n=>Ae[n](e,r,i,t)))}function xt(e,r,t){return c(e,t,"dead",()=>{let i=U(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Wt(e,i.symbols))})}function wt(e,r,t){return c(e,t,"isolated",()=>{let i=ne(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Ut(e,i))})}function Ht(e,r,t){return c(e,t,"cycles",()=>J(e,{scope:r}).filter(n=>n.kind==="real").length)}function Et(e,r,t){let i=c(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Lt(e,r,t){return c(e,t,"extract-candidates",()=>ie(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function Rt(e,r,t){return c(e,t,"duplicate-bodies",()=>{let i=Z(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i)for(let s of a.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function Dt(e,r,t){return c(e,t,"twin-drift",()=>{let i=ee(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let s of a.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Pt(e,r,t){return c(e,t,"react-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function kt(e,r,t){return c(e,t,"react-hook-candidates",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Yt)})}function At(e,r,t){return c(e,t,"react-large-component-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Kt(i)})}function Tt(e,r,t){return c(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Mt(e,r,t){return c(e,t,"vue-composable-candidates",()=>{let i=ue(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Xt)})}function Bt(e,r,t){return c(e,t,"vue-large-view-pressure",()=>{let i=le(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return L(i)})}function $t(e,r,t){return c(e,t,"wrapper-candidates",()=>{let i=de(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Qt)})}function Vt(e,r,t){return c(e,t,"passthrough-candidates",()=>{let i=me(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Jt)})}function Nt(e,r,t){return c(e,t,"stale-abstractions",()=>{let i=pe(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function _t(e,r){return c(e,r,"git-evidence",()=>{let t=K(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=Y(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,l]of i)a[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:N(o.findings.reduce((s,l)=>s+ke(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:ke(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function It(e,r){return c(e,r,"suppressions",()=>{let t=ge(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ft(e,r){return c(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=ve(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function qt(e,r,t){return c(e,t,"drift",()=>{let i=re(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function zt(e,r,t){return c(e,t,"complexity-hotspots",()=>{let i=X(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>gt).length}})}function Gt(e,r){let t=e.symbols>=ft||e.documents>=Ct,i=r?Number.POSITIVE_INFINITY:De,n=r?Number.POSITIVE_INFINITY:vt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:Re,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${Re} symbols and reported their top ${De} findings. Enable full mode for unbounded candidate counts.`]}}function jt(e,r){r.releaseCachesBetweenPhases&&(M(e),$())}function c(e,r,t,i){Ot(t);try{return i()}finally{jt(e,r)}}function Ot(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Wt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ut(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath))}function L(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Be(e,r){return{...L(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Kt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function $e(e,r){return{...V(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Yt(e){let r=e.sharedHooks.length>0,t=Ve({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Ne(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Xt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ve({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ne(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ve(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Ie.has(_e(r))).length+Math.min(e.functions.length,3)}function Ne(e,r,t){let i=[...e,...r,...t].map(_e);return i.length>0&&i.every(n=>Ie.has(n))}function _e(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Qt(e){return e.actionTier==="signal"?.25:1}function Jt(e){return e.actionTier==="signal"?.25:1}function ke(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function N(e){return Math.round(e*100)/100}var Ie=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{m as a,bt as b,zr as c,Gr as d,yt as e,jr as f};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as le}from"./chunk-JTQVMR42.js";import{a as de}from"./chunk-QGVTFRY2.js";import{a as pe}from"./chunk-HKGFPJ4T.js";import{a as he}from"./chunk-6YTSKJJ3.js";import{a as ge}from"./chunk-D2DHWI3D.js";import{a as se}from"./chunk-HVF5VBG6.js";import{a as ue}from"./chunk-LMZ5PRUV.js";import{a as ce}from"./chunk-F7DY272B.js";import{a as oe}from"./chunk-FFRKR4EQ.js";import{a as ae}from"./chunk-3JKSW6LJ.js";import{a as ne}from"./chunk-I55I7XXP.js";import{a as me}from"./chunk-PU7T5QYQ.js";import{a as ie}from"./chunk-3PJABJSU.js";import{a as re}from"./chunk-IL676XCC.js";import{a as J}from"./chunk-LQRQN2XA.js";import{b as ee}from"./chunk-4UX2F3JX.js";import{a as Z}from"./chunk-JGKUET5J.js";import{b as te}from"./chunk-XDAUYDFT.js";import{a as M,b as U}from"./chunk-EVFUMY4R.js";import{b as Y}from"./chunk-DHUIOLDT.js";import{a as K}from"./chunk-6HFCYNYE.js";import{a as X}from"./chunk-QU5XRYB5.js";import{f as Q}from"./chunk-TQPCBMWT.js";import{a as W}from"./chunk-GSP44ENC.js";import{f as A,h as T}from"./chunk-XRYABF57.js";import{a as G}from"./chunk-ODDUPDP7.js";import{D as O,z as j}from"./chunk-ZOHS7AQV.js";import{h as k}from"./chunk-FESCRNVV.js";import{Aa as q,Ba as z}from"./chunk-N5B2NILC.js";import{readdirSync as Ye}from"fs";import{basename as Xe,join as fe}from"path";function Qe(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(s=>!i.has(s)).sort(),a=t.allowExtra?[]:[...i].filter(s=>!n.has(s)).sort();return{missing:o,extra:a}}function Je(e,r){let t=Ze(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=ot(e.config.projectRoot,r.mustEqual),n=Qe(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function ve(e,r){return r.map(t=>Je(e,t))}function Ze(e,r,t){return t.type==="markdown-list"?nt(e,r,t.marker):et(e,r,t)}function et(e,r,t){if(!k(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=j(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=O(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?tt(o,t.identifier):it(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function be(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function tt(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type==="object")return rt(n)}return null}function rt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(ye(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function it(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(ye(a.text));return[...o].sort()}return null}function ye(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function nt(e,r,t){let i=k(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=Se(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:xe(n)}}function Se(e,r){let t=G(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function xe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function ot(e,r){switch(r.type){case"top-level-dirs":return Ce(fe(e,r.path));case"file-glob":return[...new Set(W(e,r.pattern).map(t=>Xe(t)))].sort();case"registered-commands":return at(e);case"builtin-skills":return Ce(fe(e,"skills"))}}function Ce(e){let r;try{r=Ye(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function at(e){let r;try{r=q(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!z(i))throw i;return[]}let t=Se(r,"COMMAND REFERENCE");return t?xe(t):[]}function h(e){return e.scoreCount??e.count}function B(e){let r=lt(e),{breakdown:t,pressure:i}=dt(e),n=He(t,"risk"),o=He(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:h(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:h(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:h(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:st(e),validation:ut(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}function st(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ct(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ct(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:p(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ut(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[v,g]of Object.entries(r))i.has(v)?n+=g.fixChanges:(o+=g.fixChanges,a+=1);let s=i.size>0?p(n/i.size):0,l=a>0?p(o/a):0,S={};for(let[v,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let b=0;for(let R of f)b+=r[R]?.fixChanges??0;let x=p(b/f.size);S[v]={flaggedFiles:f.size,fixDensity:x,lift:l>0?p(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?p(s/l):null,byCategory:S,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function p(e){return Math.round(e*100)/100}function Ee(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function E(e,r="existing shared infrastructure discount"){let t=h(e);return Math.abs(t-e.count)<.01?"":` (${Ee(t)} score-weighted after ${r})`}function y(e,r){let t=h(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Ee(t)} score-weighted)`}function lt(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${E(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${E(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} single-consumer symbols${E(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+E({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var we={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function He(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function dt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(d,w,C)=>{w>0&&i.push({axis:d,points:w,detail:C,kind:we[d]??"hygiene"})},a=(d,w,C,je,Oe,We,Ue)=>{let H=Math.max(je,1);if(C<=H)return;let D=C/H,P=Math.min(Oe,Math.ceil(Math.log2(D)*We));if(P<=0)return;let Ke=we[d]??"hygiene";n.push({axis:d,category:w,kind:Ke,count:C,threshold:p(H),ratio:p(D),extraPenalty:P}),o(d,P,`${C} ${Ue} exceed pressure threshold ${p(H)} (${p(D)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let v=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(v*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let g=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(g*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let f=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(f)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let b=h(e.reactHookCandidates),x=b/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(x)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Fe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Fe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let _=h(e.vueComposableCandidates),qe=_/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(qe)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=h(e.wrappers);o("wrappers",Math.min(3,I),y(e.wrappers,"wrapper candidate(s)"));let F=h(e.passthroughs);o("passthroughs",Math.min(3,F),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Ge=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Ge*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(d/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:d},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",d,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",b,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",_,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var m={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as mt}from"v8";var pt=64*1024*1024;function $(){let e=globalThis.gc;if(!e)return;let r=mt();r.heap_size_limit-r.used_heap_size<pt||e()}var ht=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Le(e=new Set(["indexed-graph","source-facts"])){return ht.map(r=>{let t=r.relationRequirements.map(n=>{let o=te(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var gt=50,ft=25e3,Ct=2500,Re=2500,De=50,vt=10,bt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ae={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:xt(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:wt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:Ht(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Et(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:Rt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:Dt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Pt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:kt(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:At(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Tt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Mt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Bt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Lt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:$t(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Vt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Nt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:qt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:zt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:_t(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:It(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ft(e,t)})};function zr(e,r={}){return Te(e,r.full!==!1,(t,i)=>{let n=St(e,r.scope,t,i);return B(n)})}function Gr(e,r,t={}){return yt(e,[r],t)[0]}function yt(e,r,t={}){return Te(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ae[a](e,t.scope,o,i))})}function Te(e,r,t){let i=he(e),n=Gt(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),$()}}function jr(e){return B(Me(e))}function Me(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Le(),dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Pe(e,"git-evidence")?.gitEvidence??null,suppressions:Pe(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Pe(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function St(e,r,t,i){return Me(bt.map(n=>Ae[n](e,r,i,t)))}function xt(e,r,t){return c(e,t,"dead",()=>{let i=U(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Wt(e,i.symbols))})}function wt(e,r,t){return c(e,t,"isolated",()=>{let i=ne(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Ut(e,i))})}function Ht(e,r,t){return c(e,t,"cycles",()=>J(e,{scope:r}).filter(n=>n.kind==="real").length)}function Et(e,r,t){let i=c(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Lt(e,r,t){return c(e,t,"extract-candidates",()=>ie(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function Rt(e,r,t){return c(e,t,"duplicate-bodies",()=>{let i=Z(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i)for(let s of a.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function Dt(e,r,t){return c(e,t,"twin-drift",()=>{let i=ee(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let s of a.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Pt(e,r,t){return c(e,t,"react-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function kt(e,r,t){return c(e,t,"react-hook-candidates",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Yt)})}function At(e,r,t){return c(e,t,"react-large-component-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Kt(i)})}function Tt(e,r,t){return c(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Mt(e,r,t){return c(e,t,"vue-composable-candidates",()=>{let i=ue(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Xt)})}function Bt(e,r,t){return c(e,t,"vue-large-view-pressure",()=>{let i=le(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return L(i)})}function $t(e,r,t){return c(e,t,"wrapper-candidates",()=>{let i=de(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Qt)})}function Vt(e,r,t){return c(e,t,"passthrough-candidates",()=>{let i=me(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Jt)})}function Nt(e,r,t){return c(e,t,"stale-abstractions",()=>{let i=pe(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function _t(e,r){return c(e,r,"git-evidence",()=>{let t=K(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=Y(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,l]of i)a[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:N(o.findings.reduce((s,l)=>s+ke(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:ke(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function It(e,r){return c(e,r,"suppressions",()=>{let t=ge(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ft(e,r){return c(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=ve(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function qt(e,r,t){return c(e,t,"drift",()=>{let i=re(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function zt(e,r,t){return c(e,t,"complexity-hotspots",()=>{let i=X(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>gt).length}})}function Gt(e,r){let t=e.symbols>=ft||e.documents>=Ct,i=r?Number.POSITIVE_INFINITY:De,n=r?Number.POSITIVE_INFINITY:vt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:Re,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${Re} symbols and reported their top ${De} findings. Enable full mode for unbounded candidate counts.`]}}function jt(e,r){r.releaseCachesBetweenPhases&&(M(e),$())}function c(e,r,t,i){Ot(t);try{return i()}finally{jt(e,r)}}function Ot(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Wt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ut(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath))}function L(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Be(e,r){return{...L(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Kt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function $e(e,r){return{...V(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Yt(e){let r=e.sharedHooks.length>0,t=Ve({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Ne(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Xt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ve({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ne(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ve(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Ie.has(_e(r))).length+Math.min(e.functions.length,3)}function Ne(e,r,t){let i=[...e,...r,...t].map(_e);return i.length>0&&i.every(n=>Ie.has(n))}function _e(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Qt(e){return e.actionTier==="signal"?.25:1}function Jt(e){return e.actionTier==="signal"?.25:1}function ke(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function N(e){return Math.round(e*100)/100}var Ie=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{m as a,bt as b,zr as c,Gr as d,yt as e,jr as f};
|
|
2
|
+
//# sourceMappingURL=chunk-LDVT66YM.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y,c as _}from"./chunk-F4FNK44D.js";import{e as k}from"./chunk-WYPL7GF7.js";import{n as C,o as $}from"./chunk-7F45LJKI.js";import{execFileSync as w}from"child_process";import{createRequire as ce}from"module";import{chmodSync as le,existsSync as O}from"fs";import{platform as g,arch as S}from"os";import{dirname as de,join as q}from"path";import{createHash as N,randomUUID as G}from"crypto";import{closeSync as b,createReadStream as U,existsSync as z,fsyncSync as W,mkdirSync as K,openSync as I,renameSync as Q,unlinkSync as Y,writeSync as j}from"fs";import{homedir as X}from"os";import{dirname as D,join as E}from"path";var Z=3e5,ee=256*1024*1024;function F(e,r=process.env){let t=r.SCIP_QUERY_CACHE_DIR??(r.XDG_CACHE_HOME?E(r.XDG_CACHE_HOME,"scip-query"):E(X(),".cache","scip-query"));return E(t,e)}var s=class extends Error{constructor(t,n,i={}){super(n,i.cause===void 0?void 0:{cause:i.cause});this.kind=t;this.name="VerifiedBinaryFetchError"}kind};async function V(e){let{cachePath:r,url:t,expectedSha256:n}=e,i=e.timeoutMs??Z,o=e.maxBytes??ee,d=e.lockWaitMs??i;re(i,o,d);let a=te(t,i,e.signal);try{let c=await A(r,n,o,a.controller.signal);if(c)return{status:"cached",path:r,sha256:c};K(D(r),{recursive:!0});let l=await k(`${r}.fetch.lock`,{waitMs:d,pollMs:25,signal:a.controller.signal});if(!l)throw new s("lock-timeout",`timed out waiting ${d}ms for verified binary cache ownership at ${r}`);try{let p=await A(r,n,o,a.controller.signal);return p?{status:"cached",path:r,sha256:p}:await ne(e,a.controller,o)}finally{l.release()}}catch(c){throw a.controller.signal.aborted?f(a.controller.signal,t):c instanceof s?c:new s("stream",`failed to download ${t}: ${T(c)}`,{cause:c})}finally{clearTimeout(a.timeout),a.detachExternalAbort(),a.controller.signal.aborted||a.controller.abort()}}function re(e,r,t){if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive finite number.");if(!Number.isSafeInteger(r)||r<=0)throw new TypeError("maxBytes must be a positive safe integer.");if(!Number.isFinite(t)||t<0)throw new TypeError("lockWaitMs must be a non-negative finite number.")}function te(e,r,t){let n=new AbortController,i=()=>{n.abort(new s("aborted",`download of ${e} was aborted`,{cause:t?.reason}))};t?.addEventListener("abort",i,{once:!0}),t?.aborted&&i();let o=setTimeout(()=>{n.abort(new s("timeout",`download of ${e} timed out after ${r}ms`))},r);return o.unref(),{controller:n,timeout:o,detachExternalAbort:()=>t?.removeEventListener("abort",i)}}async function A(e,r,t,n){if(!z(e))return null;let i=N("sha256"),o=0;try{for await(let a of U(e,{signal:n})){let c=Buffer.isBuffer(a)?a:Buffer.from(a);if(o+=c.length,o>t)return null;i.update(c)}}catch{if(n.aborted)throw f(n,e);return null}let d=i.digest("hex");return d===r?d:null}async function ne(e,r,t){let n=e.fetchImpl??fetch,i;try{i=await L(n(e.url,{signal:r.signal}),r.signal)}catch(l){throw r.signal.aborted?f(r.signal,e.url):new s("stream",`failed to download ${e.url}: ${T(l)}`,{cause:l})}if(!i.ok){let l=new s("http",`failed to download ${e.url}: HTTP ${i.status}`);throw r.abort(l),l}let o=ie(i,t,e.url);if(!i.body)throw new s("stream",`downloaded ${e.url} response has no readable body`);let d=`${e.cachePath}.tmp-${process.pid}-${G()}`,a,c=!1;try{a=I(d,"wx",384),c=!0;let l=i.body.getReader(),p=N("sha256"),h=0;for(;;){let{done:x,value:m}=await L(l.read(),r.signal);if(x)break;if(!(m instanceof Uint8Array))throw new s("stream",`downloaded ${e.url} produced a non-byte stream chunk`);if(h+=m.byteLength,h>t||o!==void 0&&h>o){let R=new s("length",`downloaded ${e.url} exceeded its ${o??t} byte limit`);throw r.abort(R),R}let B=Buffer.from(m.buffer,m.byteOffset,m.byteLength);p.update(B),C(a,B,{writeFile:e.writeImpl??j},"verified binary staging")}if(o!==void 0&&h!==o)throw new s("length",`downloaded ${e.url} length mismatch: declared ${o} bytes, received ${h}`);let v=p.digest("hex");if(v!==e.expectedSha256)throw new s("checksum",`downloaded ${e.url} checksum mismatch: expected ${e.expectedSha256}, got ${v}`);b(a),a=void 0;try{oe(d,e.cachePath,e.renameImpl??Q,e.syncImpl??W)}catch(x){throw new s("install",`failed to install verified binary at ${e.cachePath}`,{cause:x})}return c=!1,{status:"downloaded",path:e.cachePath,sha256:v}}catch(l){throw r.signal.aborted?f(r.signal,e.url):l instanceof s?l:new s("install",`failed to stage verified binary at ${e.cachePath}`,{cause:l})}finally{if(a!==void 0)try{b(a)}catch{}if(c)try{Y(d)}catch{}}}function ie(e,r,t){let n=e.headers?.get("content-length");if(n==null)return;if(!/^\d+$/.test(n))throw new s("length",`downloaded ${t} has an invalid Content-Length header`);let i=Number(n);if(!Number.isSafeInteger(i)||i<0)throw new s("length",`downloaded ${t} has an invalid Content-Length header`);if(i>r)throw new s("length",`downloaded ${t} declares ${i} bytes, above the ${r} byte limit`);return i}function oe(e,r,t,n){ae(e,n),t(e,r),se(D(r),n)}function ae(e,r){let t=I(e,"r");try{r(t)}finally{b(t)}}function se(e,r){let t;try{t=I(e,"r")}catch(n){if($(n,process.platform))return;throw n}try{r(t)}catch(n){if(!$(n,process.platform))throw n}finally{b(t)}}function L(e,r){return r.aborted?Promise.reject(f(r,"operation")):new Promise((t,n)=>{let i=()=>{r.removeEventListener("abort",i),n(f(r,"operation"))};r.addEventListener("abort",i,{once:!0}),e.then(o=>{r.removeEventListener("abort",i),t(o)},o=>{r.removeEventListener("abort",i),n(o)})})}function f(e,r){return e.reason instanceof Error?e.reason:new s("aborted",`verified binary operation for ${r} was aborted`)}function T(e){return e instanceof Error?e.message:String(e)}var u="v0.8.1",J="https://github.com/sourcegraph/scip",P=`github.com/sourcegraph/scip/cmd/scip@${u}`,ue=ce(import.meta.url),fe={"scip-darwin-amd64.tar.gz":"39f18be957d350bcd9ed5cb12d7781b0e237a5cb2429a107feaf9ce2d1dcd5d5","scip-darwin-arm64.tar.gz":"5b3f4a2fb1dc10c599cb3422ed0406a739060e4ac0b1222c0f43630dd0dd8221","scip-linux-amd64.tar.gz":"16b79ed98f893abd530cfa63f333527f1351008b4a23e02b9e522e34d1da6596","scip-linux-arm64.tar.gz":"876dfb680119dd6e5713077c49b27701102d598bdeba94c809173276d399c7e2"},pe="SCIP_QUERY_SCIP_BIN";function Oe(e=process.env){return e.SCIP_QUERY_SQLITE_CONVERTER==="scip-cli"}function he(e){let r=e.env[pe];if(r&&e.fileExists(r))return{source:"env",path:r};let t=e.resolveCached?.()??null;if(t)return{source:"cache",path:t};if(e.isOnPath("scip"))return{source:"path",path:"scip"};if(e.platform==="win32"){let n=e.resolveSidecar(e.arch);if(n&&e.fileExists(n))return{source:"sidecar",path:n}}return null}function me(e){for(let r of e==="arm64"?["arm64","x64"]:[e])try{return ue.resolve(`scip-query-scip-windows/scip-win32-${r}.exe`)}catch{}return null}function M(e=process.env){return ge(e)?.path??null}function ge(e=process.env){let r=he({platform:g(),arch:S(),env:e,isOnPath:y,fileExists:O,resolveSidecar:me,resolveCached:()=>ye(e)});return r?.source==="path"?{source:"path",path:_("scip")??r.path}:r}function H(e=process.env){return F(q("scip",u,"scip"),e)}function ye(e){let r=H(e);return O(r)?r:null}function be(e){return e!==null&&e.includes(u.replace(/^v/,""))}function we(){let e=M();if(!e)return null;try{return w(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function Se(e=g(),r=S()){let t=ve(e,r);if(!t)return null;let n=fe[t.filename];return n?{...t,sha256:n}:null}function ve(e=g(),r=S()){let t,n,i;switch(e){case"darwin":t="darwin",i="tar.gz";break;case"linux":t="linux",i="tar.gz";break;default:return null}switch(r){case"arm64":n="arm64";break;case"x64":n="amd64";break;default:return null}let o=`scip-${t}-${n}.${i}`;return{url:`${J}/releases/download/${u}/${o}`,filename:o}}var xe={fetch:V,extract:(e,r)=>{w("tar",["-xzf",e,"-C",r,"scip"],{stdio:"pipe",timeout:12e4,killSignal:"SIGKILL"})},markExecutable:e=>le(e,493),probeVersion:e=>Ee(e),env:process.env};async function $e(e,r={}){let t={...xe,...r},n=Se();if(!n)return e(`No reviewed scip ${u} release archive is published for ${g()}/${S()}.`),null;let i=H(t.env),o=de(i),d=q(o,n.filename);e(`Downloading reviewed scip ${u} (${n.filename}, sha256 ${n.sha256.slice(0,12)}\u2026).`);try{let c=await t.fetch({cachePath:d,url:n.url,expectedSha256:n.sha256});t.extract(c.path,o),t.markExecutable(i)}catch(c){return e(`Could not install scip ${u}: ${c instanceof Error?c.message:String(c)}`),null}let a=t.probeVersion(i);return be(a)?(e(`Installed reviewed scip ${u} at ${i}.`),i):(e(`Installed scip at ${i} did not report ${u} (reported: ${a??"unavailable"}).`),null)}function Ee(e){try{return w(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}async function qe(e,r={}){if(g()!=="win32"&&await $e(e,r)!==null)return!0;if(y("go")){e(`Installing immutable ${P} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(w("go",["install",P],{stdio:"inherit",timeout:3e5,env:process.env}),y("scip")){let t=M(),n=we();if(t&&n&&n.includes(u))return e(`Successfully installed ${P}; resolved executable: ${t}; reported version: ${n}.`),!0;e(`go install completed, but the resolved scip executable did not report ${u} (executable: ${t??"unresolved"}; version: ${n??"unavailable"}).`)}}catch(t){let n=t instanceof Error?t.message:String(t);e(`go install failed: ${n}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${J}/releases/tag/${u}`),!1}export{u as a,Oe as b,M as c,ge as d,be as e,we as f,$e as g,qe as h};
|
|
2
|
+
//# sourceMappingURL=chunk-LEECKFCJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as F}from"./chunk-2E7CX53V.js";import{a as k,b as C,c as V,e as o,f as v}from"./chunk-B3X6KU75.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{P as y}from"./chunk-ZOHS7AQV.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(r=>({file:r.file,tokens:r.behaviorTokens,profile:r})),n=R(u,r=>r.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:n,profile:{name:"vue-composable-candidates"},compare:(r,a)=>T(r,a,m,t),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.fileB.localeCompare(a.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=o(i,"composable:"),d=o(i,"store:"),h=o(i,"reactivity:"),u=o(i,"lifecycle:"),n=o(i,"request:"),r=o(i,"function:"),a=o(i,"function-verb:"),b=o(i,"template-binding:"),p=o(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:n,sharedLifecycle:u,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:A,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let n of e)n.startsWith("composable:")?s+=1:n.startsWith("store:")?m+=1:n.startsWith("request:")?t+=1:n.startsWith("lifecycle:")?i+=1:n.startsWith("function:")?l+=1:n.startsWith("reactivity:")?c+=1:(n.startsWith("function-verb:")||n.startsWith("template-binding:")||n.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var A=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LMZ5PRUV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-35NLDRZC.js";import{c as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-35NLDRZC.js";import{c as d}from"./chunk-XRYABF57.js";import{b as u}from"./chunk-NJITK2GP.js";import{b as f}from"./chunk-TEBQMNVI.js";function w(n,e={}){return C(n,e).cycles}function C(n,e={}){return b(n,e)}function W(n,e={}){return b(n,e).cycles}function b(n,e={}){let{scope:t,maxDepth:o=10,edgeBasis:r="symbol-references"}=e,s=f(n,t,r==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:a}=g(s),l=a.filter(i=>D(s,i)).map(i=>{let c=[...i].sort(),p=S(s,c),y=x(p);return{path:p,component:c,edgeBasis:r,witness:!0,classification:y==="real"?"dependency-cycle":"module-structure-candidate",kind:y}});return l.sort((i,c)=>i.kind!==c.kind?i.kind==="real"?-1:1:i.path.length-c.path.length),{cycles:l,truncated:!1,edgeBasis:r,maxDepth:o}}function D(n,e){if(e.length>1)return!0;let t=e[0];return t!==void 0&&n.get(t)?.has(t)===!0}function S(n,e){let t=e[0];if(!t)return[];let o=new Set(e);for(let r of[...n.get(t)??[]].filter(s=>o.has(s)).sort()){if(r===t)return[t,t];let s=B(n,r,t,o);if(s)return[t,...s]}throw new Error(`Cyclic component did not contain a witness path from ${t}.`)}function B(n,e,t,o){let r=[e],s=new Map([[e,null]]);for(let a=0;a<r.length;a+=1){let l=r[a];if(l===t){let i=[];for(let c=l;c!==null;c=s.get(c)??null)i.push(c);return i.reverse()}for(let i of[...n.get(l)??[]].filter(c=>o.has(c)).sort())s.has(i)||(s.set(i,l),r.push(i))}return null}function x(n){for(let o of n){let r=u(o);if(r==="test"||r==="barrel"||r==="entry")return"module-hierarchy"}if(n.length!==3)return"real";let[e,t]=n;return!e||!t?"real":d(e)||d(t)||m(e,t)||m(t,e)||h(e,t)||h(t,e)||u(e)==="entry"||u(t)==="entry"?"module-hierarchy":"real"}function m(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=e.replace(/\.rs$/,"/");return n.startsWith(t)?!n.slice(t.length).includes("/"):!1}function h(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=n.replace(/\.rs$/,""),o=e.replace(/\.rs$/,"");if(t===o+"_tests"||t===o+"/tests")return!0;let r=n.split("/"),s=e.split("/");if(r.length===s.length&&r.includes("tests")&&s.includes("src")){let a=r[r.length-1],l=s[s.length-1];if(a&&a===l)return!0}return!1}export{w as a,C as b,W as c,b as d};
|
|
2
|
+
//# sourceMappingURL=chunk-LQRQN2XA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as t}from"./chunk-GZIUDL6G.js";function i(r,s,e={}){let a=t(r,s,{families:["dataflow"],...e.maxDepth!==void 0?{maxDepth:e.maxDepth}:{},...e.maxEdges!==void 0?{maxEdges:e.maxEdges}:{}});return{kind:"value-flow",targets:a.targets,edges:a.edges,coverage:{status:a.coverage.status,basis:"proved-bounded-static-value-flow",analysisBasis:"partial-system-definition-use",providers:["bounded-static-value-flow","typescript-local-dependence"],supportedRelations:["compiler-identified local definitions reaching local reads through a TypeScript control-flow graph","right-hand-side local reads supplying assignments and declarations","candidate closure captures and bounded same-owner field flow with explicit evidence strength","direct argument-to-parameter forwarding at compiler-resolved calls","bounded mechanically derived static arguments","callee return value to a consumed compiler-resolved call result"],unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","dynamic calls not resolved by the semantic provider"],graph:a.coverage}}}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LXABEJX3.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as x}from"./chunk-
|
|
1
|
+
import{a as x}from"./chunk-3SVF22I5.js";import{D as b}from"./chunk-ZOHS7AQV.js";import{k as p}from"./chunk-FESCRNVV.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(e,t,n,r){if(!Number.isSafeInteger(n)||n<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=p(e,t);if(i.length===0||n>=i.length)return null;let o=Math.max(0,n-r),c=Math.min(i.length-1,n+r);return{relativePath:t,startLine:o,endLine:c,focusLine:n,source:i.slice(o,c+1).join(`
|
|
2
2
|
`)}}function F(e,t,n,r,i){let o=h(e,t,n,r);if(!o)return null;let c=b(e,t)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,n,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=p(e,t),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,d=Math.min(a.length-1,Math.max(u,S));return{relativePath:t,startLine:u,endLine:d,focusLine:n,source:a.slice(u,d+1).join(`
|
|
3
3
|
`),kind:"complete-call-expression"}}function L(e,t,n,r,i){if(!Number.isSafeInteger(i)||i<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${i}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=Math.min(o.length-1,r,n+i-1);return{relativePath:t,startLine:n,endLine:c,focusLine:n,source:o.slice(n,c+1).join(`
|
|
4
4
|
`)}}function k(e,t,n,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=x(e,t,n);if(!c){let m=h(e,t,n,i);return m?{...m,unitType:null,unitStartLine:m.startLine,unitEndLine:m.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=n-s-Math.floor(u/2),d=Math.max(0,Math.min(a-u,S)),f=s+d,g=f+u-1;return{relativePath:t,startLine:f,endLine:g,focusLine:n,source:o.slice(f,g+1).join(`
|
|
5
5
|
`),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(e,t,n){let r=[];return N(e,t,n,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(e,t,n,r){if(M(e,t)){y.has(e.type)&&w(e)===n&&r.push(e);for(let i of e.namedChildren)N(i,t,n,r)}}function w(e){let t=e.childForFieldName("function")??e.childForFieldName("constructor")??e.childForFieldName("method")??e.childForFieldName("name")??e.namedChild(0);return t?t.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(e,t){return e.startPosition.row<=t&&e.endPosition.row>=t}export{h as a,F as b,L as c,k as d};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-M2O5NY6W.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as Z,c as q}from"./chunk-NK3JMP22.js";import{f as _}from"./chunk-MHIEP7EG.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-PLYUVM4F.js";import{d as Q,f as V}from"./chunk-AYPDH2LU.js";import{t as T}from"./chunk-TD7VKJ2Y.js";import{m as O}from"./chunk-42W3LFUK.js";import{E as M}from"./chunk-Q7GBK5T7.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
1
|
+
import{b as Z,c as q}from"./chunk-TPFHAQ2G.js";import{f as _}from"./chunk-6VVV4WRR.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-CJZXN4NU.js";import{d as Q,f as V}from"./chunk-DYGHBZ2N.js";import{t as T}from"./chunk-N2ZSIIGR.js";import{n as O}from"./chunk-ODDUPDP7.js";import{k as M}from"./chunk-FESCRNVV.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
2
2
|
`).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-MNV5FSBW.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{J as a,T as c}from"./chunk-3L2ZBPEX.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MPQ4OTBM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as V,e as Z}from"./chunk-MTDBHTSF.js";import{c as K,d as O,e as Q,f as U,o as Y}from"./chunk-
|
|
1
|
+
import{d as V,e as Z}from"./chunk-MTDBHTSF.js";import{c as K,d as O,e as Q,f as U,o as Y}from"./chunk-YEN6CYC7.js";import{a as H}from"./chunk-2GRUZAQF.js";import{G as D,K as x,M as j,T as N,U as G,Z as W,_ as J,p as k}from"./chunk-3L2ZBPEX.js";import{d as $,f as B}from"./chunk-DRENNWRG.js";import{d as A}from"./chunk-IW5XQG5G.js";import{p as v}from"./chunk-KYSDI3GE.js";function Ie(o,t,n={}){let i=z(o,[t],{additive:n.additive,semantic:n.semantic,semanticEvidence:n.semanticEvidence}),l=n.callableOnly?(i.get(t.symbolId)??[]).filter(s=>B(s.symbol)||s.source==="ast-callsite"):i.get(t.symbolId)??[];return typeof n.limit=="number"?l.slice(0,n.limit):l}function ve(o,t,n){return te(o,[t],n).get(t.symbolId)??[]}function te(o,t,n){let i=se(o)?ce(o,t,{semantic:n.semantic!==!1,semanticEvidence:n.semanticEvidence}):ae(o,n.semanticEvidence);return typeof n.limit!="number"?new Map(t.map(l=>[l.symbolId,i.get(l.symbolId)??[]])):new Map(t.map(l=>[l.symbolId,(i.get(l.symbolId)??[]).slice(0,n.limit)]))}var oe=A("caller-rows",{clearGroups:["whole-project"]}),ie=A("targeted-caller-strategy",{clearGroups:["whole-project"]}),le=2e4;function se(o){return ie.get(o,()=>(o.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>le)}function ae(o,t){return oe.get(o,()=>{let n=G(o),i=z(o,n,{semanticEvidence:t}),l=new Map;for(let c of n)l.set(c.symbol,c.symbolId);let s=new Map,a=new Map;for(let c of n){let f=i.get(c.symbolId);if(!(!f||f.length===0))for(let b of f){let r=l.get(b.symbol);if(r===void 0||r===c.symbolId)continue;let u=s.get(r);u||(u=[],s.set(r,u),a.set(r,new Set));let h=`${c.symbol}|${c.relativePath}`;a.get(r).has(h)||(a.get(r).add(h),u.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion",callEvidence:b.source}))}}return s})}function ce(o,t,n){let i=n.semantic&&n.semanticEvidence?t.flatMap(e=>{let d=re(o,e);return d?[d]:[]}):[],l=new Map(i.map(e=>[e.symbolId,e])),s=n.semanticEvidence?.referenceMap(o,i)??new Map,a=Y(o,t),c=new Set(t.map(e=>e.symbol)),b=[...new Set(t.flatMap(e=>H(o,"reverse",[e.relativePath])))].flatMap(e=>N(o,e)),r=new Map,u=X(o,b);for(let e of b)for(let d of u.get(e.symbolId)??[]){if(!c.has(d.symbol))continue;let g=r.get(d.symbol)??[];g.push({symbol:e.symbol,file:e.relativePath,source:"caller-map-inversion",callEvidence:d.source}),r.set(d.symbol,g)}let h=new Map;for(let e of t){let d=[],g=new Set,S=m=>{if(m.symbol===e.symbol)return;let E=`${m.symbol}|${m.file}`;g.has(E)||(g.add(E),d.push(m))};for(let m of r.get(e.symbol)??[])S(m);for(let m of a.get(e.symbolId)??[])m.file!==e.relativePath&&S({symbol:m.enclosingSymbol??m.file,file:m.file,source:"resolved-reference"});let L=l.get(e.symbolId);if(L)for(let m of s.get(L.symbolId)??[]){if(m.file===e.relativePath||o.isIgnored(m.file))continue;let E=J(N(o,m.file),m.line);S({symbol:E?.symbol??m.file,file:m.file,source:"semantic-reference"})}h.set(e.symbolId,d)}return h}function re(o,t){let n=V().join(", "),i=Z().join(", ");return o.get(`SELECT
|
|
2
2
|
d.id AS documentId,
|
|
3
3
|
gs.id AS symbolId,
|
|
4
4
|
gs.symbol,
|
|
@@ -35,4 +35,4 @@ import{d as V,e as Z}from"./chunk-MTDBHTSF.js";import{c as K,d as O,e as Q,f as
|
|
|
35
35
|
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
36
36
|
WHERE gs.id IN (${e.map(()=>"?").join(",")})`,...e,...e)),c=T([...t.map(e=>e.documentId),...a.flatMap(e=>e.document_id===null?[]:[e.document_id])]),f=new Map(c.flatMap(e=>o.all(`SELECT id, relative_path FROM documents
|
|
37
37
|
WHERE id IN (${e.map(()=>"?").join(",")})`,...e).map(d=>[d.id,d.relative_path]))),b=new Map;for(let e of a)b.has(e.symbol_id)||b.set(e.symbol_id,{symbol:e.symbol,file:e.document_id!==null?f.get(e.document_id)??"":""});let r=new Map,u=f,h=be(t);for(let[e,d]of h){let S=[...l.get(e)??[]].sort((y,C)=>y.start_line-C.start_line||y.end_line-C.end_line),L=[...d].sort((y,C)=>y.startLine-C.startLine||y.endLine-C.endLine),m=new Set,E=0;for(let y of L){for(;E<S.length&&S[E].start_line<=y.endLine;)m.add(S[E]),E+=1;for(let p of m)p.end_line<y.startLine&&m.delete(p);let C=new Set,P=[],R=null,ee=()=>{if(R)return R;let p=u.get(y.documentId)??"",_=new Set;if(p){let I=K(o,p),w=Math.max(0,y.startLine),F=Math.min(I.length-1,y.endLine);for(let M=w;M<=F;M+=1)for(let ne of I[M])_.add(ne)}return R=_,_};for(let p of m){if(p.symbol_id===y.symbolId)continue;let _=b.get(p.symbol_id);if(!_)continue;if(!(p.start_line>=y.startLine&&p.end_line<=y.endLine)){if(!(p.start_line<=y.endLine&&p.end_line>=y.startLine))continue;let M=$(_.symbol);if(!M||!ee().has(M))continue}let w=`${_.symbol}|${p.chunk_id}`;C.has(w)||(C.add(w),P.push({..._,chunkId:p.chunk_id,source:"scip-chunk"}))}r.set(y.symbolId,P)}}return r}var q=500;function T(o){let t=[...new Set(o)],n=[];for(let i=0;i<t.length;i+=q)n.push(t.slice(i,i+q));return n}function be(o){let t=new Map;for(let n of o){let i=t.get(n.documentId);i?i.push(n):t.set(n.documentId,[n])}return t}function ye(o){let t=new Map;for(let[n,i]of o){let l=[];for(let s of i)l.push({symbol:s.symbol,file:s.file,chunkId:-1,source:"semantic-callee",...s.callsiteLine===void 0?{}:{callsiteLine:s.callsiteLine}});t.set(n,l)}return t}export{Ie as a,ve as b,te as c,z as d};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-MV3CDXPI.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f,g as u}from"./chunk-
|
|
1
|
+
import{a as f,g as u}from"./chunk-7F45LJKI.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
|
|
2
2
|
`)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
|
|
3
3
|
# Dependencies
|
|
4
4
|
node_modules/
|
|
@@ -57,4 +57,4 @@ Thumbs.db
|
|
|
57
57
|
# Type definitions (often noise in queries)
|
|
58
58
|
*.d.ts
|
|
59
59
|
`;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
60
|
+
//# sourceMappingURL=chunk-MWN53KRN.js.map
|