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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{a as un,b as pn}from"./chunk-MNV5FSBW.js";import{a as se}from"./chunk-3TNRNKAT.js";import{a as ht,b as xt}from"./chunk-3SVF22I5.js";import{a as cn}from"./chunk-WIWY3CRX.js";import{b as dn}from"./chunk-DIRJWYBM.js";import{a as sn,b as St,c as an,e as ln}from"./chunk-TPFHAQ2G.js";import{b as nn,c as on,d as rn}from"./chunk-6VVV4WRR.js";import{a as bt,b as Xt,c as Zt,d as en,i as tn}from"./chunk-VUPHCS7Y.js";import{a as Jt}from"./chunk-WOIKCX6A.js";import{d as $e}from"./chunk-BOJ5SVE2.js";import{c as Yt}from"./chunk-CJZXN4NU.js";import{t as Vt,u as Qt}from"./chunk-WB3WYIRE.js";import{a as gt}from"./chunk-DYGHBZ2N.js";import{b as yt}from"./chunk-OSSESPDX.js";import{g as Ht,i as Wt}from"./chunk-XRYABF57.js";import{b as We}from"./chunk-NJITK2GP.js";import{A as Me,d as V,i as Y,t as fe}from"./chunk-N2ZSIIGR.js";import{A as Gt,n as ce,y as ft}from"./chunk-ODDUPDP7.js";import{D as he,J as He,a as qt,b as Ut}from"./chunk-ZOHS7AQV.js";import{h as zt,k as mt}from"./chunk-FESCRNVV.js";import{c as jt}from"./chunk-JWTGMPIT.js";import{d as pt}from"./chunk-N5B2NILC.js";function Ne(e){return e.includes("symbol-anchor")?0:e.includes("literal-owner")?1:e.some(t=>t.startsWith("boundary-import:"))?2:e.includes("reference-owner")?3:4}function mn(e,t){return Ne(e.origins)-Ne(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var fn=["call","contract-symbol","import","reference","runtime-boundary"],Mo={call:[{family:"control",subtype:"call"}],"contract-symbol":[{family:"contract",subtype:"uses-contract-symbol"}],import:[{family:"identity",subtype:"imports"}],reference:[{family:"identity",subtype:"references"}]},No={"structural-membership":[{family:"identity",subtype:"contains"}],"boundary-observation":[{family:"identity",subtype:"owns-runtime-observation"}],"external-import":[{family:"identity",subtype:"imports-external"}]};function gn(e){if(e.kind!=="runtime-boundary")return yn(Mo[e.kind]);let t=e.fromBoundaryParticipant?.protocol??e.toBoundaryParticipant?.protocol,n={crossesRuntimeBoundary:!0,...t?{protocol:t}:{},...e.runtimeBoundaryKey?{runtimeKey:e.runtimeBoundaryKey}:{}},o=[{family:"control",subtype:"runtime-handoff",context:n}];return e.evidence==="runtime-boundary:carrier.discriminator"&&(o.push({family:"control",subtype:"discriminator-dispatch",context:{...n},attributes:{joinRule:"carrier.discriminator",...e.fromBoundaryParticipant?.action?{producerAction:e.fromBoundaryParticipant.action}:{},...e.toBoundaryParticipant?.action?{consumerAction:e.toBoundaryParticipant.action}:{}}}),o.push({family:"data",subtype:"serialized-discriminator-transfer",context:{...n},attributes:{joinRule:"carrier.discriminator"}})),e.evidence==="runtime-boundary:queue.address"&&e.fromBoundaryParticipant?.action==="queue.send"&&e.toBoundaryParticipant?.action==="queue.consume"&&o.push({family:"temporal",subtype:"enqueue-before-consume",context:{...n},attributes:{producerAction:e.fromBoundaryParticipant.action,consumerAction:e.toBoundaryParticipant.action,retryPolicy:"unknown"}}),o}function Ve(e){return yn(No[e])}function yn(e){return e.map(t=>({...t,...t.context?{context:{...t.context}}:{},...t.attributes?{attributes:{...t.attributes}}:{}}))}import{join as er}from"path";import{createRequire as Ro}from"module";import{resolve as De}from"path";var Fo=Ro(import.meta.url),Ae;function Sn(e,t,n){let o=To();if(!o)return vt("The TypeScript compiler runtime is unavailable.");let i=Po(o,e,t),s=i.getSourceFile(De(t))??i.getSourceFile(t);if(!s)return vt(`The TypeScript compiler did not materialize ${t}.`);let r={ts:o,sourceFile:s,checker:i.getTypeChecker(),points:new Map,edges:new Map,unsupported:new Set,nextCfgId:0},a=$o(o,s,n);if(a.length===0)return vt("No function-like construct intersects the selected source range.");let d=new Map(a.map(u=>[u,Ao(s,u)])),c=a.map(u=>Bo(r,u,Do(o,u,d),d.get(u)));for(let u of c)Oo(r,u),qo(r,u),Go(r,u);Wo(r,c);let l=[...r.unsupported].sort();return{points:[...r.points.values()].map(({node:u,...f})=>f).sort(Zo),edges:[...r.edges.values()].sort((u,f)=>u.id.localeCompare(f.id)),coverage:{status:l.length===0?"complete":"partial",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:l}}}function To(){if(Ae!==void 0)return Ae;try{Ae=Fo("typescript")}catch{Ae=Qt()?.ts??null}return Ae}function Po(e,t,n){let o=De(n),i={target:e.ScriptTarget.ESNext,module:e.ModuleKind.NodeNext,moduleResolution:e.ModuleResolutionKind.NodeNext,skipLibCheck:!0,noResolve:!0},s=e.createSourceFile(o,t,i.target,!0,ko(e,o)),r=e.createCompilerHost(i,!0),a=r.getSourceFile.bind(r),d=r.readFile.bind(r),c=r.fileExists.bind(r);return r.getSourceFile=(l,u,f,m)=>De(l)===o?s:a(l,u,f,m),r.readFile=l=>De(l)===o?t:d(l),r.fileExists=l=>De(l)===o||c(l),e.createProgram([o],i,r)}function ko(e,t){return/\.tsx$/iu.test(t)?e.ScriptKind.TSX:/\.[cm]?js$/iu.test(t)?e.ScriptKind.JS:/\.jsx$/iu.test(t)?e.ScriptKind.JSX:e.ScriptKind.TS}function $o(e,t,n){let o=[],i=s=>{if(hn(e,s)){let r=t.getLineAndCharacterOfPosition(s.getStart(t)).line,a=t.getLineAndCharacterOfPosition(s.getEnd()).line;(!n||r<=n.endLine&&a>=n.startLine)&&o.push(s)}s.forEachChild(i)};return t.forEachChild(i),o.sort((s,r)=>s.getStart(t)-r.getStart(t))}function hn(e,t){return e.isFunctionLike(t)&&"body"in t&&t.body!==void 0}function Ao(e,t){return`callable:${encodeURIComponent(e.fileName)}:${t.getStart(e)}:${t.getEnd()}`}function Do(e,t,n){for(let o=t.parent;o;o=o.parent)if(hn(e,o)&&n.has(o))return n.get(o);return null}function Bo(e,t,n,o){let i=new Map,s=G(e,i,"exit",null),r=t.body,a=s.id;if(r&&e.ts.isBlock(r))a=Et(e,i,[...r.statements],s.id,{breakTarget:null,continueTarget:null});else if(r){let c=G(e,i,"statement",r);j(i,c.id,s.id),a=c.id}let d=G(e,i,"entry",t);return j(i,d.id,a),{id:o,node:t,parentId:n,cfg:i,entryId:d.id,exitId:s.id}}function Et(e,t,n,o,i){let s=o;for(let r=n.length-1;r>=0;r-=1)s=xe(e,t,n[r],s,i);return s}function xe(e,t,n,o,i){let s=e.ts;if(s.isBlock(n))return Et(e,t,[...n.statements],o,i);if(s.isIfStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.thenStatement,o,i),c=n.elseStatement?xe(e,t,n.elseStatement,o,i):o;return j(t,a.id,d),j(t,a.id,c),a.id}if(s.isWhileStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),a.id}if(s.isDoStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),d}if(s.isForStatement(n)){let a=G(e,t,"predicate",n.condition??n),d=n.incrementor?G(e,t,"statement",n.incrementor):null;d&&j(t,d.id,a.id);let c=d?.id??a.id,l=xe(e,t,n.statement,c,{breakTarget:o,continueTarget:c});if(j(t,a.id,l),n.condition&&j(t,a.id,o),!n.initializer)return a.id;let u=G(e,t,"statement",n.initializer);return j(t,u.id,a.id),u.id}if(s.isForInStatement(n)||s.isForOfStatement(n)){e.unsupported.add("for-in/for-of iterator assignment is conservatively represented without iterable element flow.");let a=G(e,t,"predicate",n.expression),d=G(e,t,"statement",n.initializer),c=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d.id),j(t,a.id,o),j(t,d.id,c),a.id}if(s.isSwitchStatement(n)){e.unsupported.add("switch fallthrough is represented conservatively; discriminant-to-case value refinement is unsupported.");let a=G(e,t,"predicate",n.expression),d=o,c=[];for(let l=n.caseBlock.clauses.length-1;l>=0;l-=1){let u=n.caseBlock.clauses[l];d=Et(e,t,[...u.statements],d,{...i,breakTarget:o}),c.push(d)}for(let l of c)j(t,a.id,l);return j(t,a.id,o),a.id}if(s.isReturnStatement(n)||s.isThrowStatement(n)){let a=G(e,t,"statement",n),d=[...t.values()].find(c=>c.kind==="exit");return j(t,a.id,d.id),a.id}if(s.isBreakStatement(n)){let a=G(e,t,"statement",n);return i.breakTarget||e.unsupported.add("A break statement could not be attached to a structured target."),j(t,a.id,i.breakTarget??o),a.id}if(s.isContinueStatement(n)){let a=G(e,t,"statement",n);return i.continueTarget||e.unsupported.add("A continue statement could not be attached to a structured target."),j(t,a.id,i.continueTarget??o),a.id}if(s.isTryStatement(n)){e.unsupported.add("Exceptional control-flow and finally completion are not included in the local compiler CFG.");let a=G(e,t,"statement",n);return a.invalidatesAllDefinitions=!0,j(t,a.id,o),a.id}let r=G(e,t,"statement",n);return j(t,r.id,o),r.id}function G(e,t,n,o){let i={id:`cfg:${e.nextCfgId++}`,kind:n,ast:o,successors:new Set,predecessors:new Set,definitions:[],uses:[],displayPoint:null,invalidatesAllDefinitions:!1};return t.set(i.id,i),i}function j(e,t,n){e.get(t).successors.add(n),e.get(n).predecessors.add(t)}function Oo(e,t){let n=t.cfg.get(t.entryId);for(let o of t.node.parameters){let i=ve(e,o.name);if(!i){e.unsupported.add("Destructured parameter definition-use is not implemented.");continue}n.definitions.push({point:Ee(e,i.node,"parameter-definition",i.symbolKey,i.name,t.id),rhsUseIds:[]})}for(let o of t.cfg.values())!o.ast||o.kind==="entry"||o.kind==="exit"||(o.kind==="predicate"&&(o.displayPoint=Ee(e,o.ast,"predicate",null,"predicate",t.id)),_o(e,t,o,o.ast),!o.displayPoint&&o.definitions.length===0&&o.uses.length===0&&(o.displayPoint=Ee(e,o.ast,"statement",null,Qo(e,o.ast),t.id)))}function _o(e,t,n,o){let i=e.ts;if(i.isTryStatement(o))return;let s=r=>{if(!(r!==o&&i.isFunctionLike(r))){if(i.isVariableDeclaration(r)){let a=r.initializer?Qe(e,t.id,r.initializer,n):[];n.uses.push(...a);let d=ve(e,r.name);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Destructured variable reaching definitions are not implemented."));return}if(i.isBinaryExpression(r)&&En(i,r.operatorToken.kind)){let a=Qe(e,t.id,r.right,n);r.operatorToken.kind!==i.SyntaxKind.EqualsToken&&a.push(...Qe(e,t.id,r.left,n)),n.uses.push(...a);let d=ve(e,r.left);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Dynamic or destructured assignment targets are not included in reaching definitions."));return}if((i.isPrefixUnaryExpression(r)||i.isPostfixUnaryExpression(r))&&(r.operator===i.SyntaxKind.PlusPlusToken||r.operator===i.SyntaxKind.MinusMinusToken)){let a=Qe(e,t.id,r.operand,n);n.uses.push(...a);let d=ve(e,r.operand);d&&n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)});return}if(!(i.isFunctionDeclaration(r)||i.isClassDeclaration(r)||i.isInterfaceDeclaration(r))){if(xn(e,r)){let a=vn(e,t.id,r);a&&n.uses.push(a),i.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}}};s(o),n.uses=In(n.uses)}function Qe(e,t,n,o){let i=[],s=r=>{if(!e.ts.isFunctionLike(r)){if(e.ts.isBinaryExpression(r)&&En(e.ts,r.operatorToken.kind)){o.invalidatesAllDefinitions=!0,e.unsupported.add("Nested assignment expressions are not included in ordered local definition-use flow."),r.operatorToken.kind!==e.ts.SyntaxKind.EqualsToken&&s(r.left),s(r.right);return}if(xn(e,r)){let a=vn(e,t,r);a&&i.push(a),e.ts.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}};return s(n),In(i)}function xn(e,t){if(e.ts.isPropertyAccessExpression(t))return!0;if(!e.ts.isIdentifier(t))return!1;let n=t.parent;return!(e.ts.isPropertyAccessExpression(n)&&n.name===t||"name"in n&&n.name===t&&Ko(e.ts,n)||e.ts.isPropertyAssignment(n)&&n.name===t||e.ts.isBindingElement(n)&&n.propertyName===t||e.ts.isLabeledStatement(n)||e.ts.isBreakOrContinueStatement(n)||jo(e.ts,t))}function Ko(e,t){return e.isVariableDeclaration(t)||e.isParameter(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isMethodDeclaration(t)||e.isPropertyDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isImportSpecifier(t)||e.isImportClause(t)||e.isNamespaceImport(t)}function jo(e,t){for(let n=t.parent;n;n=n.parent){if(e.isExpression(n)||e.isStatement(n)||e.isSourceFile(n))return!1;if(e.isTypeNode(n))return!0}return!1}function vn(e,t,n){let o=ve(e,n);return o?{point:Ee(e,o.node,"use",o.symbolKey,o.name,t),property:e.ts.isPropertyAccessExpression(n)}:null}function ve(e,t){let n=e.ts;if(n.isIdentifier(t)){let o=bn(e,t);return o?{node:t,symbolKey:o,name:t.text}:null}if(n.isPropertyAccessExpression(t)){let o=bn(e,t.name);return o?{node:t,symbolKey:o,name:t.getText(e.sourceFile)}:null}return n.isParenthesizedExpression(t)||n.isAsExpression(t)||n.isTypeAssertionExpression(t)||n.isNonNullExpression(t)?ve(e,t.expression):((n.isArrayLiteralExpression(t)||n.isObjectLiteralExpression(t))&&e.unsupported.add("Heap aggregate identity and destructured assignment are not included in local points-to flow."),null)}function bn(e,t){let n=e.checker.getSymbolAtLocation(t);if(!n)return null;if((n.flags&e.ts.SymbolFlags.Alias)!==0)try{n=e.checker.getAliasedSymbol(n)}catch{}let o=n.valueDeclaration??n.declarations?.[0];return o?`symbol:${encodeURIComponent(o.getSourceFile().fileName)}:${o.getStart()}:${n.getName()}`:`symbol:${n.getName()}`}function Ee(e,t,n,o,i,s){let r=t.getStart(e.sourceFile),a=t.getEnd(),d=e.sourceFile.getLineAndCharacterOfPosition(r),c=`flow-point:${encodeURIComponent(e.sourceFile.fileName)}:${r}:${a}:${n}:${encodeURIComponent(o??i)}`,l=e.points.get(c);if(l)return l;let u={id:c,kind:n,name:i,symbolKey:o,callableId:s,start:r,end:a,line:d.line,column:d.character,node:t};return e.points.set(c,u),u}function qo(e,t){let n=[...t.cfg.values()].flatMap(d=>d.definitions),o=new Map(n.map(d=>[d.point.id,d])),i=Uo(n),s=new Map,r=new Map;for(let d of t.cfg.values())s.set(d.id,new Set),r.set(d.id,new Set);let a=!0;for(;a;){a=!1;for(let d of t.cfg.values()){let c=Jo([...d.predecessors].map(f=>r.get(f))),l=new Set(c);d.invalidatesAllDefinitions&&l.clear();let u=zo(d.definitions);for(let f of u){for(let m of i.get(f.point.symbolKey)??[])l.delete(m.point.id);l.add(f.point.id)}It(s.get(d.id),c)||(s.set(d.id,c),a=!0),It(r.get(d.id),l)||(r.set(d.id,l),a=!0)}}for(let d of t.cfg.values()){let c=s.get(d.id);for(let l of d.uses){let u=d.definitions.filter(m=>m.point.symbolKey===l.point.symbolKey&&m.point.start<l.point.start&&!m.rhsUseIds.includes(l.point.id)).sort((m,p)=>p.point.start-m.point.start)[0],f=u?[u.point.id]:c;for(let m of f){let p=o.get(m);p.point.symbolKey===l.point.symbolKey&&Be(e,"reaching-definition",p.point.id,l.point.id,"exact","A CFG path reaches this use without an intervening definition.")}}for(let l of d.definitions)for(let u of l.rhsUseIds)Be(e,"value-source",u,l.point.id,"exact","This right-hand-side use supplies the new definition.")}}function Uo(e){let t=new Map;for(let n of e){if(!n.point.symbolKey)continue;let o=t.get(n.point.symbolKey)??[];o.push(n),t.set(n.point.symbolKey,o)}return t}function zo(e){let t=new Map;for(let n of e)n.point.symbolKey&&t.set(n.point.symbolKey,n);return[...t.values()]}function Go(e,t){let n=Ho(t);for(let o of t.cfg.values()){if(o.successors.size<2||!o.displayPoint)continue;let i=n.get(o.id);for(let s of o.successors)for(let r of n.get(s)??[]){if(i.has(r)||r===t.exitId)continue;let a=t.cfg.get(r),d=[...a.definitions.map(c=>c.point),...a.uses.map(c=>c.point),...a.displayPoint?[a.displayPoint]:[]];for(let c of Yo(d))Be(e,"control-dependence",o.displayPoint.id,c.id,"exact","The target postdominates a branch successor but does not postdominate the predicate.")}}}function Ho(e){let t=[...e.cfg.keys()],n=new Set(t),o=new Map;for(let s of t)o.set(s,s===e.exitId?new Set([s]):new Set(n));let i=!0;for(;i;){i=!1;for(let s of e.cfg.values()){if(s.id===e.exitId)continue;let r=[...s.successors].map(d=>o.get(d)),a=new Set([s.id,...Xo(r)]);It(o.get(s.id),a)||(o.set(s.id,a),i=!0)}}return o}function Wo(e,t){let n=new Map(t.map(r=>[r.id,r.parentId])),o=t.flatMap(r=>[...r.cfg.values()].flatMap(a=>a.definitions.map(d=>d.point))),i=new Map;for(let r of o){if(!r.symbolKey)continue;let a=i.get(r.symbolKey)??[];a.push(r),i.set(r.symbolKey,a)}let s=new Set([...e.edges.values()].filter(r=>r.kind==="reaching-definition").map(r=>r.toPointId));for(let r of t)for(let a of[...r.cfg.values()].flatMap(d=>d.uses)){if(!a.point.symbolKey||s.has(a.point.id))continue;let d=i.get(a.point.symbolKey)??[];for(let c of d)Vo(c.callableId,a.point.callableId,n)?Be(e,"closure-capture",c.id,a.point.id,"candidate","Compiler identity proves the captured binding, but invocation order can select among outer definitions."):a.property&&Be(e,"field-definition-to-use",c.id,a.point.id,"candidate","Compiler identity matches the field; cross-callable receiver and execution order remain unresolved.")}[...e.edges.values()].some(r=>r.kind==="closure-capture")&&e.unsupported.add("Closure capture identity is known, but invocation order and intervening writes remain candidate flow."),[...e.edges.values()].some(r=>r.kind==="field-definition-to-use")&&e.unsupported.add("Cross-callable field flow lacks receiver points-to and invocation-order analysis.")}function Vo(e,t,n){for(let o=n.get(t)??null;o;o=n.get(o)??null)if(o===e)return!0;return!1}function Be(e,t,n,o,i,s){let r=`local-flow-edge:${t}:${encodeURIComponent(n)}:${encodeURIComponent(o)}`;e.edges.set(r,{id:r,kind:t,fromPointId:n,toPointId:o,strength:i,reason:s})}function En(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function Qo(e,t){let n=t.getText(e.sourceFile).replace(/\s+/gu," ").trim();return n.length>80?`${n.slice(0,77)}...`:n||e.ts.SyntaxKind[t.kind]||"statement"}function In(e){return[...new Map(e.map(t=>[t.point.id,t])).values()]}function Yo(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Jo(e){return new Set(e.flatMap(t=>[...t]))}function Xo(e){return e.length===0?new Set:new Set([...e[0]].filter(t=>e.slice(1).every(n=>n.has(t))))}function It(e,t){return e.size===t.size&&[...e].every(n=>t.has(n))}function Zo(e,t){return e.start-t.start||e.kind.localeCompare(t.kind)||e.id.localeCompare(t.id)}function vt(e){return{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[e]}}}var tr=jt("typescript-local-flow",{clearGroups:["whole-project","source-file","semantic-provider"]});function Ct(e,t,n,o){if(!Vt(t))return null;let i=`${t}\0${n}\0${o}`;return tr.get(e,i,()=>{let s=zt(e,t);return s?Sn(s,er(e.config.projectRoot,t),{startLine:n,endLine:o}):{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[`Current source is unavailable for ${t}.`]}}})}function nr(e,t=new Map){let n=new Map,o=new Map,i=[];for(let s of e.transfers){if(!e.caller)continue;let r=Ye(e.caller,s.callerPosition),a=Ye(e.callee,s.calleePosition);Oe(n,r),Oe(n,a),wt(o,e.caller,r),wt(o,e.callee,a);let d=Q("edge","data-transfer",s.proof.file,String(s.proof.startLine),String(s.callerPosition),String(s.calleePosition));o.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,callerPosition:s.callerPosition,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-direct-parameter-transfer",strength:"exact",identity:`${e.caller.symbol}:${s.callerPosition} -> ${e.callee.symbol}:${s.calleePosition}`,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]})}return e.unknown.forEach((s,r)=>{let a=Ye(e.callee,s.calleePosition);Oe(n,a),wt(o,e.callee,a);let d=t.get(s.calleePosition);if(d&&mr(d)){pr(o,n,e,s.calleePosition,s.argumentText,d);return}let c=cr(e,s.calleePosition,s.argumentText);Oe(n,c);let l=Q("edge","data-transfer-unsupported",s.proof.file,String(s.proof.startLine),String(s.calleePosition),String(r));o.set(l,{id:l,kind:"data-transfer",fromNodeId:c.id,toNodeId:a.id,directed:!0,disposition:"unsupported",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-argument-expression",strength:"exact",identity:s.argumentText,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]}),i.push({id:Q("frontier","data-transfer",l),kind:"data-transfer",direction:"unresolved",fromNodeIds:[c.id],edgeIds:[l],memberNodeIds:[a.id],memberCount:1,disposition:"unsupported",reason:d?.derivation.rule??s.reason,expansion:null})}),{nodes:[...n.values()],edges:[...o.values()],frontiers:i,blindSpots:[]}}function Ln(e,t,n=[]){let o=wn(),i=new Map,s=new Set;for(let r of t){if(r.kind!=="call"||!r.fromSymbol||!r.toSymbol||r.line===null)continue;let a=dr(i,e,r.toFile,r.toSymbol);if(!a)continue;let d=Zt(e,a),c=d.sites.filter(b=>b.file===r.fromFile&&b.startLine<=r.line&&b.endLine>=r.line&&b.caller?.symbol===r.fromSymbol);if(c.length!==1){let b=d.unresolved.find(S=>S.file===r.fromFile&&S.line===r.line);b&&o.blindSpots.push(`Parameter flow unresolved at ${r.fromFile}:${r.line+1}: ${b.reason}.`);continue}let l=c[0],u=`${l.file}\0${l.callNode.startIndex}\0${l.callNode.endIndex}\0${a.symbol}`;if(s.has(u))continue;s.add(u);let f=en(e,l),m=he(e,l.file)?.rootNode,p=new Map;if(m)for(let b of f.unknown){let S=Xt({db:e,file:l.file,root:m},l.arguments[b.calleePosition]);S&&p.set(b.calleePosition,S)}Cn(o,nr(f,p)),f.caller&&ar(l.callNode)&&lr(o,f,l.callNode)}for(let r of n){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=Ct(e,r.location.file,r.location.line,a);if(d){Cn(o,or(r,d.points,d.edges));for(let c of d.coverage.unsupported)o.blindSpots.push(`TypeScript local flow is partial for ${r.location.file}:${r.location.line+1}-${a+1}: ${c} Recover with: scip-query inspect --at '${r.location.file}:${r.location.line+1}-${a+1}' --view behavior.`)}}return o.blindSpots=[...new Set(o.blindSpots)].sort(),o}function or(e,t,n){let o=wn(),i=new Map,s=new Map,r=new Map,a=e.location.file;for(let d of t){let c=rr(e,a,d);r.set(d.id,c.id),i.set(c.id,c),ir(s,e,c)}for(let d of n){let c=r.get(d.fromPointId),l=r.get(d.toPointId);if(!c||!l)continue;let u=sr(d),f=Q("edge","typescript-local-flow",a,d.id);s.set(f,{id:f,kind:d.kind==="control-dependence"?"control-dependence":"data-transfer",fromNodeId:c,toNodeId:l,directed:!0,disposition:"folded",semantics:[u],evidence:[{method:"typescript-compiler-cfg-reaching-definitions",strength:d.strength,identity:d.reason,location:i.get(c)?.location??e.location}]})}return o.nodes=[...i.values()],o.edges=[...s.values()],o}function rr(e,t,n){return{id:Q("local-flow-point",t,String(n.start),String(n.end),n.kind,n.symbolKey??n.name),kind:n.kind==="parameter-definition"||n.kind==="definition"?"local-definition":n.kind==="use"?"local-use":n.kind==="predicate"?"control-predicate":"local-statement",label:n.name,disposition:"folded",location:{file:t,line:n.line,endLine:n.line},anchorIds:[],attributes:{ownerNodeId:e.id,pointKind:n.kind,callableId:n.callableId,symbolKey:n.symbolKey,column:n.column}}}function ir(e,t,n){let o=Q("edge","local-flow-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"local-flow-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"typescript-compiler-local-flow-owner",strength:"exact",identity:t.id,location:n.location}]})}function sr(e){switch(e.kind){case"reaching-definition":return{family:"data",subtype:"definition-to-use"};case"value-source":return{family:"data",subtype:"value-to-definition"};case"closure-capture":return{family:"data",subtype:"closure-capture"};case"field-definition-to-use":return{family:"data",subtype:"field-definition-to-use"};case"control-dependence":return{family:"control",subtype:"control-dependence"}}}function ar(e){let t=e;for(;t.parent&&["await_expression","yield_expression","parenthesized_expression","as_expression","type_assertion"].includes(t.parent.type);)t=t.parent;return t.parent!==null&&t.parent.type!=="expression_statement"}function lr(e,t,n){if(!t.caller)return;let o={id:Q("call-result",t.call.file,String(n.startIndex),String(n.endIndex),t.callee.symbol),kind:"call-result",label:`result of ${t.callee.leaf}`,disposition:"folded",location:{file:t.call.file,line:t.call.startLine,endLine:t.call.endLine},anchorIds:[],attributes:{calleeSymbol:t.callee.symbol,callerSymbol:t.caller.symbol}},i=Q("edge","return-to-call-result",t.callee.symbol,o.id),s=Q("edge","call-result-owner",t.caller.symbol,o.id);e.nodes.push(o),e.edges.push({id:i,kind:"data-transfer",fromNodeId:Mt(t.callee.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"return-to-call-result"}],evidence:[{method:"compiler-callsite-used-result",strength:"exact",identity:`${t.callee.symbol} -> ${t.caller.symbol}`,location:o.location}]},{id:s,kind:"call-result-owner",fromNodeId:Mt(t.caller.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-call-result"}],evidence:[{method:"compiler-call-result-owner",strength:"exact",identity:t.caller.symbol,location:o.location}]})}function wn(){return{nodes:[],edges:[],frontiers:[],blindSpots:[]}}function Cn(e,t){Lt(e.nodes,t.nodes),Lt(e.edges,t.edges),Lt(e.frontiers,t.frontiers),e.blindSpots.push(...t.blindSpots)}function Lt(e,t){let n=new Set(e.map(o=>o.id));for(let o of t)n.has(o.id)||(n.add(o.id),e.push(o))}function dr(e,t,n,o){let i=`${n}\0${o}`,s=e.get(i);if(s!==void 0)return s;let r=fe(t,n).find(a=>a.symbol===o)??null;return e.set(i,r),r}function Ye(e,t){return{id:yr(e.symbol,t),kind:"parameter",label:`${e.leaf} parameter ${t}`,disposition:"folded",location:{file:e.relativePath,line:e.startLine,endLine:e.endLine},anchorIds:[],attributes:{ownerSymbol:e.symbol,position:t}}}function cr(e,t,n){return{id:Q("argument-expression",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"argument-expression",label:n,disposition:"unsupported",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{calleeSymbol:e.callee.symbol,position:t}}}function ur(e,t,n){return{id:Q("static-value",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"static-value",label:n.value,disposition:"folded",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{value:n.value,precision:n.precision,evidence:n.evidence,termKind:n.term.kind,derivationRule:n.derivation.rule}}}function pr(e,t,n,o,i,s){let r=ur(n,o,s),a=Ye(n.callee,o);Oe(t,r);let d=Q("edge","static-value-transfer",n.call.file,String(n.call.startLine),String(o));e.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:fr(s),attributes:{argumentText:i,calleePosition:o,value:s.value,precision:s.precision,derivationRule:s.derivation.rule}}],evidence:gr(s,n)})}function mr(e){return e.derivation.kind!=="heuristic"&&e.precision!=="symbolic"&&e.precision!=="unknown"}function fr(e){return e.derivation.rule==="bounded-call-return"?"return-to-parameter":e.derivation.rule==="member-constant"||e.term.kind==="property"?"property-to-parameter":"constant-to-parameter"}function gr(e,t){return(e.derivation.sourceSpans.length>0?e.derivation.sourceSpans:[t.call]).map(o=>({method:`static-value:${e.derivation.rule}`,strength:e.derivation.kind==="direct"?"exact":"derived",identity:e.derivation.inputFactIds.join(",")||e.value,location:{file:o.file,line:o.startLine,endLine:o.endLine}}))}function Oe(e,t){e.has(t.id)||e.set(t.id,t)}function wt(e,t,n){let o=Q("edge","parameter-owner",t.symbol,n.id);e.has(o)||e.set(o,{id:o,kind:"parameter-owner",fromNodeId:Mt(t.symbol),toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"compiler-parameter-owner",strength:"exact",identity:t.symbol,location:{file:t.relativePath,line:t.startLine,endLine:t.endLine}}]})}function yr(e,t){return Q("parameter",e,String(t))}function Mt(e){return Q("symbol",e)}function Q(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function Mn(e,t){let n=new Map,o=new Map,i=new Map,s=new Set;for(let r of t){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=on(e,r.location.file,r.location.line,a);if(!d){s.add(`Control dependence unavailable for ${r.location.file}:${r.location.line+1}-${a+1}: no supported syntax tree or covering construct.`);continue}for(let c of d.facts){let l=Nt(r,c.controller),u=Nt(r,c.outcome);n.set(l.id,l),n.set(u.id,u),br(o,r,l);let f=Ie("edge","control-dependence",l.id,u.id,c.subtype);o.set(f,{id:f,kind:"control-dependence",fromNodeId:l.id,toNodeId:u.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:c.subtype,attributes:{...c.attributes}}],evidence:[{method:"parser-control-dependence",strength:"exact",identity:`${r.location.file}:${c.controller.startLine+1}-${c.outcome.startLine+1}`,location:{file:r.location.file,line:c.controller.startLine,endLine:c.controller.endLine}}]})}for(let c of d.terminals){let l=Nt(r,c);n.set(l.id,l);let u=c.label.startsWith("throw")||c.label.startsWith("raise")?"throw":"return",f=Ie("edge","control-terminal",r.id,l.id,u);o.set(f,{id:f,kind:"control-terminal",fromNodeId:r.id,toNodeId:l.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:u==="throw"?"throws":"returns"}],evidence:[{method:"parser-terminal-statement",strength:"exact",identity:c.label,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]})}for(let c of d.unsupported){let l=Ie("control-unsupported",r.location.file,String(c.startLine),String(c.endLine),c.reason);n.set(l,{id:l,kind:"control-unsupported",label:c.reason,disposition:"unsupported",location:{file:r.location.file,line:c.startLine,endLine:c.endLine},anchorIds:[],attributes:{ownerNodeId:r.id}});let u=Ie("edge","control-unsupported",r.id,l);o.set(u,{id:u,kind:"control-dependence",fromNodeId:r.id,toNodeId:l,directed:!0,disposition:"unsupported",semantics:[{family:"control",subtype:"unresolved-control-construct"}],evidence:[{method:"parser-control-construct",strength:"exact",identity:c.reason,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]});let f=Ie("frontier","control-dependence",l);i.set(f,{id:f,kind:"control-dependence",direction:"unresolved",fromNodeIds:[r.id],edgeIds:[u],memberNodeIds:[l],memberCount:1,disposition:"unsupported",reason:c.reason,expansion:null})}}return{nodes:[...n.values()],edges:[...o.values()],frontiers:[...i.values()],blindSpots:[...s].sort()}}function Nt(e,t){let n=e.location.file;return{id:Ie(`control-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`control-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind,implicit:t.implicit}}}function br(e,t,n){let o=Ie("edge","control-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"control-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-control"}],evidence:[{method:"parser-control-owner",strength:"exact",identity:t.id,location:t.location}]})}function Ie(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Je=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),Ke=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Sr=new Set(["assignment","assignment_expression","augmented_assignment_expression"]),Ft=new Set(["update_expression"]),Tn=new Set(["array_access","element_access_expression","subscript_expression"]),Pn=new Set(["attribute","field_access","field_expression","member_access_expression","member_expression","selector_expression"]),hr=new Set(["false","null","null_literal","number","number_literal","string","string_literal","template_string","true"]),xr=new Set(["call_expression","method_invocation","object_creation_expression"]),vr=new Set(["comment","else_clause","formal_parameters","parameters","type_parameters"]);function kn(e,t,n,o){let i=he(e,t);if(!i)return null;let s=Rr(i.rootNode,n,o);if(!s)return null;let r=[],a=[],d=[];return Ce(s,c=>{if(Sr.has(c.type)||Ft.has(c.type)||An(c)){let l=Er(c);l?r.push(l):d.push({family:"state",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:`Mutation target ${le(c.text)} could not be resolved to an exact source resource.`})}}),Ce(s,c=>{if(!Ke.has(c.type))return;let l=Mr(c);for(let u=0;u<l.length-1;u+=1)a.push({from:_e(l[u]),to:_e(l[u+1]),subtype:"lexical-successor",synchronizationScope:null,attributes:{sameScope:!0,executionConditional:!0}});for(let u=0;u<l.length;u+=1){let f=l[u],m=Tr(f).filter(p=>p.type==="await_expression");for(let p of m){let b=je("event",`await ${le(p.text.replace(/^await\s+/u,""))}`,p);a.push({from:_e(f),to:b,subtype:"awaits-completion",synchronizationScope:null,attributes:{completionRequired:!0}});let S=l[u+1];S&&a.push({from:b,to:_e(S),subtype:"await-completion-before",synchronizationScope:null,attributes:{continuationOnly:!0}})}}}),Ce(s,c=>{if(c.type!=="synchronized_statement")return;let l=c.childForFieldName("object")??c.childForFieldName("condition")??c.namedChildren.find(b=>!Ke.has(b.type)),u=c.childForFieldName("body")??c.namedChildren.find(b=>Ke.has(b.type));if(!l||!u){d.push({family:"temporal",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:"Synchronized scope has no structurally resolved monitor or body."});return}let f=le(l.text).replace(/^\(|\)$/gu,""),m=je("lock",f,l),p=Fr(u).filter(b=>b.parent!==null&&Dn(b));for(let b of Nr(p))a.push({from:m,to:_e(b),subtype:"inside-lock-scope",synchronizationScope:f,attributes:{syntaxNative:!0}})}),{mutations:r,temporal:a,unsupported:d}}function Er(e){let t=An(e),n=e.childForFieldName("left")??e.childForFieldName("argument")??(t?e.namedChildren.at(-1)??null:e.namedChildren[0]??null);if(!n)return null;let o=Ir(n);if(!o)return null;let i=t?"delete":Ft.has(e.type)||!wr(e,n).startsWith("=")?"update":"assign",s=t||Ft.has(e.type)?null:e.childForFieldName("right");return{event:je("event",le(e.text),e),resource:{kind:"resource",label:o.name,startLine:n.startPosition.row,endLine:n.endPosition.row},operation:i,durabilityClass:"in-memory",recordIdentity:o.recordIdentity,value:s?je("value",le(s.text),s):null,dataSubtype:s?Cr(s,e):null}}function Ir(e){if(Tn.has(e.type)){let t=e.childForFieldName("object")??e.childForFieldName("array")??e.namedChildren[0]??null,n=e.childForFieldName("index")??e.childForFieldName("subscript")??e.namedChildren[1]??null;return!t||!n?null:{name:`${le(t.text)}[]`,recordIdentity:le(n.text)}}return Pn.has(e.type)?{name:le(e.text),recordIdentity:null}:/^(?:identifier|property_identifier|field_identifier)$/u.test(e.type)?{name:le(e.text),recordIdentity:null}:null}function Cr(e,t){return hr.has(e.type)||/(?:integer|float|decimal|boolean|character)_literal$/u.test(e.type)?"constant-to-state":xr.has(e.type)?"return-to-state":Pn.has(e.type)||Tn.has(e.type)?"property-to-state":/identifier$/u.test(e.type)?Lr(e.text,t)?"captured-value-to-state":"value-to-state":"expression-to-state"}function Lr(e,t){let n=Rt(t.parent);if(!n||Nn(n,e))return!1;let o=Rt(n.parent);for(;o;){if(Nn(o,e))return!0;o=Rt(o.parent)}return!1}function Rt(e){let t=e;for(;t;){if(Je.has(t.type))return t;t=t.parent}return null}function Nn(e,t){let n=e.childForFieldName("parameters")??e.namedChildren.find(s=>["formal_parameters","parameters"].includes(s.type));if(n&&Rn(n,t))return!0;let o=e.childForFieldName("body")??e.namedChildren.find(s=>Ke.has(s.type));if(!o)return!1;let i=!1;return $n(o,e,s=>{if(i||!/(?:declarator|declaration|parameter)$/u.test(s.type))return;let r=s.childForFieldName("name")??s.childForFieldName("pattern")??s.namedChildren[0];r&&Rn(r,t)&&(i=!0)}),i}function Rn(e,t){let n=!1;return Ce(e,o=>{/identifier$/u.test(o.type)&&o.text===t&&(n=!0)}),n}function $n(e,t,n){n(e);for(let o of e.namedChildren)o!==t&&Je.has(o.type)||$n(o,t,n)}function wr(e,t){let n=e.childForFieldName("right"),o=Math.max(0,t.endIndex-e.startIndex),i=n?Math.max(o,n.startIndex-e.startIndex):e.text.length;return e.text.slice(o,i).trim()}function An(e){return(e.type==="delete_expression"||e.type==="unary_expression")&&/^delete\b/u.test(e.text.trim())}function Mr(e){return e.namedChildren.filter(t=>Dn(t))}function Dn(e){return vr.has(e.type)||Ke.has(e.type)?!1:/(?:statement|declaration)$/u.test(e.type)||e.type==="expression_statement"||e.type==="local_variable_declaration"}function Nr(e){let t=new Set(e);return e.filter(n=>{let o=n.parent;for(;o;){if(t.has(o))return!1;o=o.parent}return!0})}function _e(e){return je("event",le(e.text),e)}function je(e,t,n){return{kind:e,label:t,startLine:n.startPosition.row,endLine:n.endPosition.row}}function Rr(e,t,n){let o=[];return Ce(e,s=>{s.startPosition.row<=t&&s.endPosition.row>=n&&o.push(s)}),o.filter(s=>Je.has(s.type)).sort(Fn)[0]??o.sort(Fn)[0]??null}function Fn(e,t){return e.endIndex-e.startIndex-(t.endIndex-t.startIndex)||e.startIndex-t.startIndex}function Fr(e){let t=[];return Ce(e,n=>t.push(n)),t}function Tr(e){let t=[],n=o=>{t.push(o);for(let i of o.namedChildren)i!==e&&Je.has(i.type)||n(i)};return n(e),t}function Ce(e,t){t(e);for(let n of e.namedChildren)Ce(n,t)}function le(e){return e.trim().replace(/\s+/gu," ")}function _n(e,t,n=[]){let o=new Map,i=new Map,s=new Map,r=new Set;for(let a of t){if(!a.location||!["source-construct","symbol"].includes(a.kind))continue;let d=a.location.endLine??a.location.line,c=kn(e,a.location.file,a.location.line,d);if(!c){r.add(`State and temporal analysis unavailable for ${a.location.file}:${a.location.line+1}-${d+1}: no supported syntax tree or covering construct.`);continue}for(let l of c.mutations){let u=Ze(a,l.event),f=Br(a,l.resource,l.durabilityClass);if(o.set(u.id,u),o.set(f.id,f),et(i,a,u,"contains-state-effect"),tt(i,{kind:"state-resource",from:u,to:f,semantics:[{family:"state",subtype:l.operation==="delete"?"deletes-resource":"writes-resource",attributes:{operation:l.operation,durabilityClass:l.durabilityClass,resource:l.resource.label,recordIdentity:l.recordIdentity,transactionMembership:"unknown"}}],method:"parser-state-mutation",identity:l.event.label}),l.value&&l.dataSubtype){let m=Ze(a,l.value);o.set(m.id,m),tt(i,{kind:"data-to-state",from:m,to:f,semantics:[{family:"data",subtype:l.dataSubtype,attributes:{operation:l.operation,resource:l.resource.label,recordIdentity:l.recordIdentity,value:l.value.label}}],method:"parser-assignment-value",identity:`${l.value.label} -> ${l.resource.label}`})}}for(let l of c.temporal){let u=Ze(a,l.from),f=Ze(a,l.to);o.set(u.id,u),o.set(f.id,f),et(i,a,u,l.from.kind==="lock"?"contains-lock-scope":"contains-event"),et(i,a,f,"contains-event"),tt(i,{kind:"temporal-order",from:u,to:f,semantics:[{family:"temporal",subtype:l.subtype,context:l.synchronizationScope?{synchronizationScope:l.synchronizationScope}:void 0,attributes:{...l.attributes}}],method:l.subtype==="inside-lock-scope"?"parser-synchronized-scope":"parser-program-order",identity:`${l.from.label} -> ${l.to.label}`})}for(let l of c.unsupported){let u=ue(`${l.family}-unsupported`,a.location.file,String(l.startLine),String(l.endLine),l.reason);o.set(u,{id:u,kind:`${l.family}-unsupported`,label:l.reason,disposition:"unsupported",location:{file:a.location.file,line:l.startLine,endLine:l.endLine},anchorIds:[],attributes:{ownerNodeId:a.id}});let f=ue("edge",`${l.family}-unsupported`,a.id,u);i.set(f,{id:f,kind:`${l.family}-unsupported`,fromNodeId:a.id,toNodeId:u,directed:!0,disposition:"unsupported",semantics:[{family:l.family,subtype:`unresolved-${l.family}-construct`}],evidence:[{method:`parser-${l.family}-construct`,strength:"exact",identity:l.reason,location:{file:a.location.file,line:l.startLine,endLine:l.endLine}}]});let m=ue("frontier",l.family,u);s.set(m,{id:m,kind:l.family,direction:"unresolved",fromNodeIds:[a.id],edgeIds:[f],memberNodeIds:[u],memberCount:1,disposition:"unsupported",reason:l.reason,expansion:null})}}for(let a of t.filter(d=>d.kind==="runtime-boundary-participant")){let d=Xe(a,"protocol"),c=Xe(a,"action"),l=Xe(a,"address")??a.label;!d||!c||!On(d,c)||Bn(o,i,a,{observationId:a.id,action:c,strength:"exact",file:a.location?.file??"",line:a.location?.line??0,address:l,protocol:d,role:Xe(a,"role")??void 0,resolution:"locally-linked"})}for(let a of n){if(!a.protocol||!On(a.protocol,a.action))continue;let d=Ar(t,a.file,a.line,a.ownerShortName??null);if(!d){r.add(`State observation ${a.observationId} at ${a.file}:${a.line+1} has no materialized owner node.`);continue}Bn(o,i,d,a)}return{nodes:[...o.values()],edges:[...i.values()],frontiers:[...s.values()],blindSpots:[...r].sort()}}function Bn(e,t,n,o){let i=kr(o),r={id:ue("runtime-state-event",o.observationId),kind:"runtime-state-event",label:`${o.action} ${i}`,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{action:o.action,protocol:o.protocol??null,modality:o.modality??null,resolution:o.resolution??null}},a=o.protocol==="database"?"external-durable-intent":"external",d={id:ue("runtime-state-resource",o.protocol??"unknown",i),kind:"runtime-state-resource",label:i,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{protocol:o.protocol??null,durabilityClass:a}};e.set(r.id,r),e.set(d.id,d),et(t,n,r,"contains-runtime-state-effect");let c=Pr(o.action);tt(t,{kind:"runtime-state-resource",from:r,to:d,semantics:[{family:"state",subtype:c,context:{crossesRuntimeBoundary:!0,protocol:o.protocol},attributes:{operation:o.action,durabilityClass:a,resource:i,recordIdentity:$r(o),modality:o.modality??null,resolution:o.resolution??null,transactionMembership:"unknown",commitState:o.protocol==="database"?"unknown":null}}],method:`runtime-boundary-${o.strength}`,identity:o.observationId})}function Pr(e){return e==="database.read"?"reads-resource":e==="queue.send"?"enqueues-resource":e==="queue.consume"?"consumes-resource":"writes-resource"}function kr(e){return(e.keyParts?.find(n=>["address","resource"].includes(n.name))?.value??e.address)||e.observationId}function $r(e){return e.keyParts?.find(n=>/^(?:id|key|record)$/u.test(n.name))?.value??null}function On(e,t){return e==="database"&&["database.read","database.write"].includes(t)||e==="queue"&&["queue.consume","queue.send"].includes(t)}function Xe(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function Ar(e,t,n,o){let i=e.filter(r=>r.location?.file===t&&["source-construct","symbol"].includes(r.kind)),s=i.filter(r=>r.location.line<=n&&(r.location.endLine??r.location.line)>=n).sort(Dr)[0];if(s)return s;if(o){let r=i.find(a=>a.label===o||a.label.endsWith(`.${o}`)||a.label.includes(o));if(r)return r}return i.length===1?i[0]:null}function Dr(e,t){let n=(e.location?.endLine??e.location?.line??0)-(e.location?.line??0),o=(t.location?.endLine??t.location?.line??0)-(t.location?.line??0);return n-o}function Ze(e,t){let n=e.location.file;return{id:ue(`program-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`program-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind}}}function Br(e,t,n){let o=e.location.file;return{id:ue("program-resource",o,e.id,t.label,n),kind:"program-resource",label:t.label,disposition:"folded",location:{file:o,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,durabilityClass:n}}}function et(e,t,n,o){let i=ue("edge","program-owner",t.id,n.id,o);e.has(i)||e.set(i,{id:i,kind:"program-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:o}],evidence:[{method:"parser-program-owner",strength:"exact",identity:t.id,location:n.location}]})}function tt(e,t){let n=ue("edge",t.kind,t.from.id,t.to.id,t.semantics[0].subtype);e.set(n,{id:n,kind:t.kind,fromNodeId:t.from.id,toNodeId:t.to.id,directed:!0,disposition:"folded",semantics:t.semantics,evidence:[{method:t.method,strength:"exact",identity:t.identity,location:t.from.location}]})}function ue(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Or=new Set(["control","data","state","temporal"]),nt=new Set(["contains-control","contains-event","contains-lock-scope","contains-state-effect","contains-runtime-state-effect","contains","owns-parameter","owns-runtime-observation"]),Un=new Set(["discriminator-dispatch","result-callback","returns","runtime-handoff","throws"]);function zn(e,t={}){let n=new Map(e.nodes.map(v=>[v.id,v])),o=Gr(e.nodes,t.focusLocations),i=Hr(e.edges,t.focusLocations),s=Wr(e.edges,i),r=new Set(e.paths.flatMap(v=>v.edgeIds)),a=pe(e.anchors.filter(v=>v.status==="matched").flatMap(v=>v.nodeIds)),c=e.edges.filter(qn).filter(v=>_r(v,o,i,r)),l=c.filter(v=>Ur(v,o,i,s,n,r)),u=Kn(a,l,"forward"),f=qr(u,l),m=Kn(f,l,"backward"),p=new Set([...u].filter(v=>m.has(v)));for(let v of a)p.add(v);let b=new Set(l.filter(v=>p.has(v.fromNodeId)&&p.has(v.toNodeId)).map(v=>v.id)),S=new Set(p),w=new Set(b);Kr(c,S,w,o,i);let I=e.frontiers.filter(v=>Qr(v,S)),L=pe(I.filter(v=>v.disposition==="unsupported").map(v=>v.id)),N=pe(e.edges.filter(v=>!qn(v)&&Hn(v)&&Vr(v,S)).map(v=>v.id)),y=pe(I.map(v=>v.id)),E=[];a.length===0&&E.push("No matched anchor node starts the corridor."),f.length===0&&E.push("No proved mechanical outcome is reachable from a matched anchor."),L.length>0&&E.push(`${L.length} unsupported frontier(s) touch the protected corridor.`),N.length>0&&E.push(`${N.length} candidate or unknown edge(s) touch the protected corridor.`);let C=E.length===0?"complete":"incomplete";return{schemaVersion:1,status:C,startNodeIds:a,outcomeNodeIds:f,baseNodeIds:pe([...p]),baseEdgeIds:pe([...b]),nodeIds:pe([...S]),edgeIds:pe([...w]),accountedFrontierIds:y,unresolvedFrontierIds:L,unresolvedEdgeIds:N,coverage:{protectedNodes:S.size,protectedEdges:w.size,baseNodes:p.size,baseEdges:b.size,accountedFrontiers:y.length,unresolvedFrontiers:L.length,unresolvedEdges:N.length},explanation:C==="complete"?"Every proved anchor-to-outcome path is closed over its material causal facts within reported coverage.":E.join(" ")}}function _r(e,t,n,o){return t===null||e.disposition==="emitted"||o.has(e.id)||n?.has(e.id)===!0?!0:(e.semantics??[]).some(i=>{if(i.family==="identity"&&nt.has(i.subtype))return t.has(e.toNodeId);if(i.family==="contract")return t.has(e.fromNodeId)&&t.has(e.toNodeId);if(i.family==="state")return t.has(e.fromNodeId);if(i.family==="data"||i.family==="temporal")return t.has(e.fromNodeId)||t.has(e.toNodeId);if(i.family==="control"){if(Wn(i))return t.has(e.fromNodeId);if(["returns","throws"].includes(i.subtype))return t.has(e.toNodeId);if(i.subtype==="completion-callback")return t.has(e.fromNodeId)||t.has(e.toNodeId)}return!1})}function Kr(e,t,n,o,i){let s=!0;for(;s;){s=!1;for(let r of e)jr(r,t,o,i)&&(n.has(r.id)||(n.add(r.id),s=!0),t.has(r.fromNodeId)||(t.add(r.fromNodeId),s=!0),t.has(r.toNodeId)||(t.add(r.toNodeId),s=!0))}}function jr(e,t,n,o){let i=t.has(e.fromNodeId),s=t.has(e.toNodeId);return!i&&!s?!1:(e.semantics??[]).some(r=>r.family==="identity"?nt.has(r.subtype)&&(s||n===null||n.has(e.toNodeId)):r.family==="contract"?!0:r.family==="state"?i&&(n===null||n.has(e.fromNodeId)):r.family==="temporal"?r.subtype==="lexical-successor"?i&&s:!0:r.family==="data"?s&&(i||n===null||n.has(e.fromNodeId)||o?.has(e.id)===!0):r.family==="control"?Gn(r)||["returns","throws"].includes(r.subtype)&&!s&&n!==null&&!n.has(e.toNodeId)?!1:Un.has(r.subtype)||Wn(r)||r.subtype==="completion-callback":!1)}function qr(e,t){let n=new Set,o=new Map,i=new Map;for(let s of t)!e.has(s.fromNodeId)||!e.has(s.toNodeId)||(o.set(s.fromNodeId,(o.get(s.fromNodeId)??0)+1),i.set(s.toNodeId,(i.get(s.toNodeId)??0)+1),(s.semantics??[]).some(r=>r.family==="state"||r.family==="control"&&Un.has(r.subtype))&&n.add(s.toNodeId));for(let s of e)(i.get(s)??0)>0&&(o.get(s)??0)===0&&n.add(s);return pe([...n])}function Kn(e,t,n){let o=new Map;for(let r of t){let a=n==="forward"?r.fromNodeId:r.toNodeId,d=n==="forward"?r.toNodeId:r.fromNodeId,c=o.get(a)??[];c.push(d),o.set(a,c)}let i=new Set(e),s=[...e];for(;s.length>0;){let r=s.shift();for(let a of o.get(r)??[])i.has(a)||(i.add(a),s.push(a))}return i}function Ur(e,t,n,o,i,s){return(e.semantics??[]).some(r=>e.disposition==="emitted"||s.has(e.id)?!0:r.family==="identity"&&nt.has(r.subtype)?t===null||t.has(e.toNodeId)||o?.has(e.toNodeId)===!0:!Or.has(r.family)||Gn(r)?!1:r.family==="control"&&["returns","throws"].includes(r.subtype)&&t!==null?t.has(e.toNodeId):t===null?!0:r.family==="state"?t.has(e.fromNodeId):r.family==="data"?t.has(e.fromNodeId)||t.has(e.toNodeId)||n?.has(e.id)===!0:r.family==="temporal"?r.subtype==="lexical-successor"?t.has(e.fromNodeId)&&t.has(e.toNodeId):t.has(e.fromNodeId)||t.has(e.toNodeId):r.family==="control"?zr(e,i)&&(t.has(e.fromNodeId)||t.has(e.toNodeId)):!1)}function Gn(e){return e.family==="control"&&["call","discriminator-dispatch","result-callback","runtime-handoff"].includes(e.subtype)}function zr(e,t){let n=t.get(e.fromNodeId),o=t.get(e.toNodeId);if(!n||!o)return!1;let i=jn(n,"ownerNodeId")??(n.kind==="symbol"?n.id:null),s=jn(o,"ownerNodeId")??(o.kind==="symbol"?o.id:null);return i!==null&&i===s}function Gr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>{if(!o.location||o.kind==="parameter")return!1;let i=n.get(o.location.file)??[],s=o.location.endLine??o.location.line;return i.some(r=>r>=o.location.line&&r<=s)}).map(o=>o.id))}function Hr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>o.evidence.some(i=>{if(!i.location)return!1;let s=n.get(i.location.file)??[],r=i.location.endLine??i.location.line;return s.some(a=>a>=i.location.line&&a<=r)})).map(o=>o.id))}function Wr(e,t){return t===null?null:new Set(e.filter(n=>t.has(n.id)).flatMap(n=>[n.fromNodeId,n.toNodeId]))}function jn(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function qn(e){return e.disposition==="excluded"||e.disposition==="unsupported"||!Hn(e)?!1:e.evidence.some(t=>t.strength==="exact"||t.strength==="derived")}function Hn(e){return(e.semantics??[]).some(t=>t.family!=="identity"||nt.has(t.subtype))}function Wn(e){return e.subtype.startsWith("predicate-")||e.subtype.startsWith("loop-")||e.subtype.startsWith("exception-")||e.subtype.startsWith("finally-")||e.subtype.startsWith("handler-")}function Vr(e,t){return t.has(e.fromNodeId)||t.has(e.toNodeId)}function Qr(e,t){return[...e.fromNodeIds,...e.memberNodeIds].some(n=>t.has(n))}function pe(e){return[...new Set(e)].sort()}import{createHash as Yr}from"crypto";var ot=["identity","contract","control","data","state","temporal"],Jr=new Set(ot);function it(e){let t=Fe(e.anchors,"anchor"),n=Fe(e.nodes,"node"),o=Fe(e.edges,"edge"),i=Fe(e.paths??[],"path"),s=Fe(e.frontiers??[],"frontier"),r=new Set(t.map(m=>m.id)),a=new Set(n.map(m=>m.id)),d=new Set(o.map(m=>m.id)),c=e.routeCatalog?{...e.routeCatalog,routes:Fe(e.routeCatalog.routes,"route"),selectedRouteIds:J(e.routeCatalog.selectedRouteIds)}:void 0;for(let m of t)Z(`anchor ${m.id}`,[...m.nodeIds,...m.candidateNodeIds],a,"node");for(let m of n)Z(`node ${m.id}`,m.anchorIds,r,"anchor");for(let m of o){if(Z(`edge ${m.id}`,[m.fromNodeId,m.toNodeId],a,"node"),m.evidence.length===0)throw new Error(`Exploration edge ${m.id} has no evidence source.`);ei(m)}for(let m of i)Z(`path ${m.id}`,[m.fromAnchorId,m.toAnchorId],r,"anchor"),Z(`path ${m.id}`,m.nodeIds,a,"node"),Z(`path ${m.id}`,m.edgeIds,d,"edge");for(let m of s)if(Z(`frontier ${m.id}`,m.fromNodeIds,a,"node"),Z(`frontier ${m.id}`,m.edgeIds,d,"edge"),Z(`frontier ${m.id}`,m.memberNodeIds,a,"node"),m.memberCount!==m.memberNodeIds.length)throw new Error(`Exploration frontier ${m.id} reports ${m.memberCount} member(s) but identifies ${m.memberNodeIds.length}.`);for(let m of c?.routes??[])Z(`route ${m.id}`,m.nodeIds,a,"node"),Z(`route ${m.id}`,m.edgeIds,d,"edge"),Z(`route ${m.id}`,[m.anchorNodeId,m.endpointNodeId],a,"node");c&&Z("route catalog selection",c.selectedRouteIds,new Set(c.routes.map(m=>m.id)),"route");let l=J(e.incompleteReasons??[]),u=l.length===0?"accounted":"incomplete",f=t.reduce((m,p)=>m+p.omittedCandidates,0);return{schemaVersion:1,anchors:t,nodes:n,edges:o,paths:i,frontiers:s,coverage:{status:u,scope:e.scope,nodes:no(n),edges:no(o),matchedAnchors:t.filter(m=>m.status==="matched").length,ambiguousAnchors:t.filter(m=>m.status==="ambiguous").length,missingAnchors:t.filter(m=>m.status==="missing").length,omittedCandidates:f,frontierGroups:s.length,programEdges:Zr(o),blindSpots:J(e.blindSpots??[]),explanation:u==="accounted"?"Every node and edge discovered within the declared query scope is emitted, folded with recoverable identity, explicitly excluded, or reported unsupported.":`The declared query scope is not fully accounted for: ${l.join("; ")}`},completion:oi(u,i,e.scope),...c?{routeCatalog:c}:{}}}function Xr(e){return e.flatMap(t=>ti(t.semantics??[]).map(n=>({id:ni(t.id,n),sourceEdgeId:t.id,sourceKind:t.kind,fromNodeId:t.fromNodeId,toNodeId:t.toNodeId,directed:!0,disposition:t.disposition,evidence:[...t.evidence],family:n.family,subtype:n.subtype,...n.context?{context:{...n.context}}:{},...n.attributes?{attributes:{...n.attributes}}:{}}))).sort((t,n)=>t.id.localeCompare(n.id))}function Zr(e){let t=Xr(e),n=new Set(t.map(r=>r.sourceEdgeId)),o=new Map(ot.map(r=>[r,new Set])),i=new Map(ot.map(r=>[r,new Set])),s=new Map(ot.map(r=>[r,0]));for(let r of t)o.get(r.family).add(r.sourceEdgeId),i.get(r.family).add(r.subtype),s.set(r.family,s.get(r.family)+1);return{sourceEdges:e.length,mappedSourceEdges:n.size,projectedEdges:t.length,unmappedSourceEdges:e.length-n.size,unsupportedSourceEdges:e.filter(r=>r.disposition==="unsupported").length,unmappedKinds:J(e.filter(r=>!n.has(r.id)).map(r=>r.kind)),families:{identity:Re("identity",o,s,i),contract:Re("contract",o,s,i),control:Re("control",o,s,i),data:Re("data",o,s,i),state:Re("state",o,s,i),temporal:Re("temporal",o,s,i)}}}function Re(e,t,n,o){return{sourceEdges:t.get(e)?.size??0,projectedEdges:n.get(e)??0,subtypes:[...o.get(e)??[]].sort()}}function ei(e){let t=new Set;for(let n of e.semantics??[]){if(!Jr.has(n.family))throw new Error(`Exploration edge ${e.id} has unknown program edge family: ${n.family}.`);if(n.subtype.trim().length===0)throw new Error(`Exploration edge ${e.id} has an empty program edge subtype.`);let o=Tt(n);if(t.has(o))throw new Error(`Exploration edge ${e.id} repeats program edge semantic ${o}.`);t.add(o)}}function ti(e){return[...e].sort((t,n)=>Tt(t).localeCompare(Tt(n)))}function Tt(e){return`${e.family}:${e.subtype}`}function ni(e,t){return`program:${encodeURIComponent(e)}:${t.family}:${encodeURIComponent(t.subtype)}`}function oi(e,t,n){return e==="incomplete"||t.some(o=>o.status!=="connected")?{status:"coverage-incomplete",scope:n,explanation:"The declared graph query has an ambiguous, missing, candidate-only, or disconnected anchor relationship."}:t.length>0?{status:"connector-complete",scope:n,explanation:"Every requested anchor pair has a selected path supported by proved repository relationships."}:{status:"frontier-accounted",scope:n,explanation:"Every discovered direction in the declared graph query is emitted or represented by an exact frontier."}}function oo(e,t={}){let n=t.maxSelectedNodes??24;if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`maxSelectedNodes must be a positive safe integer; received ${n}`);let o=new Set(e.anchors.flatMap(g=>[...g.nodeIds,...g.candidateNodeIds])),i=[],s=e.anchors.filter(g=>g.status!=="missing"&&g.nodeIds.length+g.candidateNodeIds.length>0);for(let g=0;g<s.length;g+=1)for(let R=g+1;R<s.length;R+=1){let $=s[g],B=s[R],A=Xn(e,$,B,!1),h=A??Xn(e,$,B,!0);h?(h.nodeIds.forEach(k=>o.add(k)),i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:!A||$.status==="ambiguous"||B.status==="ambiguous"?"candidate":"connected",nodeIds:h.nodeIds,edgeIds:h.edgeIds})):i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:"partial",nodeIds:[],edgeIds:[]})}let r=J(t.routeIds??[]),a=ri(e,r),d=new Set(a.routes.map(g=>g.id)),c=r.filter(g=>!d.has(g));if(c.length>0)throw new Error(`Unknown exploration route id(s): ${c.join(", ")}`);let u=a.routes.filter(g=>r.includes(g.id)).map(g=>({anchorNodeId:g.anchorNodeId,endpointNodeId:g.endpointNodeId,endpointKind:g.endpointKind,endpointPriority:2,nodeIds:[...g.nodeIds].reverse(),edgeIds:[...g.edgeIds].reverse()}));for(let g of u)g.nodeIds.forEach(R=>o.add(R));let f=i.length===0||i.some(g=>g.edgeIds.length>0);f&&eo(e,o,n);let m=to(e,o),p=new Set(t.expandedFrontierIds??[]),b=new Set(m.map(g=>g.id)),S=[...p].filter(g=>!b.has(g)).sort();if(S.length>0)throw new Error(`Unknown exploration frontier id(s): ${S.join(", ")}`);for(let g of m)p.has(g.id)&&g.memberNodeIds.forEach(R=>o.add(R));f&&eo(e,o,n);let w=new Map(u.map(g=>[g.endpointNodeId,g.endpointKind])),I=new Set(u.flatMap(g=>g.nodeIds)),L=new Map;for(let g of u)for(let R=0;R<g.nodeIds.length;R+=1){let $=g.nodeIds[R],B=R;L.set($,Math.max(L.get($)??0,B))}let N=e.nodes.map(g=>{let R=w.get(g.id),$=I.has(g.id)?{upstreamCausalPath:!0,upstreamCausalDistance:L.get(g.id)??0,...R?{upstreamCausalEndpoint:R}:{}}:{};return{...g,attributes:{...g.attributes,...$},disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:o.has(g.id)?"emitted":"folded"}}),y=new Set([...i.flatMap(g=>g.edgeIds),...u.flatMap(g=>g.edgeIds)]),E=e.edges.map(g=>({...g,disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:y.has(g.id)||o.has(g.fromNodeId)&&o.has(g.toNodeId)?"emitted":"folded"})),C=it({anchors:e.anchors,nodes:N,edges:E,paths:i,frontiers:[...e.frontiers.filter(g=>g.disposition!=="folded"),...to({...e,nodes:N,edges:E},o)],scope:e.coverage.scope,blindSpots:e.coverage.blindSpots,incompleteReasons:e.coverage.status==="incomplete"?[e.coverage.explanation]:[],routeCatalog:a}),v=new Set(C.frontiers.flatMap(g=>g.edgeIds)),F=C.edges.filter(g=>g.disposition==="folded"&&!v.has(g.id)).map(g=>g.id);if(F.length>0)throw new Error(`Folded exploration edge(s) are not frontier-accounted: ${F.sort().join(", ")}`);return C}var Vn=10;function ri(e,t=[]){let n=new Map(e.nodes.map(S=>[S.id,S])),o=new Map(e.edges.map(S=>[S.id,S])),i=new Map;for(let S of e.edges){if(!ii(S))continue;let w=i.get(S.toNodeId)??[];w.push(S),i.set(S.toNodeId,w)}for(let S of i.values())S.sort((w,I)=>Number(qe(I))-Number(qe(w))||Jn(I)-Jn(w)||w.fromNodeId.localeCompare(I.fromNodeId)||w.id.localeCompare(I.id));let s=J(e.anchors.filter(S=>S.status==="matched").flatMap(S=>S.nodeIds)),r=new Map,a=new Set,d=(S,w,I)=>{let L=w.nodeIds[w.nodeIds.length-1],N=n.get(L),y=n.get(S);if(!N?.location||!y)return;let E=[...w.nodeIds].reverse(),C=[...w.edgeIds].reverse(),v=new Set(E),F=C.flatMap(A=>{let H=o.get(A);return H?[H]:[]}),g=e.edges.filter(A=>A.disposition!=="excluded"&&A.disposition!=="unsupported"&&(v.has(A.fromNodeId)||v.has(A.toNodeId))),R={id:rt("route",S,L,I,...C),status:"proved",anchorNodeId:S,anchorLabel:y.label,endpointNodeId:L,endpointLabel:N.label,endpointLocation:{...N.location},endpointKind:I,nodeIds:E,edgeIds:C,evidenceStrengths:J(F.flatMap(A=>A.evidence.map(H=>H.strength))),spineEdgeFamilies:Qn(F,!0),relatedEdgeFamilies:Qn(g,!1),crossesRuntimeBoundary:F.some(qe)},$=`${S}\0${L}\0${I}`,B=r.get($);(!B||Yn(R,B)<0)&&r.set($,R)};for(let S of s){n.get(S)?.attributes.publicEntry===!0&&d(S,{nodeIds:[S],edgeIds:[]},"public-entry");let w=[{nodeIds:[S],edgeIds:[]}],I=new Map([[S,0]]);for(let L=0;L<w.length;L+=1){let N=w[L],y=N.nodeIds[N.nodeIds.length-1];N.edgeIds.length>0&&n.get(y)?.location&&n.get(y)?.attributes.publicEntry===!0&&d(S,N,"public-entry");let E=i.get(y)??[];if(N.edgeIds.length>=Vn){E.some(C=>!N.nodeIds.includes(C.fromNodeId))&&a.add(S);continue}for(let C of E){if(N.nodeIds.includes(C.fromNodeId))continue;let v=N.edgeIds.length+1,F=I.get(C.fromNodeId);if(F!==void 0&&F<=v)continue;let g={nodeIds:[...N.nodeIds,C.fromNodeId],edgeIds:[...N.edgeIds,C.id]};if(I.set(C.fromNodeId,v),qe(C)&&n.get(C.fromNodeId)?.location){d(S,g,"runtime-boundary");continue}w.push(g)}}}let c=[...r.values()].sort(Yn),l=new Set(c.map(S=>S.id)),u=J(t.filter(S=>l.has(S))),f=J(c.map(S=>S.anchorNodeId)),m=s.filter(S=>!f.includes(S)),p=[...a].sort(),b=e.coverage.status==="accounted"&&p.length===0?"accounted":"incomplete";return{schemaVersion:1,routes:c,selectedRouteIds:u,coverage:{status:b,scope:"Distinct proved public-entry and runtime-boundary endpoints reachable upstream in the supplied topology.",enumeration:"one-shortest-proved-path-per-endpoint",maximumDepth:Vn,anchorNodeIds:s,anchorsWithRoutes:f,anchorsWithoutRoutes:m,depthLimitedAnchorNodeIds:p,routeCount:c.length,explanation:b==="accounted"?"Every distinct proved upstream public/runtime endpoint in the supplied topology has one stable shortest route.":"Route enumeration is incomplete because the supplied topology has incomplete coverage or a traversal reached the route-depth bound."}}}function Qn(e,t){let n=e.flatMap(o=>o.semantics?.map(i=>i.family)??[]);return t&&e.length>0&&n.length===0&&n.push("control"),J(n)}function Yn(e,t){return e.anchorNodeId.localeCompare(t.anchorNodeId)||e.edgeIds.length-t.edgeIds.length||e.endpointKind.localeCompare(t.endpointKind)||e.endpointNodeId.localeCompare(t.endpointNodeId)||e.id.localeCompare(t.id)}function ii(e){return e.disposition!=="excluded"&&e.disposition!=="unsupported"&&si(e)&&e.evidence.some(t=>["exact","derived","mixed"].includes(t.strength))}function si(e){return qe(e)||e.kind==="boundary-observation"||e.kind==="call"||e.kind==="compiler:call"}function qe(e){return e.kind==="runtime-boundary"||e.kind.startsWith("runtime:")}function Jn(e){let t={exact:5,derived:4,mixed:3,candidate:1,unknown:0};return Math.max(0,...e.evidence.map(n=>t[n.strength]))}function Xn(e,t,n,o){return Zn(e,t,n,o)??Zn(e,n,t,o)}function Zn(e,t,n,o){let i=[...t.nodeIds,...t.candidateNodeIds].sort(),s=new Set([...n.nodeIds,...n.candidateNodeIds]);if(i.some(l=>s.has(l)))return{nodeIds:[i.find(u=>s.has(u))],edgeIds:[]};let r=new Set(e.nodes.filter(l=>l.kind==="structural-region").map(l=>l.id)),a=new Map;for(let l of e.edges)l.disposition==="excluded"||l.disposition==="unsupported"||l.kind==="structural-membership"||r.has(l.fromNodeId)||r.has(l.toNodeId)||l.evidence.every(f=>["candidate","unknown"].includes(f.strength))&&!o||ai(a,l.fromNodeId,l.toNodeId,l.id);for(let l of a.values())l.sort((u,f)=>u.nodeId.localeCompare(f.nodeId)||u.edgeId.localeCompare(f.edgeId));let d=i.map(l=>({nodeId:l,nodeIds:[l],edgeIds:[]})),c=new Set(i);for(let l=0;l<d.length;l+=1){let u=d[l];for(let f of a.get(u.nodeId)??[]){if(c.has(f.nodeId))continue;let m={nodeId:f.nodeId,nodeIds:[...u.nodeIds,f.nodeId],edgeIds:[...u.edgeIds,f.edgeId]};if(s.has(f.nodeId))return m;c.add(f.nodeId),d.push(m)}}return null}function ai(e,t,n,o){let i=e.get(t)??[];i.push({nodeId:n,edgeId:o}),e.set(t,i)}function li(e,t,n){let o=new Map;for(let a of e.edges){let d=o.get(a.fromNodeId)??{incoming:0,outgoing:0},c=o.get(a.toNodeId)??{incoming:0,outgoing:0};d.outgoing+=1,c.incoming+=1,o.set(a.fromNodeId,d),o.set(a.toNodeId,c)}let i=new Set,s=new Map;for(let a of e.edges){let d=t.has(a.fromNodeId),c=t.has(a.toNodeId);if(d===c)continue;let l=d?a.toNodeId:a.fromNodeId,u=d?a.fromNodeId:a.toNodeId,f=e.nodes.find(b=>b.id===l);if(f?.kind==="structural-region")continue;let m=s.get(l)??new Set;m.add(u),s.set(l,m),(/(?:runtime-boundary|external)/u.test(a.kind)||f&&/(?:frontier|external)/u.test(f.kind))&&i.add(l)}let r=[...s].filter(([a,d])=>{if(i.has(a))return!0;let c=o.get(a)??{incoming:0,outgoing:0};return(c.incoming>1||c.outgoing>1)&&d.size>1}).sort(([a,d],[c,l])=>Number(i.has(c))-Number(i.has(a))||l.size-d.size||a.localeCompare(c)).map(([a])=>a);for(let a of r){if(t.size>=n)break;t.add(a)}}function eo(e,t,n){let o=-1;for(;t.size!==o&&t.size<n;)o=t.size,li(e,t,n)}function to(e,t){let n=new Set(e.nodes.filter(r=>!t.has(r.id)&&r.disposition!=="excluded"&&r.disposition!=="unsupported").map(r=>r.id)),o=new Map;for(let r of e.edges){if(!n.has(r.fromNodeId)||!n.has(r.toNodeId))continue;let a=o.get(r.fromNodeId)??new Set,d=o.get(r.toNodeId)??new Set;a.add(r.toNodeId),d.add(r.fromNodeId),o.set(r.fromNodeId,a),o.set(r.toNodeId,d)}let i=[],s=new Set;for(let r of[...n].sort()){if(s.has(r))continue;let a=[],d=[r];s.add(r);for(let c=0;c<d.length;c+=1){let l=d[c];a.push(l);for(let u of[...o.get(l)??[]].sort())s.has(u)||(s.add(u),d.push(u))}i.push(a.sort())}return i.map(r=>{let a=new Set(r),d=e.edges.filter(p=>a.has(p.fromNodeId)||a.has(p.toNodeId)),c=d.filter(p=>a.has(p.fromNodeId)!==a.has(p.toNodeId)),l=J(c.map(p=>a.has(p.fromNodeId)?p.toNodeId:p.fromNodeId)),u=new Set(c.map(p=>a.has(p.toNodeId)?"outgoing":"incoming")),f=J(d.map(p=>p.id)),m=J(c.map(p=>p.kind));return{id:rt("frontier",...r,...f),kind:m.join("+")||"disconnected",direction:u.size===1?[...u][0]:"undirected",fromNodeIds:l,edgeIds:f,memberNodeIds:r,memberCount:r.length,disposition:"folded",reason:c.length>0?"Connected evidence is folded beyond the first edge leaving the selected connector graph.":"Discovered evidence is disconnected from every selected anchor connector under the declared relation scope.",expansion:null}})}function rt(e,...t){let n=Yr("sha256").update(t.join("\0")).digest("hex").slice(0,16);return`${e}:${n}`}function Fe(e,t){let n=[...e].sort((o,i)=>o.id.localeCompare(i.id));for(let o=1;o<n.length;o+=1)if(n[o-1].id===n[o].id)throw new Error(`Duplicate exploration ${t} id: ${n[o].id}`);return n}function Z(e,t,n,o){let i=J(t.filter(s=>!n.has(s)));if(i.length>0)throw new Error(`Exploration ${e} references missing ${o}(s): ${i.join(", ")}`)}function no(e){return{total:e.length,emitted:e.filter(t=>t.disposition==="emitted").length,folded:e.filter(t=>t.disposition==="folded").length,excluded:e.filter(t=>t.disposition==="excluded").length,unsupported:e.filter(t=>t.disposition==="unsupported").length}}function J(e){return[...new Set(e)].sort()}var di=5,ci=12,ui=8,pi=3,ro=8,mi=6,fi=12,io=12,gi=12,yi=2,bi=new Set(["branch","loop","call","await","return","throw","mutation","catch","finally"]),Si=9e3,so=fn,ao=new WeakMap;function Ua(e,t){return So(e,t,"full")}function za(e,t){return So(e,t,"topology")}function hi(e,t,n,o,i,s=!1){let r=e.get(t);if(r)return r.depth=Math.min(r.depth,n),r.primary||=i,r.promoteBoundaryImports||=s,r.origins.add(o),r;let a={file:t,depth:n,primary:i,promoteBoundaryImports:s,origins:new Set([o]),processed:!1};return e.set(t,a),a}function xi(e,t,n,o,i,s,r="none",a=!1){let d=e.get(n.symbol);if(d)return d.depth=Math.min(d.depth,o),d.origins.add(i),s&&d.anchorQueries.add(s),d.referenceScope=Ss(d.referenceScope,r),t(n.relativePath,o,i,!0,a),d;let c={definition:n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),referenceScope:r,processed:!1};return e.set(n.symbol,c),t(n.relativePath,o,i,!0,a),c}function vi(e,t,n,o,i,s,r=!1,a=!0){let d=de(n),c=e.get(d);if(c)return c.depth=Math.min(c.depth,o),c.origins.add(i),s&&c.anchorQueries.add(s),c.reverseCallExpansion||=r,c.traversalEligible||=a,t(n.file,o,i,c.traversalEligible,!0),c;let l={...n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),reverseCallExpansion:r,traversalEligible:a};return e.set(d,l),t(n.file,o,i,a,!0),l}function Ei(e){let{db:t,index:n,pendingRelations:o,addFile:i,addSymbol:s,addSourceConstruct:r,observation:a,depth:d,origin:c}=e;i(a.source.file,d,c,!0,!0),a.owner.file!==a.source.file&&i(a.owner.file,d,`${c}:owner`,!0,!0);let l=fe(t,a.owner.file),u=a.owner.symbol?ye(t,n,a.owner.symbol).matches.find(p=>p.relativePath===a.owner.file):null,f=(u&&!Y(u.symbol)?u:null)??Me(l,a.source.startLine);if(f&&!Y(f.symbol))return s(f,d,c,void 0,"none",!0),f.symbol;a.owner.name&&r({file:a.owner.file,name:a.owner.name,startLine:a.owner.startLine,endLine:a.owner.endLine},d,`${c}:source-owner`,void 0,!0);let m=e.index.definitionsForFile(a.source.file).filter(p=>!!p.leaf&>(t,a.source.file,p.leaf).some(b=>b>=a.source.startLine&&b<=a.source.endLine));if(m.length===1){let p=m[0];s(p,d,`${c}:handler-identifier`,void 0,"none",!0),ne(o,{kind:"runtime-boundary",evidence:"runtime-boundary:handler-identifier",fromFile:a.source.file,fromSymbol:null,toFile:p.relativePath,toSymbol:p.symbol,fromBoundaryParticipant:Pe(a),line:a.source.startLine,strength:"derived"})}return null}function Ii(e){let t=0,n=0,o=0;for(let i of e.searches){let s=ts(e.db,e.index,i,e.boundaryObservationLocations),r=s.filter(l=>ss(l,e.sourceAllowed)),a=!e.opts.fullLiteralTraversal&&(s.length>ci||r.length>ui),d=a?[]:s,c=new Set((a?[]:e.opts.fullLiteralTraversal?r:[...r].sort(ns).slice(0,pi)).map(mo));a&&(n+=1,o+=s.length);for(let l of d){let u=c.has(mo(l)),f=u&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerEndLine!==null;if(e.addFile(l.relativePath,0,`${u?"literal-anchor":"literal-match"}:${i}`,f,f),f&&e.addSourceConstruct({file:l.relativePath,name:l.ownerShortName??`${l.relativePath}:${l.ownerStartLine+1}`,startLine:l.ownerStartLine,endLine:l.ownerEndLine},0,`literal-source-owner:${i}`,i,!0),u&&l.ownerSymbol){let m=ye(e.db,e.index,l.ownerSymbol).matches[0];m&&!Y(m.symbol)&&e.addSymbol(m,0,"literal-owner",i,"all",!0)}e.literalHits.push({query:i,file:l.relativePath,line:l.line,ownerSymbol:l.ownerSymbol,ownerShortName:l.ownerShortName,ownerStartLine:l.ownerStartLine,ownerEndLine:l.ownerEndLine,sourceLine:l.sourceLine.trim(),matchKind:l.matchKind,traversalSeed:u})}e.anchors.push({kind:"literal",query:i,status:s.length>0?"matched":"missing",matchedRegionIds:[],matchingLines:s.length,seedMatchingLines:a?0:c.size,matchOnlyLines:s.length-c.size,eligibleSeedMatchingLines:r.length,materializedMatchingLines:d.length,withheldMatchingLines:a?s.length:0,literalTraversal:a?"withheld-broad":"materialized",representativeMatches:a?as(i,s):void 0,narrowingCommands:a?ds(i,s):void 0,exhaustiveTraversalCommand:a||c.size<r.length?`scip-query system-map --search ${O(i)} --full-literal-traversal`:void 0,seedRegionIds:[],matchOnlyRegionIds:[]})}for(let i of e.symbolQueries){let s=ye(e.db,e.index,i);t+=s.omitted;let r=os(e.db,i),a=s.matches.filter(f=>!Y(f.symbol)),d=r!==null&&a.length===0;d&&e.addSourceConstruct(r,0,"source-construct-anchor",i,!0);let c=d?a:s.matches;for(let f of c)e.addSymbol(f,0,"symbol-anchor",i,"all",!0);let l=d?rs(r):null,u=d?1:s.total;e.anchors.push({kind:"symbol",query:i,status:u===0?"missing":u===1?"matched":"ambiguous",matchedRegionIds:[],symbolCandidates:[...l?[l]:[],...c.map(fs)],totalSymbolCandidates:u,omittedSymbolCandidates:s.omitted})}return{omittedSymbolCandidates:t,broadLiteralAnchors:n,withheldLiteralMatches:o}}function Ci(e){let{db:t,opts:n,mode:o,searches:i,symbolQueries:s,maxDepth:r,maxTopologyCharacters:a,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,workspaces:u,runtimeBoundaries:f,boundaryObservations:m,representedBoundaryLinkIds:p,files:b,symbols:S,sourceConstructs:w,literalHits:I,pendingRelations:L,externalImports:N,anchors:y,omittedSymbolCandidates:E,broadLiteralAnchors:C,withheldLiteralMatches:v,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,sourceAllowed:$}=e,B=new Set(d),A=new Map;for(let x of b.keys())A.set(x,Ue(x,u));let H=[...L.values()].filter(x=>A.has(x.fromFile)&&A.has(x.toFile)).map(x=>({...x,fromRegionId:A.get(x.fromFile).id,toRegionId:A.get(x.toFile).id})).sort(Eo),h=Ms(H),k=new Set(n.expand??[]),M=Is(b,S,I,H,h,A,k),_=new Set([...b.values()].filter(x=>[...x.origins].some(P=>P.startsWith("literal-anchor:")||P==="literal-owner"||P==="symbol-anchor")).map(x=>A.get(x.file).id)),W=Xi(M),q=new Set(M.map(x=>x.id)),U=[...k].filter(x=>!q.has(x)).sort();for(let x of y)if(x.matchedRegionIds=Rs(x,I,S,A),x.kind==="literal"){let P=I.filter(z=>z.query===x.query);x.seedRegionIds=D(P.filter(z=>z.traversalSeed).map(z=>A.get(z.file).id)),x.matchOnlyRegionIds=D(P.filter(z=>!z.traversalSeed).map(z=>A.get(z.file).id))}let K=[...S.values()].filter(x=>!x.processed).length,ae=[...b.values()].filter(x=>x.primary&&!x.processed).length,Le=[...b.values()].filter(x=>!x.primary&&!x.processed).length,ze=[...S.values()].filter(x=>x.processed),we=(f?.frontiers??[]).flatMap(x=>{let P=m.get(x.observationId);return!P&&x.source&&x.action&&x.strength?!B.has("runtime-boundary")||!$(x.source.file)||c==="exact"||!b.has(x.source.file)?[]:[{observationId:x.observationId,action:x.action,strength:x.strength,file:x.source.file,line:x.source.startLine,ownerShortName:x.ownerShortName??null,address:x.address??x.missingKeyParts.join(", "),reason:x.reason}]:!B.has("runtime-boundary")||!P||!$(P.source.file)||c==="exact"&&P.strength!=="exact"||!b.has(P.source.file)?[]:[{observationId:P.id,action:P.action,strength:P.strength,file:P.source.file,line:P.source.startLine,ownerShortName:P.owner.name,address:vo(P),reason:x.reason,protocol:P.protocol,role:P.role,modality:P.modality,resolution:P.resolution,sourceScope:P.sourceScope,keyParts:P.keyParts.map(z=>({name:z.name,value:z.value,evidence:z.evidence}))}]}).sort((x,P)=>x.file.localeCompare(P.file)||x.line-P.line),me=(f?.links??[]).filter(x=>{if(!B.has("runtime-boundary")||c==="exact"&&x.strength!=="exact")return!1;let P=m.get(x.from),z=m.get(x.to);return!!(P&&z&&$(P.source.file)&&$(z.source.file)&&(b.has(P.source.file)||b.has(z.source.file)))}),T=me.filter(x=>x.strength==="exact").length,oe=me.filter(x=>x.strength==="derived").length,re=me.filter(x=>x.strength==="candidate").length,be=f?.links.filter(x=>x.strength==="exact").length??0,Se=f?.links.filter(x=>x.strength==="derived").length??0,ke=f?.links.filter(x=>x.strength==="candidate").length??0,ct=Ns(N,A),ut=E===0?"accounted":"incomplete",Bt=[...C>0?[`${C} broad literal anchor(s) withheld ${v} exact match(es) before graph traversal; representative identities and scoped search commands preserve recovery without treating every textual occurrence as relevant.`]:[],`Literal matches outside the included source scopes (${l.join(", ")}) remain visible as match-only evidence and do not seed traversal.`,f?"Built-in runtime-boundary extractors traverse direct and replayably derived links; heuristic candidates, unsupported frameworks, reflection, generated names, and dependency wiring not recoverable from compiler occurrences or constructor assignments remain disclosed frontiers.":"Runtime-boundary evidence is unavailable for this index; run scip-query reindex with this build to extract supported HTTP, event, registry, and persistence observations.","Reverse references do not recursively expand from discovered callers or callees.","Member calls use compiler occurrences, exact constructor-assigned fields, bounded unique service providers, direct factory-return members, and compiler-resolved object-literal callbacks when available. Ambiguous providers remain candidate frontiers; callback values routed through mutation, reflection, or unsupported dependency containers remain unrepresented.","Literal traversal is bounded to the smallest parser-delimited source construct; parser gaps may reduce an owner to one source line and leave its continuation untraversed.","Schema consumers stay within forward-flow regions; cross-workspace contracts may discover consumers in other workspaces. Add an explicit symbol anchor to widen either scope.",`Traversal stops after depth ${r}; nonzero frontier counts identify evidence that was discovered but not traversed.`,"Region labels are structural path groupings, not inferred runtime or architectural boundaries."],ie=ji({db:t,anchors:y,regions:M,symbolStates:S,sourceConstructStates:w,literalHits:I,relations:H,externalBoundaries:ct,boundaryFrontiers:we,regionForFile:A,closureStatus:ut,omittedSymbolCandidates:E,maxDepth:r,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,blindSpots:Bt,topologyFrontiers:n.topologyFrontiers??[],routeIds:n.routeIds??[],expandedRegionIds:[...k],maxTopologyCharacters:a,fullLiteralTraversal:n.fullLiteralTraversal??!1});if(o==="topology")return ie;let Ot=(n.behaviorFocusLocations?.length??0)>0?new Set([...ie.anchors.flatMap(x=>x.nodeIds),...ie.paths.flatMap(x=>x.nodeIds)]).size:void 0,Ge=dn(t,ie,{focusLocations:n.behaviorFocusLocations,...Ot?{maxSteps:Ot}:{}});pn(t,ie,Ge);let Co=Ri(t,ie,Ge,n.behaviorFocusLocations??[]);ie.corridor=zn(ie,{focusLocations:Co});let _t=un(t,ie,Ge,{sourceAllowed:$,selectionTerms:n.selectionTerms}),Kt=Hi(ie),Lo=Yi(i,s,r,d,c,l,n.fullLiteralTraversal??!1,a,M,h,_,k,Kt),wo=Qi(i,s,r,M.filter(x=>Kt.has(x.id)),_,d,c,l,n.fullLiteralTraversal??!1,a);return{anchors:y,regions:M,regionRelations:h,externalBoundaries:ct,boundaryFrontiers:we,unmatchedExpansions:U,expansion:wo,drilldown:W,presentation:Lo,topology:ie,behavior:Ge,nextAnchors:_t,closure:{status:ut,emitted:{regions:M.length,relations:H.length,runtimeLinks:p.size},withheld:{symbols:K,files:ae+Le,regions:ie.nodes.filter(x=>x.kind==="structural-region"&&x.disposition==="folded").length,drillAnchors:(W?.omittedAnchors??0)+_t.omittedAnchors,literalMatches:v},ambiguous:{anchors:y.filter(x=>x.status==="ambiguous").length,omittedSymbolCandidates:E},external:ct.length,unresolved:we.length,explanation:ut==="accounted"?"Every fact reached under the declared anchors, relations, depth, evidence floor, source scopes, and installed analyzers is accounted for as emitted, withheld, ambiguous, external, or unresolved.":"Some ambiguous symbol candidates were not identified, so the declared query is not fully accounted for."},coverage:{explicitAnchorCount:y.length,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,matchedAnchorCount:y.filter(x=>x.status!=="missing").length,literalSearchesComplete:!0,broadLiteralAnchors:C,withheldLiteralMatches:v,symbolCandidateSetsComplete:E===0,omittedSymbolCandidates:E,maxTraversalDepth:r,frontierSymbols:K,frontierFiles:ae,supportFilesNotTraversed:Le,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,runtimeBoundaryEvidenceAvailable:f!==null,runtimeBoundaryObservations:f?.observations.length??0,runtimeBoundaryExactLinks:T,runtimeBoundaryDerivedLinks:oe,runtimeBoundaryCandidateLinks:re,repositoryRuntimeBoundaryExactLinks:be,repositoryRuntimeBoundaryDerivedLinks:Se,repositoryRuntimeBoundaryCandidateLinks:ke,runtimeBoundaryTraversedLinks:p.size,runtimeBoundaryFrontiers:we.length,referenceExpansionEligibleSymbols:ze.filter(x=>x.referenceScope!=="none").length,referenceExpansionSkippedSymbols:ze.filter(x=>x.referenceScope==="none").length,dynamicDispatchRepresented:f?.links.some(x=>x.joinRule==="carrier.discriminator"&&p.has(x.id))??!1,runtimeGeneratedLinksRepresented:f!==null,regionBoundariesAreStructural:!0,relationFamilies:{"literal-anchor":{evidence:"exact-source",scope:"all indexed documents for each explicit literal",completeWithinScope:!0},reference:{evidence:"compiler-graph",scope:"all cross-file indexed/source-attributed sites for explicit anchors and promoted non-module boundary symbols",completeWithinScope:!0},call:{evidence:"mixed",scope:"static callees plus exact SCIP call occurrences in traversed source ranges, exact constructor-assigned member receivers, and uniquely attributed direct-import member candidates",completeWithinScope:!0},"contract-symbol":{evidence:"compiler-graph",scope:"compiler-resolved symbol identities referenced across inferred workspace boundaries",completeWithinScope:!0},import:{evidence:"compiler-graph",scope:"all indexed or source-resolved imports of traversed primary files",completeWithinScope:!0},"runtime-boundary":{evidence:"exact-source",scope:"direct and mechanically derived links produced by grounded runtime adapters and factorized relation groups",completeWithinScope:!0}},blindSpots:Bt}}}function Li(e,t){let{db:n,relationPolicy:o,sourceConstructs:i,reverseExpandedSourceConstructs:s,pendingRelations:r,reverseFileGraph:a,serviceCallerFilesBySourceConstruct:d,sourceAllowed:c,memberCallTargetsForWholeFile:l,addSymbol:u,addSourceConstruct:f}=e;if(o.has("call")){let m=[...i.values()].filter(p=>p.traversalEligible&&p.reverseCallExpansion&&p.depth<=t&&!s.has(de(p)));for(let p of m){s.add(de(p));let b=ce(n,p.file);if((b?.callables??[]).filter(I=>I.name===p.name&&I.startLine<=p.endLine&&I.endLine>=p.startLine).length===1){let I=(b?.callSites??[]).filter(L=>L.calleeLeaf===p.name&&!L.memberAccess);for(let L of I){let N=t+1,y=Me(fe(n,p.file),L.line),E=null,C=null;if(y&&!Y(y.symbol)){if(y.relativePath===p.file&&y.startLine<=p.endLine&&y.endLine>=p.startLine)continue;u(y,N,"reverse-local-call-owner",void 0,"forward-regions",!0),E=y.symbol}else{let v=Pt(n,p.file,L.line);v&&de(v)!==de(p)&&(C=f(v,N,"reverse-local-call-source-owner",void 0,!0))}!E&&!C||ne(r,{kind:"call",evidence:"ast-callsite",fromFile:p.file,fromSymbol:E,toFile:p.file,toSymbol:null,fromSourceConstruct:C?X(C):void 0,toSourceConstruct:X(p),line:L.line,strength:"derived"})}}let w=new Set([...a.get(p.file)??[],...d.get(de(p))??[],...sn(n,p.file).flatMap(I=>[...a.get(I)??[]])]);for(let I of w){if(!c(I))continue;let N=l(I).targets.filter(y=>y.targetFile===p.file&&y.targetStartLine<=p.endLine&&y.targetEndLine>=p.startLine);for(let y of N){let E=t+1,C=Me(fe(n,I),y.line),v=null,F=null;if(C&&!Y(C.symbol))u(C,E,"reverse-member-call-owner",void 0,"cross-workspace-or-forward",!0),v=C.symbol;else{let g=Pt(n,I,y.line);g&&(F=f(g,E,"reverse-member-call-source-owner",void 0,!0))}!v&&!F||ne(r,{kind:"call",evidence:"ast-service-member-callsite",fromFile:I,fromSymbol:v,toFile:p.file,toSymbol:null,fromSourceConstruct:F?X(F):void 0,toSourceConstruct:X(p),line:y.line,strength:y.strength==="exact"?"exact":"derived"})}}}}}function wi(e,t){let{db:n,index:o,relationPolicy:i,symbols:s,sourceAllowed:r,files:a,workspaces:d,addFile:c,addSymbol:l,addSourceConstruct:u,pendingRelations:f,fileGraph:m,traversalMetrics:p}=e,b=[...s.values()].filter(w=>!w.processed&&w.depth<=t),S=i.has("call")?o.calleeMap(b.map(w=>w.definition),{additive:!1,semantic:!1}):new Map;for(let w of b){w.processed=!0;let I=w.definition;if(w.referenceScope!=="none"&&(i.has("call")||i.has("reference")||i.has("contract-symbol"))){let L=us(n,o,I).filter(y=>r(y.file)&&bs(w,y.file,a,d)),N=new Set(L.flatMap(y=>{if(!(i.has("call")&&ce(n,y.file)?.callSites.some(v=>v.line===y.line&&lo(n,y.file,v,I))===!0)||!y.enclosingSymbol)return[];let C=ye(n,o,y.enclosingSymbol).matches[0];return C&&!Y(C.symbol)?[{owner:C,site:y}]:[]}).sort((y,E)=>{let C=ee(I.relativePath,d).relativeDir,v=ee(y.owner.relativePath,d).relativeDir===C,F=ee(E.owner.relativePath,d).relativeDir===C,g=co(n,y.owner),R=co(n,E.owner),$=y.owner.endLine-y.owner.startLine,B=E.owner.endLine-E.owner.startLine;return Number(F)-Number(v)||R-g||$-B||y.owner.symbol.localeCompare(E.owner.symbol)}).filter((y,E,C)=>C.findIndex(v=>v.owner.symbol===y.owner.symbol)===E).reduce((y,E)=>{if(y.length>=yi)return y;let C=ee(E.owner.relativePath,d).relativeDir;return y.some(v=>v.workspace===C)||y.push({symbol:E.owner.symbol,workspace:C}),y},[]).map(y=>y.symbol));for(let y of L){let E=t+1;c(y.file,E,`reference:${V(I.symbol)}`,!0);let C=i.has("call")&&ce(n,y.file)?.callSites.some(g=>g.line===y.line&&lo(n,y.file,g,I))===!0,v=null,F=null;if(y.enclosingSymbol){let g=ye(n,o,y.enclosingSymbol).matches[0];g&&!Y(g.symbol)&&(l(g,E,"reference-owner",void 0,C&&N.has(g.symbol)?w.referenceScope:"none"),v=g.symbol)}if(!v&&y.line!==null){let g=Pt(n,y.file,y.line);g&&(F=u(g,E,"reference-source-owner",void 0,C))}i.has("reference")&&ne(f,{kind:"reference",evidence:"indexed-or-source-reference",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"mixed"}),C&&ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"derived"}),i.has("contract-symbol")&&ee(y.file,d).relativeDir!==ee(I.relativePath,d).relativeDir&&ne(f,{kind:"contract-symbol",evidence:"compiler-cross-workspace-symbol",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"exact"})}}for(let L of S.get(I.symbolId)??[]){let N=ye(n,o,L.symbol).matches.find(E=>E.relativePath===L.file);if(!N||!r(N.relativePath))continue;if(!(N.relativePath===I.relativePath||(m.get(I.relativePath)??new Set).has(N.relativePath))){p.filteredUnverifiedCallEdges+=1;continue}l(N,t+1,`call:${V(I.symbol)}`,void 0,"none",!0),ne(f,{kind:"call",evidence:L.source,fromFile:I.relativePath,fromSymbol:I.symbol,toFile:N.relativePath,toSymbol:N.symbol,line:null,strength:Vi(L.source)})}}}function Mi(e,t){let{db:n,index:o,relationPolicy:i,files:s,sourceConstructs:r,symbols:a,boundaryObservations:d,boundaryObservationDepths:c,sourceAllowed:l,addSymbol:u,pendingRelations:f,traversalMetrics:m,addSourceConstruct:p,serviceCallerFilesBySourceConstruct:b,reverseFileGraph:S,externalImports:w,addFile:I,workspaces:L}=e,N=[...s.values()].filter(y=>!y.processed&&y.primary&&y.depth<=t);for(let y of N){y.processed=!0;let E=[...r.values()].filter(h=>h.traversalEligible&&h.file===y.file&&h.depth<=t),C=[...a.values()].filter(h=>h.definition.relativePath===y.file&&h.depth<=t).map(h=>{let k=ht(n,y.file,h.definition.startLine);return{startLine:k?.startLine??h.definition.startLine,endLine:k?.endLine??h.definition.endLine}}),v=h=>[...a.values()].filter(k=>k.definition.relativePath===y.file&&k.definition.startLine<=h&&k.definition.endLine>=h).sort((k,M)=>k.definition.endLine-k.definition.startLine-(M.definition.endLine-M.definition.startLine)||k.definition.startLine-M.definition.startLine)[0],F=[...d.values()].filter(h=>h.source.file===y.file&&c.has(h.id)),g=[...E.map(h=>({startLine:h.startLine,endLine:h.endLine})),...F.map(h=>({...st(n,h)}))],R=[...C,...g],$=(ce(n,y.file)?.callSites??[]).filter(h=>R.some(k=>h.line>=k.startLine&&h.line<=k.endLine)),B=new Set;if(i.has("call"))for(let h of R){let k=an(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath))continue;let _=v(M.sourceLine),W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-call:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"call",evidence:"scip-occurrence-callsite",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"}),B.add(`${M.sourceLine}\0${M.calleeLeaf}`)}}if(i.has("reference"))for(let h of R){let k=ln(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath)||B.has(`${M.sourceLine}\0${M.calleeLeaf}`))continue;let _=v(M.sourceLine);if(_?.definition.symbol===M.definition.symbol)continue;let W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-reference:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"reference",evidence:"scip-occurrence-reference",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"})}}let A=i.has("call")?St(n,y.file,{ranges:R,excludeIndexedTargets:!1}):{targets:[],unresolvedCallsites:0};m.unresolvedMemberCallsites+=A.unresolvedCallsites;let H=A.targets.filter(h=>!B.has(`${h.line}\0${h.calleeLeaf}`));m.memberCallCandidateEdges+=H.filter(h=>h.strength!=="exact"&&(h.resolution!=="imported-service-object-member"||(h.resolutionAlternativeCount??0)>1)).length;for(let h of H){let k=(h.resolutionAlternativeCount??1)===1,M=h.targetSymbol?fe(n,h.targetFile).find(K=>K.symbol===h.targetSymbol):void 0,_=M?null:p({file:h.targetFile,name:h.calleeLeaf,startLine:h.targetStartLine,endLine:h.targetEndLine},t+1,`member-call:${y.file}`,void 0,h.resolution==="imported-service-object-member"&&k,k);if(_&&h.serviceFile){let K=de(_),ae=b.get(K)??new Set;for(let Le of S.get(h.serviceFile)??[])ae.add(Le);b.set(K,ae)}M&&u(M,t+1,`member-call:${y.file}`,void 0,"none",!0);let W=E.find(K=>K.startLine<=h.line&&K.endLine>=h.line),q=v(h.line),U=F.find(K=>{let ae=st(n,K);return ae.startLine<=h.line&&ae.endLine>=h.line});ne(f,{kind:"call",evidence:h.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":h.resolution==="factory-callback-member"?"ast-factory-callback-callsite":h.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-member-import-candidate",fromFile:y.file,fromSymbol:q?.definition.symbol??null,toFile:h.targetFile,toSymbol:M?.symbol??null,fromBoundaryParticipant:U?Pe(U):void 0,fromSourceConstruct:W?X(W):void 0,toSourceConstruct:_?X(_):void 0,line:h.line,strength:h.resolution==="imported-service-object-member"?(h.resolutionAlternativeCount??0)===1?"derived":"candidate":h.strength??"candidate"})}for(let h of i.has("import")||i.has("call")?ps(n,y.file):[]){if(!h.fromFile){if(i.has("import")){let M=w.get(h.shortName)??{name:h.shortName,fromFiles:new Set};M.fromFiles.add(y.file),w.set(h.shortName,M)}continue}if(!l(h.fromFile))continue;if(i.has("import")&&(I(h.fromFile,t+1,`import:${y.file}`,!1),ne(f,{kind:"import",evidence:"indexed-or-source-import",fromFile:y.file,fromSymbol:null,toFile:h.fromFile,toSymbol:h.symbol,line:null,strength:"mixed"})),i.has("call")&&$.length>0){let M=(h.source==="compiler"?ye(n,o,h.symbol).matches:Jt(n,h.fromFile,h.importedName)).filter(_=>!Y(_.symbol));for(let _ of M){let W=$.filter(q=>q.calleeLeaf===h.localName).map(q=>q.line);if(W.length!==0){u(_,t+1,`source-call:${y.file}`,void 0,"none",!0);for(let q of W)ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:null,toFile:_.relativePath,toSymbol:_.symbol,line:q,strength:"derived"})}}}if(!y.promoteBoundaryImports||!gs(y.file,h.fromFile,L))continue;let k=ye(n,o,h.symbol);for(let M of k.matches)if(ys(M.relativePath,h.fromFile,L)&&!Y(M.symbol)){let _=ee(y.file,L).relativeDir!==ee(M.relativePath,L).relativeDir;u(M,t+1,`boundary-import:${y.file}`,void 0,_?"cross-workspace-or-forward":"forward-regions")}}}}function Ni(e,t){let{relationPolicy:n,runtimeBoundaries:o,evidenceFloor:i,representedBoundaryLinkIds:s,boundaryObservations:r,sourceAllowed:a,boundaryObservationDepths:d,symbols:c,sourceConstructs:l,addBoundaryObservation:u,pendingRelations:f}=e;for(let m of n.has("runtime-boundary")?o?.links??[]:[]){if(m.strength==="candidate"||i==="exact"&&m.strength!=="exact"||s.has(m.id))continue;let p=r.get(m.from),b=r.get(m.to);if(!p||!b||!a(p.source.file)||!a(b.source.file))continue;let S=yo(p,t,d,c,l),w=yo(b,t,d,c,l);if(S===null&&w===null)continue;let I=t+1,L=u(p,S??I,`runtime-boundary:${m.joinRule}`),N=u(b,w??I,`runtime-boundary:${m.joinRule}`),y=L?null:go(l,p),E=N?null:go(l,b);d.set(p.id,S??I),d.set(b.id,w??I),ne(f,{kind:"runtime-boundary",evidence:`runtime-boundary:${m.joinRule}`,fromFile:p.source.file,fromSymbol:L,toFile:b.source.file,toSymbol:N,fromBoundaryParticipant:Pe(p),toBoundaryParticipant:Pe(b),fromSourceConstruct:y?X(y):void 0,toSourceConstruct:E?X(E):void 0,runtimeBoundaryKey:m.matchedKeyParts.map(C=>`${C.name}=${C.value}`).join(" "),line:p.source.startLine,strength:m.strength}),s.add(m.id)}}function So(e,t,n){let o=$e(t.searches??[]),i=$e(t.symbols??[]),s=$e(t.relations&&t.relations.length>0?t.relations:so),r=s.filter(T=>!so.includes(T));if(r.length>0)throw new Error(`Unsupported system-map relation kind(s): ${r.join(", ")}`);let a=new Set(s),d=t.evidenceFloor??"derived";if(d!=="exact"&&d!=="derived")throw new Error(`Unsupported system-map evidence floor: ${d}`);let c=$e(t.sourceScopes&&t.sourceScopes.length>0?t.sourceScopes:["production"]),l=["production","test","fixture","example","generated","script","unknown"],u=c.filter(T=>!l.includes(T));if(u.length>0)throw new Error(`Unsupported system-map source scope(s): ${u.join(", ")}`);let f=new Set(c),m=T=>f.has(bt(T));if(o.length===0&&i.length===0)throw new Error("system-map requires at least one --search or --symbol anchor.");let p=t.maxDepth??di;if(!Number.isSafeInteger(p)||p<0)throw new RangeError(`maxDepth must be a non-negative safe integer; received ${p}`);let b=t.maxTopologyCharacters??Si;if(!Number.isSafeInteger(b)||b<=0)throw new RangeError(`maxTopologyCharacters must be a positive safe integer; received ${b}`);let S=new Yt(e),{fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N}=hs(e,S),y=new Map((N?.observations??[]).map(T=>[T.id,T])),E=new Set((N?.observations??[]).map(T=>`${T.source.file}\0${T.source.startLine}`)),C=new Set,v=new Map,F=new Map,g=new Map,R=new Map,$=[],B=new Map,A=new Map,H=[],h={filteredUnverifiedCallEdges:0,memberCallCandidateEdges:0,unresolvedMemberCallsites:0},k=new Set,M=new Map,_=new Map,W=T=>{let oe=_.get(T);if(oe)return oe;let re=St(e,T,{excludeIndexedTargets:!1});return _.set(T,re),re},q=(T,oe,re,be,Se=!1)=>hi(F,T,oe,re,be,Se),U=(T,oe,re,be,Se="none",ke=!1)=>xi(g,q,T,oe,re,be,Se,ke),K=(T,oe,re,be,Se=!1,ke=!0)=>vi(R,q,T,oe,re,be,Se,ke),ae=(T,oe,re)=>Ei({db:e,index:S,pendingRelations:B,addFile:q,addSymbol:U,addSourceConstruct:K,observation:T,depth:oe,origin:re}),{omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we}=Ii({db:e,index:S,searches:o,symbolQueries:i,opts:t,boundaryObservationLocations:E,sourceAllowed:m,addFile:q,addSymbol:U,addSourceConstruct:K,literalHits:$,anchors:H}),me={db:e,index:S,relationPolicy:a,evidenceFloor:d,sourceAllowed:m,fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,boundaryObservationDepths:v,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,pendingRelations:B,externalImports:A,reverseExpandedSourceConstructs:k,serviceCallerFilesBySourceConstruct:M,traversalMetrics:h,memberCallTargetsForWholeFile:W,addFile:q,addSymbol:U,addSourceConstruct:K,addBoundaryObservation:ae};for(let T=0;T<p;T+=1)Li(me,T),wi(me,T),Mi(me,T),Ni(me,T);return Ci({db:e,opts:t,mode:n,searches:o,symbolQueries:i,maxDepth:p,maxTopologyCharacters:b,requestedRelationKinds:s,evidenceFloor:d,includedSourceScopes:c,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,literalHits:$,pendingRelations:B,externalImports:A,anchors:H,omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we,filteredUnverifiedCallEdges:h.filteredUnverifiedCallEdges,memberCallCandidateEdges:h.memberCallCandidateEdges,unresolvedMemberCallsites:h.unresolvedMemberCallsites,sourceAllowed:m})}function Ri(e,t,n,o){let i=new Map,s=d=>{i.set(`${d.file}\0${d.line}`,d)};for(let d of o)s(d);let r=new Set(t.anchors.filter(d=>d.status==="matched").flatMap(d=>d.nodeIds));for(let d of n.steps)if(!(!d.location||!r.has(d.nodeId)||(d.behavior?.rawCharacters??1/0)>3e3))for(let c of d.behavior?.lines??[])c.signals.some(l=>bi.has(l))&&s({file:d.location.file,line:c.line,endLine:c.endLine});let a=t.edges.filter(d=>d.disposition==="emitted").flatMap(d=>d.evidence.flatMap(c=>c.location?[c.location]:[]));for(let d of a){s(d);let c=t.nodes.filter(u=>u.location?.file===d.file&&["symbol","source-construct","runtime-boundary-participant"].includes(u.kind)&&u.location.line<=d.line&&(u.location.endLine??u.location.line)>=d.line).sort((u,f)=>(u.location.endLine??u.location.line)-u.location.line-((f.location.endLine??f.location.line)-f.location.line)||u.id.localeCompare(f.id))[0];if(!c?.location)continue;let l=nn(e,d.file,c.location.line,c.location.endLine??c.location.line,[d.line]);for(let u of l)s({file:d.file,line:u.line,endLine:u.endLine})}return[...i.values()].sort((d,c)=>d.file.localeCompare(c.file)||d.line-c.line)}function Fi(e){if(e.ownerStartLine===null||e.ownerStartLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner start line.`);if(e.ownerEndLine===null||e.ownerEndLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner end line.`);return{file:e.file,name:e.ownerShortName??`${e.file}:${e.ownerStartLine+1}`,startLine:e.ownerStartLine,endLine:e.ownerEndLine}}function de(e){return`${e.file}\0${e.startLine}\0${e.endLine}\0${e.name}`}function X(e){return{file:e.file,name:e.name,startLine:e.startLine,endLine:e.endLine}}function lo(e,t,n,o){if(n.calleeLeaf===o.leaf)return!0;let i=Gt(e,t,n.calleeLeaf);return i!==null&&i.importedName===o.leaf&&i.sourcePath!==null&&pt(i.sourcePath,o.relativePath)}function at(e,t){let n=He(ce(e,t.file)?.callables??[],t.startLine);if(n&&n.endLine>=t.endLine)return{file:t.file,name:/^source@\d+$/u.test(n.name)&&!/^source@\d+$/u.test(t.name)?t.name:n.name,startLine:n.startLine,endLine:n.endLine};let o=xo(e,t.file,t.startLine);return o&&o.endLine>=t.endLine?{file:t.file,name:o.name,startLine:o.startLine,endLine:o.endLine}:X(t)}function Te(e){return te("source-construct",e.file,String(e.startLine),String(e.endLine),e.name)}function lt(e,t){let n=Ht(e,t.symbol,t.relativePath),o=new Set(["package-surface-file","transitive-package-surface"]),i=n.filter(r=>!o.has(r)||cn(e,t)),s=i.some(r=>!o.has(r));return{evidence:i,priority:s||Wt(e,t.symbol,t.relativePath)?2:1}}function co(e,t){let n=lt(e,t);return n.evidence.length>0?n.priority:0}function Ti(e,t){let n=fe(e,t.file),o=n.filter(i=>i.startLine<=t.startLine&&i.endLine>=t.startLine).sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine)||i.startLine-s.startLine);for(let i of o){let s=lt(e,i);if(s.evidence.length>0)return s}for(let i of Pi(e,t.file,t.startLine)){let s=n.filter(r=>r.leaf===i.name).sort((r,a)=>Math.abs(r.startLine-i.startLine)-Math.abs(a.startLine-i.startLine)||r.symbol.localeCompare(a.symbol));for(let r of s){let a=lt(e,r);if(a.evidence.length>0)return a}return{evidence:[],priority:0}}return{evidence:[],priority:0}}function Pi(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return[];let i=[],s=At(o,n);for(;s;){if(s.type==="variable_declarator"||s.type==="function_declaration"||s.type==="generator_function_declaration"||s.type==="class_declaration"){let r=s.childForFieldName("name")??s.namedChild(0);(r?.type==="identifier"||r?.type==="type_identifier")&&i.push({name:r.text,startLine:s.startPosition.row})}s=s.parent}return i}function ki(e){return[...new Map([...e.sourceConstructStates.values()].map(t=>at(e.db,t)).map(t=>[de(t),t])).values()].sort((t,n)=>t.file.localeCompare(n.file)||t.startLine-n.startLine||t.endLine-n.endLine)}function $i(e,t){return e.anchors.map((n,o)=>{let i=te("anchor",String(o),n.kind,n.query),s=[...e.symbolStates.values()].filter(l=>l.anchorQueries.has(n.query)).flatMap(l=>{if(!Y(l.definition.symbol))return[ge(l.definition.symbol)];let u=t.filter(f=>f.file===l.definition.relativePath).map(f=>Te(f));return u.length>0?u:[ge(l.definition.symbol)]}),r=[...e.sourceConstructStates.values()].filter(l=>l.anchorQueries.has(n.query)).map(l=>Te(at(e.db,l))),a=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&l.ownerSymbol&&e.symbolStates.has(l.ownerSymbol)).map(l=>ge(l.ownerSymbol)),d=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerStartLine!==void 0&&l.ownerEndLine!==null&&l.ownerEndLine!==void 0).map(l=>Te(at(e.db,Fi(l)))),c=D(n.kind==="symbol"?[...s,...r]:a.length+d.length>0?[...a,...d]:n.seedRegionIds??[]);return{id:i,kind:n.kind,query:n.query,status:n.status,nodeIds:n.status==="ambiguous"?[]:c,candidateNodeIds:n.status==="ambiguous"?c:[],omittedCandidates:n.omittedSymbolCandidates??0}})}function Ai(e){let t=new Map;for(let n of e)for(let o of[...n.nodeIds,...n.candidateNodeIds]){let i=t.get(o)??[];i.push(n.id),t.set(o,i)}return t}function Di(e,t,n){let o=e.relations.flatMap(r=>[r.fromBoundaryParticipant,r.toBoundaryParticipant].flatMap(a=>a?.ownerName?[a]:[])),i=e.regions.map(r=>({id:r.id,kind:"structural-region",label:r.label,disposition:"folded",location:null,anchorIds:D(n.get(r.id)??[]),attributes:{workspace:r.workspace,structuralPath:r.structuralPath,minimumDepth:r.minDepth,files:r.fileCount,symbols:r.symbolCount,expanded:r.expanded}}));for(let r of e.symbolStates.values()){let a=e.regionForFile.get(r.definition.relativePath)?.id;if(!a)throw new Error(`System-map symbol ${r.definition.symbol} has no structural region.`);let d=ge(r.definition.symbol),c=lt(e.db,r.definition);i.push({id:d,kind:"symbol",label:V(r.definition.symbol),disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,depth:r.depth,leaf:r.definition.leaf??V(r.definition.symbol),referenceScope:r.referenceScope,...c.evidence.length>0?{publicEntry:!0,publicEntryPriority:c.priority,publicEntryEvidence:c.evidence.join(",")}:{}}})}for(let r of t){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Source construct ${r.name} has no structural region.`);let d=Te(r),l=o.find(f=>f.file===r.file&&f.line>=r.startLine&&f.line<=r.endLine)?.ownerName??r.name,u=Ti(e.db,r);i.push({id:d,kind:"source-construct",label:l,disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.file,line:r.startLine,endLine:r.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,leaf:l,sourceOwned:!0,...u.evidence.length>0?{publicEntry:!0,publicEntryPriority:u.priority,publicEntryEvidence:u.evidence.join(",")}:{}}})}let s=new Map;for(let r of e.relations)r.fromBoundaryParticipant&&s.set(r.fromBoundaryParticipant.observationId,r.fromBoundaryParticipant),r.toBoundaryParticipant&&s.set(r.toBoundaryParticipant.observationId,r.toBoundaryParticipant);for(let r of[...s.values()].sort((a,d)=>a.observationId.localeCompare(d.observationId))){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Runtime-boundary participant ${r.observationId} has no structural region.`);i.push({id:Dt(r.observationId),kind:"runtime-boundary-participant",label:r.address||r.ownerName||`${r.role} ${r.action}`,disposition:"folded",location:{file:r.file,line:r.line,endLine:r.endLine},anchorIds:[],attributes:{regionId:a,action:r.action,protocol:r.protocol,role:r.role,...r.address?{address:r.address}:{},ownerSymbol:r.ownerSymbol}})}return i}function Bi(e,t,n,o,i,s,r,a,d,c=!1){let l=o?ge(o):null;if(l&&t.has(l)&&!Y(o))return l;let u=i?Dt(i.observationId):null;if(c&&u&&t.has(u))return u;let f=s?Te(at(e,s)):null;if(f&&t.has(f))return f;if(u&&t.has(u))return u;let m=d===null?null:(n.get(a)??[]).filter(p=>p.startLine<=d&&p.endLine>=d).sort((p,b)=>p.endLine-p.startLine-(b.endLine-b.startLine)||p.startLine-b.startLine)[0]??null;return m?Te(m):l&&t.has(l)?l:r}function Oi(e,t,n){let o=new Set(t.map(c=>c.id)),i=se(n,c=>c.file),s=(c,l,u,f,m,p,b=!1)=>Bi(e.db,o,i,c,l,u,f,m,p,b),r=[];for(let c of e.symbolStates.values()){let l=e.regionForFile.get(c.definition.relativePath)?.id;if(!l)continue;let u=ge(c.definition.symbol);r.push({id:te("edge","structural-membership",l,u),kind:"structural-membership",fromNodeId:l,toNodeId:u,directed:!0,disposition:"folded",semantics:Ve("structural-membership"),evidence:[{method:"indexed-definition-file",strength:"exact",identity:c.definition.symbol,location:{file:c.definition.relativePath,line:c.definition.startLine,endLine:c.definition.endLine}}]})}let a=se(e.relations,c=>`${s(c.fromSymbol,c.fromBoundaryParticipant,c.fromSourceConstruct,c.fromRegionId,c.fromFile,c.line,c.kind==="runtime-boundary")}\0${s(c.toSymbol,c.toBoundaryParticipant,c.toSourceConstruct,c.toRegionId,c.toFile,null)}\0${c.kind}`),d=new Set;for(let c of a.values()){let l=c[0],u=s(l.fromSymbol,l.fromBoundaryParticipant,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line,l.kind==="runtime-boundary"),f=s(l.toSymbol,l.toBoundaryParticipant,l.toSourceConstruct,l.toRegionId,l.toFile,null);if(l.kind==="runtime-boundary"&&l.fromBoundaryParticipant){let p=Dt(l.fromBoundaryParticipant.observationId),b=s(l.fromSymbol,void 0,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line);b!==p&&!d.has(p)&&(d.add(p),r.push({id:te("edge","boundary-observation",b,p),kind:"boundary-observation",fromNodeId:b,toNodeId:p,directed:!0,disposition:"folded",semantics:Ve("boundary-observation"),evidence:[{method:"runtime-boundary-observation-owner",strength:l.strength??"unknown",identity:l.fromBoundaryParticipant.observationId,location:{file:l.fromBoundaryParticipant.file,line:l.fromBoundaryParticipant.line,endLine:l.fromBoundaryParticipant.endLine}}]}))}(u===f?t.find(p=>p.id===u):null)?.kind!=="structural-region"&&r.push({id:te("edge",l.kind,u,f),kind:l.kind,fromNodeId:u,toNodeId:f,directed:!0,disposition:"folded",semantics:gn(l),evidence:Wi(c.map(p=>({method:p.evidence,strength:p.strength??"unknown",identity:p.kind==="runtime-boundary"&&p.runtimeBoundaryKey?p.runtimeBoundaryKey:`${p.fromSymbol??p.fromFile} -> ${p.toSymbol??p.toFile}`,location:p.line===null?null:{file:p.fromFile,line:p.line}})))})}return r}function _i(e,t,n){for(let i of e.externalBoundaries){let s=te("external",i.kind,i.name),r=D(i.fromRegionIds);t.push({id:s,kind:i.kind,label:i.name,disposition:"folded",location:null,anchorIds:[],attributes:{}});for(let a of r)n.push({id:te("edge",i.kind,a,s),kind:i.kind,fromNodeId:a,toNodeId:s,directed:!0,disposition:"folded",semantics:Ve("external-import"),evidence:[{method:"indexed-or-source-import",strength:"mixed",identity:`${a} -> ${i.name}`,location:null}]})}let o=[];return e.boundaryFrontiers.forEach((i,s)=>{let r=e.regionForFile.get(i.file)?.id;if(!r)throw new Error(`Runtime-boundary frontier ${i.observationId} has no system-map region.`);let a=te("unsupported","runtime-boundary",i.observationId,String(s)),d=te("edge","runtime-boundary-frontier",r,a);t.push({id:a,kind:"runtime-boundary-frontier",label:i.address,disposition:"unsupported",location:{file:i.file,line:i.line},anchorIds:[],attributes:{action:i.action,strength:i.strength,owner:i.ownerShortName}}),n.push({id:d,kind:"runtime-boundary-frontier",fromNodeId:r,toNodeId:a,directed:!0,disposition:"unsupported",evidence:[{method:"runtime-boundary-extractor",strength:i.strength,identity:i.observationId,location:{file:i.file,line:i.line}}]}),o.push({id:te("frontier","runtime-boundary",i.observationId,String(s)),kind:"runtime-boundary",direction:"unresolved",fromNodeIds:[r],edgeIds:[d],memberNodeIds:[a],memberCount:1,disposition:"unsupported",reason:i.reason,expansion:null})}),o}function Ki(e,t){let n=t.topologyFrontiers.some(p=>p==="frontier:program-facts"),o=oo(e,{expandedFrontierIds:t.topologyFrontiers.filter(p=>p!=="frontier:program-facts"),routeIds:t.routeIds}),i=o.nodes.filter(p=>p.disposition==="emitted"||o.anchors.some(b=>b.status==="matched"&&b.nodeIds.includes(p.id))),s=t.relations.filter(p=>i.some(b=>qi(p,b))),r=t.boundaryFrontiers.filter(p=>i.some(b=>Ui(p,b))),a=Ln(t.db,s,i),d=Mn(t.db,i),c=_n(t.db,i,r),l=[...a.nodes,...d.nodes,...c.nodes].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),u=[...a.edges,...d.edges,...c.edges].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),f=n?null:zi(i,l,u),m=it({anchors:o.anchors,nodes:[...o.nodes,...l],edges:[...o.edges,...u],paths:o.paths,frontiers:[...o.frontiers,...a.frontiers,...d.frontiers,...c.frontiers,...f?[f]:[]],scope:o.coverage.scope,blindSpots:[...o.coverage.blindSpots,...a.blindSpots,...d.blindSpots,...c.blindSpots],incompleteReasons:o.coverage.status==="incomplete"?[o.coverage.explanation]:[],...o.routeCatalog?{routeCatalog:o.routeCatalog}:{}});m.completion=o.completion;for(let p of m.frontiers)p.disposition==="folded"&&(p.id.startsWith("frontier:program-facts:")||(p.expansion=Gi(t,p.id)));return m}function ji(e){let t=ki(e),n=$i(e,t),o=Di(e,t,Ai(n)),i=Oi(e,o,t),s=_i(e,o,i);return Ki(it({anchors:n,nodes:o,edges:i,paths:[],frontiers:s,scope:`explicit anchors; relations ${e.requestedRelationKinds.join(", ")}; depth ${e.maxDepth}; evidence floor ${e.evidenceFloor}; source scopes ${e.includedSourceScopes.join(", ")}`,blindSpots:[...e.blindSpots],incompleteReasons:e.closureStatus==="incomplete"?[`${e.omittedSymbolCandidates} ambiguous symbol candidate(s) were omitted`]:[]}),e)}function qi(e,t){if(e.fromSymbol&&t.id===ge(e.fromSymbol)||e.toSymbol&&t.id===ge(e.toSymbol))return!0;if(!t.location)return!1;let n=t.location.endLine??t.location.line;return t.location.file===e.fromFile&&e.line!==null&&e.line>=t.location.line&&e.line<=n||t.location.file===e.toFile}function Ui(e,t){if(!t.location||t.location.file!==e.file)return!1;let n=t.location.endLine??t.location.line;return e.line>=t.location.line&&e.line<=n||t.label===e.ownerShortName||typeof e.ownerShortName=="string"&&t.label.includes(e.ownerShortName)}function zi(e,t,n){let o=D(t.filter(s=>s.disposition==="folded").map(s=>s.id)),i=D(n.filter(s=>s.disposition==="folded").map(s=>s.id));return o.length===0&&i.length===0?null:{id:te("frontier","program-facts"),kind:"program-facts",direction:"outgoing",fromNodeIds:D(e.map(s=>s.id)),edgeIds:i,memberNodeIds:o,memberCount:o.length,disposition:"folded",reason:"Control, data, state, and temporal facts are folded beneath the selected high-level owners.",expansion:null}}function Gi(e,t){return`scip-query system-map ${[...e.anchors.flatMap(o=>o.kind==="literal"?[`--search ${O(o.query)}`]:[`--symbol ${O(o.query)}`]),`--depth ${e.maxDepth}`,...e.requestedRelationKinds.map(o=>`--relation ${O(o)}`),`--evidence-floor ${O(e.evidenceFloor)}`,...e.includedSourceScopes.map(o=>`--source-scope ${O(o)}`),...e.fullLiteralTraversal?["--full-literal-traversal"]:[],`--topology-characters ${e.maxTopologyCharacters}`,...e.expandedRegionIds.map(o=>`--expand ${O(o)}`),...e.topologyFrontiers.map(o=>`--frontier ${O(o)}`),...e.routeIds.map(o=>`--route ${O(o)}`),`--frontier ${O(t)}`].join(" ")}`}function Hi(e){let t=new Set;for(let n of e.nodes){if(n.disposition!=="emitted")continue;n.kind==="structural-region"&&t.add(n.id);let o=n.attributes.regionId;typeof o=="string"&&t.add(o)}return t}function Wi(e){let t=new Map;for(let n of e){let o=n.location?`${n.location.file}:${n.location.line}`:"";t.set(`${n.method}\0${n.strength}\0${n.identity??""}\0${o}`,n)}return[...t.values()].sort((n,o)=>n.method.localeCompare(o.method)||(n.identity??"").localeCompare(o.identity??"")||(n.location?.file??"").localeCompare(o.location?.file??"")||(n.location?.line??0)-(o.location?.line??0))}function te(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function ge(e){return te("symbol",e)}function Vi(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function Qi(e,t,n,o,i,s,r,a,d,c){let l=[...o].sort((b,S)=>ho(b,S,i)),f=l.slice(0,io).map(b=>b.id),m=l.slice(io).map(b=>b.id),p=[...e.map(b=>`--search ${O(b)}`),...t.map(b=>`--symbol ${O(b)}`),`--depth ${n}`,...s.map(b=>`--relation ${O(b)}`),`--evidence-floor ${O(r)}`,...a.map(b=>`--source-scope ${O(b)}`),...d?["--full-literal-traversal"]:[],`--topology-characters ${c}`,...f.map(b=>`--expand ${O(b)}`)];return{command:f.length===0?null:`scip-query system-map ${p.join(" ")}`,regionCount:f.length,regionIds:f,candidateRegionCount:o.length,omittedRegionIds:m}}function Yi(e,t,n,o,i,s,r,a,d,c,l,u,f){let m=[...d].sort((g,R)=>ho(g,R,l)).filter(g=>!f||f.has(g.id)||u.has(g.id)),p=c.length>0?Math.floor(a*.4):0,b=a-p,S=new Set,w=0;for(let g of m){let R=uo(g);!u.has(g.id)&&S.size>0&&w+R>b||(S.add(g.id),w+=R)}let I=c.filter(g=>S.has(g.fromRegionId)&&S.has(g.toRegionId)).sort(Ji),L=[];for(let g of I){let R=po(g);L.length>0&&w+R>a||(L.push(dt(g)),w+=R)}let N=d.filter(g=>!S.has(g.id)).map(g=>g.id).sort(),y=new Set(L),E=c.filter(g=>!y.has(dt(g))).length,C=d.reduce((g,R)=>g+uo(R),0)+c.reduce((g,R)=>g+po(R),0),v=m.every(g=>S.has(g.id))&&L.length===I.length,F=[...e.map(g=>`--search ${O(g)}`),...t.map(g=>`--symbol ${O(g)}`),`--depth ${n}`,...o.map(g=>`--relation ${O(g)}`),`--evidence-floor ${O(i)}`,...s.map(g=>`--source-scope ${O(g)}`),...r?["--full-literal-traversal"]:[],`--topology-characters ${Math.max(a,C)}`];return{maxCharacters:a,estimatedCharacters:w,totalEstimatedCharacters:C,regionIds:[...S],omittedRegionIds:N,relationKeys:L,omittedRelations:E,complete:v,expansionCommand:v?null:`scip-query system-map ${F.join(" ")}`}}function uo(e){return 120+e.id.length+e.anchorQueries.join(",").length+e.relationKinds.join(",").length+e.notableSymbols.slice(0,2).reduce((t,n)=>t+n.shortName.length+n.file.length,0)}function po(e){return 70+e.fromRegionId.length+e.toRegionId.length+e.kinds.join(",").length+e.evidence.join(",").length}function Ji(e,t){let n=o=>o.kinds.includes("runtime-boundary")?0:o.kinds.includes("contract-symbol")?1:2;return n(e)-n(t)||t.relationCount-e.relationCount||dt(e).localeCompare(dt(t))}function dt(e){return`${e.fromRegionId}\0${e.toRegionId}`}function ho(e,t,n){let o=a=>n.has(a.id)?0:1,i=a=>a.sourceFileCount===0?1:0,s=a=>a.symbolCount+a.literalHitCount>0?0:1,r=a=>[...a.incomingRegionIds,...a.outgoingRegionIds].filter(d=>n.has(d)).length;return o(e)-o(t)||s(e)-s(t)||i(e)-i(t)||e.minDepth-t.minDepth||r(t)-r(e)||t.literalHitCount-e.literalHitCount||e.testFileCount-t.testFileCount||e.label.localeCompare(t.label)}function Xi(e){let t=[],n=new Set;for(let i of e.filter(s=>s.expanded)){for(let d of i.symbols)d.origins.includes("symbol-anchor")&&n.add(d.file);let s=se(i.symbols,d=>d.file),r=se(i.literalHits,d=>d.file),a=[...i.files].sort((d,c)=>es(d,c,s,r));for(let d of a){let c=(s.get(d.file)??[]).sort(mn)[0];if(c){t.push({kind:"symbol",regionId:i.id,file:c.file,line:c.startLine,endLine:c.endLine,label:c.shortName});continue}let l=(r.get(d.file)??[]).sort(Io)[0];l&&t.push({kind:"literal",regionId:i.id,file:l.file,line:l.line,endLine:null,label:l.ownerShortName??l.query})}}let o=Zi(t,n);return{command:o.length===0?null:`scip-query inspect ${o.map(i=>`--at ${O(`${i.file}:${i.line+1}`)}`).join(" ")} --view behavior`,definitionCommand:null,candidateAnchors:t.length,selectedAnchors:o.length,omittedAnchors:t.length-o.length,anchors:o}}function Zi(e,t){let n=[...se(e,r=>r.regionId).values()],o=[],i=new Set,s=Math.min(gi,24);for(let r of e)if(!(!t.has(r.file)||i.has(r.file))&&(o.push(r),i.add(r.file),o.length===s))return o;for(let r=0;o.length<s;r+=1){let a=!1;for(let d of n){let c=d[r];if(c&&(a=!0,!i.has(c.file)&&(o.push(c),i.add(c.file),o.length===s)))break}if(!a)break}return o}function es(e,t,n,o){let i=a=>a.kind==="test"?2:a.kind==="barrel"?1:0,s=a=>(o.get(a.file)??[]).some(d=>d.traversalSeed)?0:1,r=a=>{let d=n.get(a.file)??[];return Math.min(5,...d.map(c=>Ne(c.origins)))};return i(e)-i(t)||s(e)-s(t)||r(e)-r(t)||e.depth-t.depth||e.file.localeCompare(t.file)}function O(e){return`'${e.replaceAll("'","'\\''")}'`}function ts(e,t,n,o){let i=[];for(let s of qt(e,{includeIgnored:!1})){let r=mt(e,s);if(r.length===0)continue;let a=[];for(let l=0;l<r.length;l+=1){let u=r[l]??"";u.includes(n)&&a.push({line:l,sourceLine:u})}if(a.length===0)continue;let d=t.definitionsForFile(s),c=ce(e,s)?.callables??[];for(let{line:l,sourceLine:u}of a){let f=Me(d,l),m=He(c,l),p=f&&!Y(f.symbol)?f:null,b=p?.startLine??m?.startLine??f?.startLine??l,S=p?.endLine??m?.endLine??f?.endLine??l,w=xt(e,s,l,b,S),I=o.has(`${s}\0${l}`),L=!!(p?.isFunctionLike||m);i.push({relativePath:s,line:l,sourceLine:u,ownerSymbol:p?.symbol??null,ownerShortName:p?V(p.symbol):m?.name??(f?V(f.symbol):null),ownerStartLine:w.startLine,ownerEndLine:w.endLine,matchKind:is(u,n),seedPriority:I?0:L?1:2})}}return i}function ns(e,t){let n={"exact-value":0,boundary:1,embedded:2};return e.seedPriority-t.seedPriority||n[e.matchKind]-n[t.matchKind]||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function mo(e){return`${e.relativePath}\0${e.line}`}function Pt(e,t,n){let i=He(ce(e,t)?.callables??[],n)??xo(e,t,n);if(!i)return null;let s=xt(e,t,n,i.startLine,i.endLine);return{file:t,name:i.name,startLine:s.startLine,endLine:s.endLine}}function xo(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return null;let i=At(o,n);for(;i;){if(i.type==="variable_declarator"){let r=i.childForFieldName("name")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1);if(r?.type==="identifier"&&a&&kt(a,n))return{name:r.text,startLine:i.startPosition.row,endLine:i.endPosition.row}}if(i.type==="pair"){let r=i.childForFieldName("key")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1),d=r?.text.replace(/^(?:['"])(.*)(?:['"])$/u,"$1");if(d&&a&&/^[A-Za-z_$][\w$]*$/u.test(d)&&kt(a,n))return{name:d,startLine:i.startPosition.row,endLine:i.endPosition.row}}i=i.parent}let s=ht(e,t,n);return s?{name:`source@${n+1}`,startLine:s.startLine,endLine:s.endLine}:null}function kt(e,t){return["arrow_function","function_expression","generator_function","generator_function_declaration"].includes(e.type)&&e.startPosition.row<=t&&e.endPosition.row>=t?!0:e.namedChildren.some(n=>n.startPosition.row<=t&&n.endPosition.row>=t&&kt(n,t))}function At(e,t){let n=e.namedChildren.filter(o=>o.startPosition.row<=t&&o.endPosition.row>=t).sort((o,i)=>o.endIndex-o.startIndex-(i.endIndex-i.startIndex)||o.startPosition.row-i.startPosition.row)[0];return n?At(n,t):e}function os(e,t){let n=t.match(/^(.+):(\d+)(?:-(\d+))?$/u);if(!n)return null;let o=Ut(e,n[1],{allowMultiple:!1})[0]?.relativePath;if(!o)return null;let i=Math.max(0,Number.parseInt(n[2],10)-1),s=n[3]?Math.max(i,Number.parseInt(n[3],10)-1):i,r=(ce(e,o)?.callables??[]).filter(a=>a.startLine<=i&&a.endLine>=s).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine)||a.startLine-d.startLine)[0];return r?{file:o,name:r.name,startLine:r.startLine,endLine:r.endLine}:null}function rs(e){return{symbol:`source-construct:${e.file}:${e.startLine}:${e.endLine}:${e.name}`,shortName:e.name,relativePath:e.file,startLine:e.startLine,endLine:e.endLine}}function is(e,t){let n=/[\p{L}\p{N}_$]/u,o=e.indexOf(t);for(;o>=0;){let i=e[o-1]??"",s=e[o+t.length]??"";if((i==="'"||i==='"'||i==="`")&&s===i)return"exact-value";if(!n.test(i)&&!n.test(s))return"boundary";o=e.indexOf(t,o+Math.max(1,t.length))}return"embedded"}function $t(e){return We(e)==="test"?!1:!/(?:^|[/._-])(?:fixtures?|mocks?|previews?|demos?|examples?|stories)(?:[/._-]|$)/iu.test(e)}function ss(e,t){return e.matchKind!=="embedded"&&t(e.relativePath)&&(bt(e.relativePath)!=="production"||$t(e.relativePath))}function as(e,t){let n=[...t].sort(ls),o=[],i=new Set;for(let s of n)if(!i.has(s.relativePath)&&(o.push(s),i.add(s.relativePath),o.length>=ro))break;for(let s of n){if(o.length>=ro)break;o.includes(s)||o.push(s)}return o.map(s=>({query:e,file:s.relativePath,line:s.line,ownerSymbol:s.ownerSymbol,ownerShortName:s.ownerShortName,ownerStartLine:s.ownerStartLine,ownerEndLine:s.ownerEndLine,sourceLine:s.sourceLine.trim(),matchKind:s.matchKind,traversalSeed:!1}))}function ls(e,t){let n={"exact-value":0,boundary:1,embedded:2};return n[e.matchKind]-n[t.matchKind]||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||+!$t(e.relativePath)-+!$t(t.relativePath)||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function ds(e,t){let n=new Map;for(let o of t){let i=cs(o.relativePath);n.set(i,(n.get(i)??0)+1)}return[...n].sort(([o,i],[s,r])=>r-i||o.localeCompare(s)).slice(0,mi).map(([o])=>`scip-query search ${O(e)} --scope ${O(o)}`)}function cs(e){let t=e.split("/").filter(Boolean);if(t.length<=1)return e;let n=t.slice(0,-1),o=n.lastIndexOf("src");return o>=0?n.slice(0,Math.min(n.length,o+3)).join("/"):n.slice(0,Math.min(n.length,3)).join("/")}function us(e,t,n){let o=t.callerFileMap([n],{semantic:!1}).get(n.symbolId)??new Set,i=[];for(let s of[...o].sort()){let r=ft(e,s).filter(l=>l.importedName===n.leaf&&l.sourcePath!==null&&pt(l.sourcePath,n.relativePath)),a=new Set;if(r.length>0)for(let l of r)a.add(l.localName??l.importedName);else n.leaf&&a.add(n.leaf);let d=[...new Set([...a].flatMap(l=>gt(e,s,l)))].sort((l,u)=>l-u);if(d.length===0){i.push({file:s,line:null,enclosingSymbol:null});continue}let c=t.definitionsForFile(s);for(let l of d)i.push({file:s,line:l,enclosingSymbol:Me(c,l)?.symbol??null})}return i}function ps(e,t){let n=e.all(`SELECT DISTINCT gs.symbol, def_d.relative_path AS from_file
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
5
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
+
LEFT JOIN (
|
|
7
|
+
SELECT m2.symbol_id, c2.document_id
|
|
8
|
+
FROM mentions m2
|
|
9
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
+
WHERE m2.role = 1
|
|
11
|
+
GROUP BY m2.symbol_id
|
|
12
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
+
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
14
|
+
WHERE imp_d.relative_path = ? AND m.role = 2
|
|
15
|
+
ORDER BY def_d.relative_path, gs.symbol`,t);return n.length>0?n.map(o=>({symbol:o.symbol,shortName:V(o.symbol),importedName:fo(V(o.symbol)),localName:fo(V(o.symbol)),fromFile:o.from_file,source:"compiler"})):ft(e,t).map(o=>{let i=ms(o.importedName,o.localName,o.kind),s=o.localName??o.importedName,r=o.importedName==="default"?s:o.importedName;return{symbol:i,shortName:i,importedName:r,localName:s,fromFile:o.sourcePath,source:"parsed-source"}})}function fo(e){return e.slice(e.lastIndexOf(":")+1).replace(/\(\)$/u,"")||e}function ms(e,t,n){return n==="namespace"&&e==="*"&&t?`* as ${t}`:n==="default"&&t?`default as ${t}`:n==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function ye(e,t,n){let o=yt(e,n);if(!o.match)return{matches:[],total:0,omitted:0};let i=[o.match,...o.candidates.map(r=>yt(e,r.symbol).match)].filter(r=>r!==null),s=new Map;for(let r of i){let a=t.definitionsForFile(r.relativePath).find(d=>d.symbol===r.symbol);a&&s.set(a.symbol,a)}return{matches:[...s.values()],total:o.total,omitted:Math.max(0,o.total-s.size)}}function fs(e){return{symbol:e.symbol,shortName:V(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine}}function ne(e,t){let n=[t.kind,t.fromFile,t.fromSymbol??"",t.toFile,t.toSymbol??"",t.fromBoundaryParticipant?.observationId??"",t.toBoundaryParticipant?.observationId??"",t.fromSourceConstruct?de(t.fromSourceConstruct):"",t.toSourceConstruct?de(t.toSourceConstruct):"",t.runtimeBoundaryKey??"",t.line??""].join("\0");e.set(n,t)}function Pe(e){return{observationId:e.id,action:e.action,protocol:e.protocol,role:e.role,address:vo(e),file:e.source.file,line:e.source.startLine,endLine:e.source.endLine,ownerName:e.owner.name,ownerSymbol:e.owner.symbol}}function st(e,t){let n=mt(e,t.source.file);return rn(e,t.source.file,0,Math.max(0,n.length-1),[t.source.startLine])}function go(e,t){let n=[...e.values()];for(let o of[t.owner,t.source]){let i=n.filter(s=>s.file===o.file&&s.startLine<=o.startLine&&s.endLine>=o.startLine).sort((s,r)=>s.endLine-s.startLine-(r.endLine-r.startLine)||s.startLine-r.startLine)[0];if(i)return i}return null}function yo(e,t,n,o,i){let s=[],r=n.get(e.id);r!==void 0&&r<=t&&s.push(r);for(let a of o.values()){if(a.depth>t)continue;let d=a.definition;bo(d,e)&&s.push(a.depth)}for(let a of i.values())a.depth>t||bo(a,e)&&s.push(a.depth);return s.length>0?Math.min(...s):null}function bo(e,t){let n=e.relativePath??e.file;return[t.owner,t.source].some(o=>n===o.file&&e.startLine<=o.startLine&&e.endLine>=o.startLine)}function Dt(e){return te("runtime-boundary-participant",e)}function gs(e,t,n){let o=ee(e,n),i=ee(t,n);return o.relativeDir!==i.relativeDir?!0:/(?:^|\/)(?:contracts?|schemas?|db\/schema)(?:\/|$)/u.test(t)}function ys(e,t,n){return Ue(e,n).id===Ue(t,n).id}function bs(e,t,n,o){if(e.referenceScope==="all")return!0;let i=Ue(t,o).id;return[...n.values()].some(r=>r.promoteBoundaryImports&&Ue(r.file,o).id===i)?!0:e.referenceScope!=="cross-workspace-or-forward"?!1:ee(t,o).relativeDir!==ee(e.definition.relativePath,o).relativeDir}function Ss(e,t){let n={none:0,"forward-regions":1,"cross-workspace-or-forward":2,all:3};return n[e]>=n[t]?e:t}function hs(e,t){let n=ao.get(e);if(n)return n;let o=t.fileDependencyGraph(),i={fileGraph:o,reverseFileGraph:xs(o),workspaces:vs(t.sourceFiles()),runtimeBoundaries:tn(e)};return ao.set(e,i),i}function xs(e){let t=new Map;for(let[n,o]of e)for(let i of o){let s=t.get(i)??new Set;s.add(n),t.set(i,s)}return t}function ee(e,t){return t.find(n=>e===n.relativeDir||e.startsWith(`${n.relativeDir}/`))??{name:"root",relativeDir:""}}function vs(e){let t=new Set(["apps","packages","services","crates","libs","tools"]),n=new Map;for(let o of e){let i=o.split("/").filter(Boolean);if(i.length<3||!t.has(i[0]))continue;let s=`${i[0]}/${i[1]}`;n.set(s,{name:i[1],relativeDir:s})}return[...n.values()].sort((o,i)=>i.relativeDir.length-o.relativeDir.length)}function Ue(e,t){let n=ee(e,t),i=(n.relativeDir?e.slice(n.relativeDir.length+1):e).split("/").filter(Boolean);i[0]==="src"&&i.shift();let s=Es(i);return{id:`region:${n.relativeDir||"root"}:${s}`,label:`${n.name}:${s}`,workspace:n.name,structuralPath:s}}function Es(e){if(e.length<=1)return"root";let t=e[0],n=e[1];return["components","features","modules"].includes(t)?`${t}/${n}`:t==="db"?`${t}/${n}`:["contracts","routes","services"].includes(t)?t:t==="tests"||t==="__tests__"?"tests":t}function Is(e,t,n,o,i,s,r){let a=se([...e.values()],m=>s.get(m.file).id),d=se([...t.values()],m=>s.get(m.definition.relativePath).id),c=se(n,m=>s.get(m.file).id),l=new Map;for(let m of o)for(let p of new Set([m.fromRegionId,m.toRegionId])){let b=l.get(p)??[];b.push(m),l.set(p,b)}let u=se(i,m=>m.toRegionId),f=se(i,m=>m.fromRegionId);return[...a.entries()].map(([m,p])=>{let b=s.get(p[0].file),S=d.get(m)??[],w=c.get(m)??[],I=l.get(m)??[],L=r.has(m),N=S.map(ws).sort(Fs).slice(0,fi),y=p.filter(E=>We(E.file)==="test").length;return{id:m,label:b.label,workspace:b.workspace,structuralPath:b.structuralPath,minDepth:Math.min(...p.map(E=>E.depth)),fileCount:p.length,sourceFileCount:p.length-y,testFileCount:y,symbolCount:S.length,literalHitCount:w.length,anchorQueries:D([...w.map(E=>E.query),...S.flatMap(E=>[...E.anchorQueries])]),relationKinds:D(I.map(E=>E.kind)),incomingRegionIds:D((u.get(m)??[]).map(E=>E.fromRegionId)),outgoingRegionIds:D((f.get(m)??[]).map(E=>E.toRegionId)),memberCallCandidateRelationCount:I.filter(E=>E.evidence==="ast-member-import-candidate").length,notableSymbols:N,omittedNotableSymbols:Math.max(0,S.length-N.length),expanded:L,files:L?p.map(Cs).sort(Ts):[],symbols:L?S.map(Ls).sort(Ps):[],literalHits:L?[...w].sort(Io):[],relations:L?[...I].sort(Eo):[]}}).sort((m,p)=>m.minDepth-p.minDepth||m.label.localeCompare(p.label))}function Cs(e){return{file:e.file,kind:We(e.file),depth:e.depth,origins:D([...e.origins])}}function Ls(e){return{symbol:e.definition.symbol,shortName:V(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,depth:e.depth,origins:D([...e.origins]),anchorQueries:D([...e.anchorQueries]),referenceExpansion:e.referenceScope!=="none",referenceScope:e.referenceScope}}function ws(e){return{shortName:V(e.definition.symbol),file:e.definition.relativePath,origins:D([...e.origins])}}function Ms(e){return[...se(e.filter(n=>n.fromRegionId!==n.toRegionId),n=>`${n.fromRegionId}\0${n.toRegionId}`).values()].map(n=>({fromRegionId:n[0].fromRegionId,toRegionId:n[0].toRegionId,kinds:D(n.map(o=>o.kind)),relationCount:n.length,fromFiles:D(n.map(o=>o.fromFile)),toFiles:D(n.map(o=>o.toFile)),fromSymbols:D(n.flatMap(o=>o.fromSymbol?[V(o.fromSymbol)]:[])),toSymbols:D(n.flatMap(o=>o.toSymbol?[V(o.toSymbol)]:[])),evidence:D(n.map(o=>o.evidence)),strengths:D(n.map(o=>o.strength??"unknown"))})).sort((n,o)=>n.fromRegionId.localeCompare(o.fromRegionId)||n.toRegionId.localeCompare(o.toRegionId))}function Ns(e,t){return[...e.values()].map(n=>({kind:"external-import",name:n.name,fromRegionIds:D([...n.fromFiles].flatMap(o=>{let i=t.get(o);return i?[i.id]:[]})),fromFiles:D([...n.fromFiles])})).sort((n,o)=>n.name.localeCompare(o.name))}function Rs(e,t,n,o){let i=e.kind==="literal"?t.filter(s=>s.query===e.query).map(s=>s.file):[...n.values()].filter(s=>s.anchorQueries.has(e.query)).map(s=>s.definition.relativePath);return D(i.map(s=>o.get(s)?.id).filter(s=>!!s))}function vo(e){return e.keyParts.map(t=>`${t.name}=${t.value}`).join(" ")}function D(e){return[...new Set(e)].sort()}function Eo(e,t){return e.fromRegionId.localeCompare(t.fromRegionId)||e.toRegionId.localeCompare(t.toRegionId)||e.kind.localeCompare(t.kind)||e.fromFile.localeCompare(t.fromFile)||e.toFile.localeCompare(t.toFile)||(e.line??-1)-(t.line??-1)}function Fs(e,t){return Ne(e.origins)-Ne(t.origins)||e.shortName.localeCompare(t.shortName)}function Ts(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)}function Ps(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)}function Io(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.query.localeCompare(t.query)}export{Ua as a,za as b,dt as c};
|
|
16
|
+
//# sourceMappingURL=chunk-YWO5DDRC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as _}from"./chunk-HLZTEXRA.js";import{f as L,g as A}from"./chunk-JGKUET5J.js";import{a as R}from"./chunk-WIWY3CRX.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as E}from"./chunk-CJZXN4NU.js";import{a as w}from"./chunk-BGBBVSH4.js";import{f as x,h as I}from"./chunk-XRYABF57.js";import{d as N}from"./chunk-N2ZSIIGR.js";import{b as T,c as h}from"./chunk-ODDUPDP7.js";import{a as g}from"./chunk-ZOHS7AQV.js";import{h as S}from"./chunk-FESCRNVV.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=L(e,n);if(!o)return null;let r=A(o),l=r.trim();if(l==="")return!z(o)||!R(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
|
|
2
|
+
//# sourceMappingURL=chunk-Z4CDXYNQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as u}from"./chunk-BOJ5SVE2.js";import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as u}from"./chunk-BOJ5SVE2.js";import{a as t}from"./chunk-W7CXK74K.js";import{a as p,b as h}from"./chunk-E73UNJTF.js";import{a as m}from"./chunk-OSSESPDX.js";import{d as c,h as d}from"./chunk-N2ZSIIGR.js";function C(a,v,y={}){let l=m(a,v);if(!l)return null;let o=y.semantic!==!1,b=h(a,l,{semantic:o,semanticEvidence:t}).filter(e=>d(e.symbol)).slice(0,50),g=u(p(a,l,{limit:50,additive:!0,callableOnly:!0,semantic:o,semanticEvidence:t})),s=b.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source!=="caller-map-inversion"?"reference-candidate":e.callEvidence==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="caller-map-inversion"&&e.callEvidence!=="scip-chunk"?"exact":"candidate",evidenceSource:e.callEvidence??e.source})),r=g.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source}));return{symbol:l.symbol,shortName:c(l.symbol),callers:s.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callees:r.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callerEvidence:s,calleeEvidence:r,coverage:{scope:"indexed-static-call-graph",blindSpots:["unresolved dynamic dispatch and reflection","external or unindexed callees without a resolved symbol identity","SCIP chunk co-occurrence is retained only as candidate call evidence"]}}}export{C as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZF5KHH7C.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{a as we,b as y,c as Re,e as Ve,h as g,k as Ie}from"./chunk-FESCRNVV.js";import{c as E,d as G,e as L,f as Fe,h as Pe,i as Ae}from"./chunk-JWTGMPIT.js";import{J,c as v}from"./chunk-N5B2NILC.js";import{basename as je}from"path";var zt=E("indexed-document-paths",{clearGroups:["whole-project"]});function D(e,t={}){let n=qt(t);return[...zt.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
|
|
2
|
+
FROM documents
|
|
3
|
+
WHERE 1 = 1
|
|
4
|
+
${e.pathExclusionsFor("documents")}
|
|
5
|
+
${o}
|
|
6
|
+
${s}
|
|
7
|
+
ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function qt(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function as(e,t,n){let r=Oe(t);if(!r)return[];let o=e.all(`SELECT relative_path
|
|
8
|
+
FROM documents
|
|
9
|
+
WHERE relative_path = ?
|
|
10
|
+
${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Be(c.relative_path,r)}));if(o.length>0)return o;let s=D(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Be(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];if(n.requirePathMatch)return[];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Be(e,t){let n=Oe(e),r=je(n),o=je(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Oe(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as $e}from"path";var Ht={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function W(e){return Ht[$e(e).toLowerCase()]??null}function pe(e){return $e(e).toLowerCase()===".vue"}import{createRequire as Kt}from"module";import{setFlagsFromString as De}from"v8";import{runInNewContext as Xt}from"vm";var F;function Jt(){if(F!==void 0)return F;let e=globalThis.gc;if(typeof e=="function")return F=e,F;try{De("--expose_gc");let t=Xt("gc");De("--no-expose_gc"),F=typeof t=="function"?t:null}catch{F=null}return F}function Gt(){let e=Jt();return e?(e(),!0):!1}var Zt=512*1024*1024,fe=0;function We(e,t=Gt){!Number.isFinite(e)||e<=0||(fe+=e,!(fe<Zt)&&(fe=0,t()))}var d=Kt(import.meta.url),Z=null,Ue=!1;function Yt(){if(Ue)return null;if(Z)return Z;try{return Z=d("tree-sitter"),Z}catch{return Ue=!0,null}}var Me=new Map,K=new Set;function Qt(e){if(K.has(e))return null;let t=Me.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return K.add(e),null}}catch{return K.add(e),null}return Me.set(e,n),n}var ze=new Map;function en(e){let t=ze.get(e);if(t)return t;let n=Qt(e);if(!n)return null;let r=Yt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return K.add(e),null}return ze.set(e,o),o}function tn(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}var nn=24;function P(e,t){let n=en(e);if(!n)return null;try{let r=tn(n,t);return We(t.length*nn),r}catch{return null}}import{createRequire as rn}from"module";import{posix as me}from"path";var on=L("vue-sfc-units"),sn=rn(import.meta.url),an;function cn(){return an??=sn("@vue/compiler-sfc")}function Xe(...e){return cn().parse(...e)}function V(e,t){let n=Je(t),r=g(e,n);return on.get(e,n,r,()=>de(e,n,r))}function Je(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function ln(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function A(e){return!e||e.body.length===0?0:e.body.split(`
|
|
11
|
+
`).length}function de(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Xe(n,{filename:t})}catch(i){return r.errors.push(He(i)),r}r.errors.push(...o.errors.map(He));let{descriptor:s}=o;return s.template&&(r.template=Y(e,t,"template",s.template)),s.script&&r.scripts.push(qe(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(qe(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>Y(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>Y(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function qe(e,t,n,r){let o=Y(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:ln(o.lang)}}function Y(e,t,n,r){let o=pn(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=un(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
|
|
12
|
+
`).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function un(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Je(me.normalize(me.join(me.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function pn(e){return{...e}}function He(e){return e instanceof Error?e.message:String(e)}function ge(e,t,n){let o=de(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
|
|
13
|
+
`.repeat(i.startLine)}${i.body}`).join(`
|
|
14
|
+
`),startLine:0,language:s}:null}var Q=Fe("ast-trees",{clearGroups:["whole-project","source-file"]});function Ge(e,t){if(pe(t))return fn(e,t);let n=W(t);if(!n)return null;let r=g(e,t);return r?Q.get(e,t,r,()=>P(n,r)):null}function Fs(e,t,n){if(pe(t))return Q.get(e,t,n,()=>{let o=ge(e,t,n);return o?P(o.language,`
|
|
15
|
+
`.repeat(o.startLine)+o.body):null});let r=W(t);return r?Q.get(e,t,n,()=>P(r,n)):null}function fn(e,t){let n=g(e,t);return n?Q.get(e,t,n,()=>{let r=ge(e,t,n);if(!r)return null;let o=`
|
|
16
|
+
`.repeat(r.startLine)+r.body;return P(r.language,o)}):null}function U(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var nt=["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"],mn=new Set(nt),dn=[...nt,"variable_declarator","public_field_definition"],gn=["function_item","function_signature_item"],hn=["function_definition"],Sn=[],Ze=new Set(["arrow_function","function_expression","generator_function"]);function Rs(e){return e==="rust"?gn:e==="python"?hn:e==="typescript"||e==="tsx"||e==="javascript"?dn:Sn}function rt(e,t){let n=xn(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:et(n.functionNode),params:Ke(n.functionNode),paramsEndLine:Ye(n.functionNode),isLiteralPassthrough:tt(n.functionNode,t),branches:0};if(!yn(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:et(e),params:Ke(e),paramsEndLine:Ye(e),isLiteralPassthrough:tt(e,t),branches:0}:null}function ot(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Ke(e){let t=ot(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(U(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function Ye(e){let t=ot(e);return t?t.endPosition.row:e.startPosition.row}function yn(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?mn.has(e):!1}function xn(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Qe(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Qe(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function Qe(e){if(Ze.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>Ze.has(o.type));return r.length===1?r[0]:null}function et(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)U(r)||(n+=1);return n}function tt(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!U(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!U(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(O=>O.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}function Vs(e,t){return e.filter(n=>n.startLine<=t&&n.endLine>=t).sort((n,r)=>n.endLine-n.startLine-(r.endLine-r.startLine)||n.startLine-r.startLine)[0]??null}import{readdirSync as vn}from"fs";import{execFileSync as Nn}from"child_process";import{extname as ee,join as Cn}from"path";var bn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],Ws=[".vue"],st=[".tsx",".jsx"],it=[".vue"],Tn=[...st,...it],kn=new Set(st),_n=new Set(it),at=new Set(bn.map(e=>e.toLowerCase())),Ln=[...at].sort().join(","),ct=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function M(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):at,i=o?[...s].sort().join(","):Ln,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return En.get(e,a,()=>{let c=new Set;if(n)for(let l of D(e,{includeIgnored:!1}))s.has(ee(l).toLowerCase())&&c.add(l);if(r)for(let l of Fn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function Us(e,t={}){let n=!1,r=!1;for(let o of M(e,{extensions:Tn})){if(t.scope&&!o.includes(t.scope))continue;let s=ee(o).toLowerCase();if(n||=kn.has(s),r||=_n.has(s),n&&r)break}return{react:n,vue:r}}var En=E("source-files",{clearGroups:[]});function Fn(e,t){return Pn(e,t)??wn(e,t)}function Pn(e,t){try{let n=Nn("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"]}),r=new Set;for(let o of n.split(`
|
|
17
|
+
`)){let s=o.trim();s&&(An(s)||t.has(ee(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function An(e){return e.split("/").some(t=>ct.has(t))}function wn(e,t){let n=new Set,r=o=>{let s=o?Cn(e,o):e,i;try{i=vn(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!ct.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(ee(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as Bn}from"path";function ne(e,t){let n=Vn(e,t);if(!n)return null;let r=te(n);if(!r)return null;let o=In(n);return{calleeLeaf:r,calleeQualifier:o?Rn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function Rn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function Vn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function In(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function te(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?te(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?te(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?te(t):null}case"super":case"self":case"this":return null;default:return null}}var jn=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function re(e){return e.length<=2||jn.has(e)}var On=[".tsx",".jsx"],lt=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),$n=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),Dn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),Wn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Un=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Mn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),zn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),qn=L("react-component-behavior-profiles"),ut=Re({kind:"react-component-behavior-profiles",invalidation:Ve("react-component-behavior-profiles"),serialize:Gn,deserialize:Zn});function dt(e,t={}){let n=M(e,{extensions:On}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>Se(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Se(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return qn.get(e,n,r,()=>Hn(e,n,r)).map(Jn)}function Hn(e,t,n){let r=Ae(e,t,n),o=ut.read(e,t,r);if(o)return o;let s=Xn(e,t);return ut.write(e,t,r,s),s}function Xn(e,t){let n=Yn(t);if(!n)return[];let r=Ge(e,t);if(!r)return[];let o=Ie(e,t).length;return Qn(r.rootNode,n).filter(i=>i.kind==="hook"||ye(i.bodyNode)).map(i=>{let a=ir(i.bodyNode),c=pr(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function Jn(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Gn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Zn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Kn(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Kn(e){if(!we(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:O,hookNames:le,requestNames:ue,stateNames:m,effectNames:C,handlerNames:$}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!oe(o)||!oe(s)||!oe(i)||!oe(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(O),hookNames:y(le),requestNames:y(ue),stateNames:y(m),effectNames:y(C),handlerNames:y($)};return Object.values(S).some(Mt=>Mt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function oe(e){return typeof e=="number"&&Number.isFinite(e)}function Yn(e){let t=Bn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:W(e)}function Qn(e,t){let n=[],r=new Set,o=s=>{let i=er(s);if(i&&(!or(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function er(e){if(e.type==="class_declaration"){let s=he(e);if(!s||!/^[A-Z]/.test(s))return null;let i=tr(e);return!i||!nr(e)&&!ye(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=he(e);return!s||!pt(s)?null:{name:s,kind:ft(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=z(t);if(!r||!n||!pt(r))return null;let o=rr(n);return o?{name:r,kind:ft(r),node:e,bodyNode:o}:null}function tr(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function nr(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function pt(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function ft(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function rr(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=sr(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function or(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function he(e){return z(e.childForFieldName("name")??e.namedChild(0))}function sr(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function ye(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(ye)}function ir(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?ar(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?cr(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function ar(e,t){let n=lr(e),r=!1;if(n){let o=mt(n),s=o==="Fragment"||o==="React.Fragment";r=hr(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=ur(o);if(!s)continue;let i=mt(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else zn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(gt(o))}function cr(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(gt(e)),ht(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Sr(n))re(r)||t.tokens.add(`binding:${r}`)}function gt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function ht(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(ht)}function lr(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function ur(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function pr(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=ne(o,t);s&&fr(s.calleeLeaf,n)}else if(o.type==="variable_declarator")dr(o,n);else if(o.type==="function_declaration"){let s=he(o);s&&St(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function fr(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!lt.has(e)&&!Wn.has(e)&&t.tokens.add(`hook:${e}`)),lt.has(e)&&t.tokens.add(`react-hook:${e}`),$n.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),Dn.has(e)&&t.tokens.add(`state-hook:${e}`),mr(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function mr(e){if(Un.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function dr(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>z(a)),i=z(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=z(n);o&&St(o,t)}function St(e,t){let n=gr(e);!n||!Mn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function gr(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function hr(e){return/^[A-Z]/.test(e)||e.includes(".")}function mt(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function z(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Sr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}var yr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),xr=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),vr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),Nr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),Cr=new Set(["catch","for","function","if","return","switch","while"]);function ie(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=A(n),n.external&&(t.externalLineCount+=A(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(..._r(n));let r=P(n.astLanguage,n.body);r?Tr(n,r.rootNode,t):kr(n,t)}return br(t),t.externalScriptPaths=xt(t.externalScriptPaths),t}function br(e){e.composables=I(e,"composable"),e.stores=I(e,"store"),e.reactivity=I(e,"reactivity"),e.lifecycle=I(e,"lifecycle"),e.requests=I(e,"request"),e.macros=I(e,"macro")}function I(e,t){return xt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function Tr(e,t,n){let r=new Set,o=new Set,s=i=>{let a=rt(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=ne(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:yt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function kr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||Cr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+se(e.body,n.index??0),categories:yt(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+se(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+se(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function _r(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+se(e.body,n.index??0);for(let i of Lr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function Lr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function yt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),yr.has(e)&&t.push("reactivity"),xr.has(e)&&t.push("lifecycle"),vr.has(e)&&t.push("request"),Nr.has(e)&&t.push("macro"),t}function se(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function xt(e){return[...new Set(e)].sort()}import{createRequire as Er}from"module";function vt(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Fr=L("vue-template-facts"),Pr=Er(import.meta.url),Ar;function q(){return Ar??=Pr("@vue/compiler-dom")}var wr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Rr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Vr=new Set(["div","span","template"]),Ir=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function ae(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Fr.get(e,n,r,()=>jr(n,V(e,n).template))}function jr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=q().parse(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return Ct(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function Ct(e,t,n,r){for(let o of e)if(o.type===q().NodeTypes.ELEMENT)Br(o,t,n,r),Ct(o.children,t,n,r);else if(o.type===q().NodeTypes.INTERPOLATION){r("interpolation");let s=xe(o.content);s&&bt(s,t,o.loc.start.line,n,r)}}function Br(e,t,n,r){let o=zr(e.tag),s={tag:e.tag,normalized:o,kind:Mr(e),startLine:j(t,e.loc.start.line),endLine:j(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),Vr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)Or(i,t,n,r)}function Or(e,t,n,r){if(e.type===q().NodeTypes.ATTRIBUTE){let a=e.value?.content??null,c=Nt("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Dr(e),s=xe(e.exp),i=Nt($r(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&bt(s,t,e.loc.start.line,n,r)}function Nt(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:j(r,o),endLine:j(r,s)}}function $r(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Dr(e){let t=xe(e.arg);return t||e.name}function xe(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function bt(e,t,n,r,o){for(let s of Wr(e)){let i={name:s,startLine:j(t,n),endLine:j(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function Wr(e){let t=new Set,n=Ur(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];Ir.has(s)||re(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Ur(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Mr(e){let t=e.tag;return e.tagType===q().ElementTypes.COMPONENT?"component":wr.has(t)?"builtin":Rr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function zr(e){return vt(e,/[-_:]/)}function j(e,t){return e+Math.max(0,t-1)}import{createRequire as to}from"module";import{existsSync as R}from"fs";import{basename as kt,dirname as h,extname as T,join as x,relative as w,resolve as f,sep as no}from"path";import{existsSync as Ne,readdirSync as qr,statSync as Hr}from"fs";import{join as B,relative as Xr}from"path";function Tt(e){let t=Jr(e)??Yr(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Qr(e,o)){if(r.has(s))continue;r.add(s);let i=eo(e,s);i&&n.push(i)}return n}function Jr(e){let t=B(e,"pnpm-workspace.yaml");if(!Ne(t))return null;try{return Gr(J(t,"pnpm workspace manifest"))}catch{return null}}function Gr(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Zr(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Kr(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Zr(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Kr(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Yr(e){let t=B(e,"package.json");if(!Ne(t))return null;try{let n=JSON.parse(J(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Qr(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=B(e,t);return ve(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=B(e,r||".");return ve(s)?qr(s).map(i=>B(s,i,o)).filter(ve):[]}function ve(e){try{return Hr(e).isDirectory()}catch{return!1}}function eo(e,t){let n=B(t,"package.json");if(!Ne(n))return null;try{let r=JSON.parse(J(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Xr(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var ro=G("indexed-paths",{clearGroups:[]}),oo=G("indexed-path-digest",{clearGroups:[]}),so=E("tsconfig-alias-config",{clearGroups:["whole-project"]}),io=E("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),ao=to(import.meta.url),H;function co(){if(H!==void 0)return H;try{H=ao("typescript")}catch{H=null}return H}var lo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],uo=G("workspace-packages",{clearGroups:["whole-project"]}),X=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],_t=[".py",".pyi"],Lt=[".java",".scala",".kt",".kts"],Et=[".rs"],Ft=[".rb"],Pt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],At=[".cs",".vb"],wt=[".dart"],Rt=[".php"],ce=[".clj",".cljs",".cljc"],po=new Set(X),Ce=new Set(_t),Vt=new Set(Lt),be=new Set(Et),Te=new Set(Ft),It=new Set(Pt),jt=new Set(At),ke=new Set(wt),Bt=new Set(Rt),Ot=new Set(ce),fo=[{extensions:X,lookup:po},{extensions:_t,lookup:Ce},{extensions:Lt,lookup:Vt},{extensions:Et,lookup:be},{extensions:Ft,lookup:Te},{extensions:Pt,lookup:It},{extensions:At,lookup:jt},{extensions:wt,lookup:ke},{extensions:Rt,lookup:Bt},{extensions:ce,lookup:Ot}];function k(e,t){return t.has(T(e).toLowerCase())}function mo(e){return k(e,Ce)}function go(e){return k(e,Vt)}function ho(e){return k(e,be)}function So(e){return k(e,Te)}function yo(e){return k(e,It)}function xo(e){return k(e,jt)}function Fi(e){return T(e).toLowerCase()===".vb"}function vo(e){return k(e,ke)}function No(e){return k(e,Bt)}function Co(e){return k(e,Ot)}function bo(e){let t=T(e).toLowerCase();for(let n of fo)if(n.lookup.has(t))return n.extensions;return X}function To(e){return go(e)||xo(e)||No(e)}function $t(e,t,n){return mo(t)?Bo(e,t,n):ho(t)?Oo(e,t,n):So(t)?$o(e,t,n):yo(t)?Do(e,t,n):To(t)?Wo(e,n.replace(/\\/g,"."),bo(t)):vo(t)?Uo(e,t,n):Co(t)?Mo(e,n):ko(e,t,n)}function ko(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return _o(e,t,n)??Eo(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of Le(o)){let a=v(w(e.config.projectRoot,i));if(s.has(a)||R(i))return a}return v(w(e.config.projectRoot,o))}function _o(e,t,n){let r=Vo(e,t);if(!r)return null;let o=_(e);for(let s of Lo(r,n)){let i=f(r.baseUrl,s);for(let a of Le(i)){let c=v(w(e.config.projectRoot,a));if(o.has(c)||R(a))return c}}return null}function Lo(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function Eo(e,t){let n=Po(Fo(e),t);if(!n)return null;let r=_(e);for(let o of Ao(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of Le(s)){let a=v(w(e.config.projectRoot,i));if(r.has(a)||R(i))return a}}return null}function Fo(e){return uo.get(e,()=>Tt(e.config.projectRoot))}function Po(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function Ao(e){let t=[],n=wo(e.pkg.exports,e.subpath);if(n){let r=Ro(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function wo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Dt(e[n])}function Dt(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=Dt(t[n]);if(r)return r}return null}function Ro(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function Vo(e,t){let n=v(h(t));return io.get(e,n,()=>Io(e,n))}function Io(e,t){let n=co();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+no);){for(let i of lo){let a=x(o,i);if(!R(a))continue;let c=so.get(e,a,()=>jo(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function jo(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function Bo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of zo(o)){let i=v(w(e.config.projectRoot,s));if(r.has(i)||R(s))return i}return null}function Oo(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),_e(e,qo(s))}function $o(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return _e(e,Ho(o))}function Do(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return _e(e,o)}function Wo(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>kt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(T(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Uo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Xo(s)){let a=v(w(e.config.projectRoot,i));if(r.has(a)||R(i))return a}return null}function Mo(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of ce){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ce){let s=[...r].find(i=>kt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function zo(e){let t=T(e);return Ce.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function _e(e,t){let n=_(e);for(let r of t){let o=v(w(e.config.projectRoot,r));if(n.has(o)||R(r))return o}return null}function qo(e){let t=T(e);return be.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Ho(e){let t=T(e);return Te.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Xo(e){let t=T(e);return ke.has(t)?[e]:[`${e}.dart`,e]}function Le(e){let t=T(e),n=new Set;if(t){n.add(e);for(let r of X)n.add(e.slice(0,-t.length)+r)}else for(let r of X)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return ro.get(e,()=>new Set(D(e,{includeIgnored:!1}).map(v)))}function Pi(e){return oo.get(e,()=>Pe([..._(e)].sort().join(`
|
|
18
|
+
`)))}var Jo=new Set(["in","key","of"]),Go=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Zo=L("vue-component-behavior-profiles");function Wt(e,t={}){let n=M(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Ee(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Ee(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=Zo.get(e,n,r,()=>Ko(e,n,r));return Qo(o)}function Ko(e,t,n){let r=V(e,t),o=ae(e,t),s=ie(r),i=ns(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,$)=>$.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,$)=>$.indexOf(m)===C).sort(),l=n?n.split(`
|
|
19
|
+
`).length:0,p=A(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+A(C),0),O=r.customBlocks.reduce((m,C)=>m+A(C),0),{lines:le,paths:ue}=Yo(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:ts(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:O,delegatedComposableLines:le,delegatedComposablePaths:ue}}function Yo(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=$t(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
20
|
+
`).length:0)},0),paths:o}}function Qo(e){let t=es(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function es(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function ts(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Go.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function ns(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of rs(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Ut(n.value))t.add(r);return[...t].sort()}function rs(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Ut(t[1]??""):[]}function Ut(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Jo.has(r)||t.push(r)}return t}function qi(e){return{capability:(t,n)=>os(t,n),reactProfiles:(t={})=>dt(e,t),reactProfilesForFile:t=>Se(e,t),vueProfiles:(t={})=>Wt(e,t),vueProfileForFile:t=>Ee(e,t),vueTemplateFacts:t=>ae(e,t),vueScriptFacts:t=>ie(V(e,t))}}function os(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{D as a,as as b,Tt as c,Qr as d,X as e,_t as f,Lt as g,Et as h,Ft as i,Pt as j,At as k,wt as l,Rt as m,ce as n,Fi as o,bo as p,$t as q,Bo as r,Oo as s,$o as t,Do as u,Wo as v,Uo as w,Mo as x,Pi as y,W as z,pe as A,Gt as B,ge as C,Ge as D,Fs as E,ne as F,te as G,Rs as H,rt as I,Vs as J,vt as K,Ws as L,ct as M,M as N,Us as O,qi as P};
|
|
21
|
+
//# sourceMappingURL=chunk-ZOHS7AQV.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-HOENASQM.js";import{a as d,c as m}from"./chunk-DRENNWRG.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
|
|
2
2
|
WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-ZTI4SBFV.js.map
|