scip-query 0.20.0 → 0.21.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 +69 -0
- package/README.md +255 -884
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-CI3O6PQG.js +2 -0
- package/dist/call-graph-6QTUTXH7.js +2 -0
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
- package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
- package/dist/chunk-26CT72HM.js +2 -0
- package/dist/{chunk-7PIO7NKH.js → chunk-2COFMIVK.js} +2 -2
- package/dist/chunk-2H4IAJHO.js +2 -0
- package/dist/chunk-2I3RSUWX.js +16 -0
- package/dist/chunk-2RP27XLR.js +2 -0
- package/dist/chunk-2ZBMOQGG.js +3 -0
- package/dist/{chunk-HX4GQPZP.js → chunk-32A42O5B.js} +3 -3
- package/dist/chunk-35ELD3RM.js +2 -0
- package/dist/chunk-35IW3P4H.js +2 -0
- package/dist/{chunk-DQGFVPUV.js → chunk-3653GTR7.js} +3 -3
- package/dist/chunk-3EX7DNBC.js +2 -0
- package/dist/chunk-3FQ3KMCD.js +2 -0
- package/dist/{chunk-5E4WNAVD.js → chunk-3PII3JI5.js} +2 -2
- package/dist/chunk-3TNRNKAT.js +2 -0
- package/dist/chunk-3VLJ2DCA.js +2 -0
- package/dist/{chunk-XSRF6Q77.js → chunk-46JLFIGA.js} +2 -2
- package/dist/chunk-4DCKBY6T.js +5 -0
- package/dist/chunk-4EXFZP6H.js +2 -0
- package/dist/chunk-4IIMPWMR.js +29 -0
- package/dist/chunk-4ILHWBYF.js +2 -0
- package/dist/chunk-4N6QSEMZ.js +10 -0
- package/dist/chunk-4OE2JO6I.js +2 -0
- package/dist/{chunk-7BAVHKMJ.js → chunk-4S4DF62J.js} +9 -9
- package/dist/chunk-4UUCUASK.js +554 -0
- package/dist/chunk-5236NQV3.js +2 -0
- package/dist/chunk-54EOGFBR.js +2 -0
- package/dist/{chunk-LY4WC4AD.js → chunk-5H7IWVXJ.js} +2 -2
- package/dist/chunk-5IZTXSOL.js +117 -0
- package/dist/{chunk-AZJQQKDD.js → chunk-5SE323LF.js} +2 -2
- package/dist/chunk-5ZJH6DDE.js +2 -0
- package/dist/chunk-63MBA7EG.js +3 -0
- package/dist/chunk-6BJ7SOY7.js +2 -0
- package/dist/chunk-6GJAP4OE.js +2 -0
- package/dist/chunk-6IEVHGWG.js +26 -0
- package/dist/chunk-6SWA6B24.js +7 -0
- package/dist/chunk-6T7H2AFY.js +3 -0
- package/dist/chunk-73Z33VFI.js +4 -0
- package/dist/chunk-7COHFNJK.js +38 -0
- package/dist/chunk-7HU2IJ2T.js +3 -0
- package/dist/chunk-7IOAZRVL.js +60 -0
- package/dist/chunk-7KCZELVM.js +2 -0
- package/dist/chunk-7PPYXENX.js +2 -0
- package/dist/chunk-7TWP3MCP.js +2 -0
- package/dist/chunk-AA7K3XLM.js +21 -0
- package/dist/chunk-AJVMVE7X.js +7 -0
- package/dist/chunk-ANWGXPPN.js +4 -0
- package/dist/chunk-APLKXICZ.js +3 -0
- package/dist/{chunk-JDOEX4E6.js → chunk-AQDWTCDC.js} +2 -2
- package/dist/chunk-AUP6YI5M.js +2 -0
- package/dist/chunk-B7ECWJAZ.js +2 -0
- package/dist/{chunk-ZHXX42OH.js → chunk-BATIVRU2.js} +4 -4
- package/dist/chunk-BBEDPVPB.js +4 -0
- package/dist/chunk-BBWPOMGU.js +2 -0
- package/dist/chunk-BD6CV7PN.js +2 -0
- package/dist/{chunk-XKWKXZKW.js → chunk-BHE44MHT.js} +2 -2
- package/dist/chunk-BOJ5SVE2.js +2 -0
- package/dist/chunk-BZYSGZRK.js +2 -0
- package/dist/chunk-CA5RE6H7.js +2 -0
- package/dist/chunk-CKDOY6JA.js +2 -0
- package/dist/chunk-CN2WGM7D.js +2 -0
- package/dist/chunk-COTMS5KM.js +3 -0
- package/dist/chunk-CSDDOUA4.js +3 -0
- package/dist/chunk-CT5SI2I4.js +2 -0
- package/dist/chunk-D5EKVZPI.js +2 -0
- package/dist/{chunk-FKSELJQF.js → chunk-D5W4UZY5.js} +2 -2
- package/dist/{chunk-RUJURYSV.js → chunk-DEUGHURX.js} +2 -2
- package/dist/chunk-DHKBIOXF.js +7 -0
- package/dist/chunk-DMQ7ZKJG.js +81 -0
- package/dist/chunk-DMUGTKMD.js +2 -0
- package/dist/chunk-DOPCR5BY.js +2 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-E4EJBGDZ.js +2 -0
- package/dist/chunk-E7BJXRNV.js +2 -0
- package/dist/chunk-EA4SH4U5.js +5 -0
- package/dist/{chunk-L7AW2QB5.js → chunk-EKZRF57O.js} +2 -2
- package/dist/chunk-ELNRLMC5.js +29 -0
- package/dist/chunk-F4FNK44D.js +2 -0
- package/dist/chunk-F7WQ337U.js +308 -0
- package/dist/chunk-FEQIQ26E.js +2 -0
- package/dist/chunk-FGB567HK.js +23 -0
- package/dist/chunk-FHV7NMFU.js +29 -0
- package/dist/chunk-FN6EJM6Q.js +2 -0
- package/dist/chunk-FTSQNONX.js +2 -0
- package/dist/chunk-FUG6RPYY.js +6 -0
- package/dist/chunk-G2F6T5BV.js +2 -0
- package/dist/chunk-G6OGPXJW.js +9 -0
- package/dist/chunk-GFLTPNWV.js +3 -0
- package/dist/chunk-GTDP2SKQ.js +2 -0
- package/dist/chunk-H46QMB7E.js +2 -0
- package/dist/chunk-H5EXS3HM.js +2 -0
- package/dist/chunk-HEOMG7IM.js +8 -0
- package/dist/chunk-HG5YI7PV.js +2 -0
- package/dist/{chunk-7SQQWSY3.js → chunk-HGKEAP7F.js} +2 -2
- package/dist/chunk-HUZNZ3H2.js +2 -0
- package/dist/chunk-HWLCBKFE.js +2 -0
- package/dist/chunk-I3U2FN2T.js +13 -0
- package/dist/{chunk-JAYYFEQY.js → chunk-I7PFL5P3.js} +2 -2
- package/dist/{chunk-2HPVVXM5.js → chunk-ICHBVITH.js} +2 -2
- package/dist/chunk-ICUQONOG.js +38 -0
- package/dist/chunk-IDPLC3FI.js +5 -0
- package/dist/{chunk-A73XVBCR.js → chunk-IGKKTHJR.js} +2 -2
- package/dist/chunk-IOKWFRFQ.js +4 -0
- package/dist/chunk-IPAL6DP2.js +3 -0
- package/dist/chunk-IUJ3ZFEE.js +7 -0
- package/dist/chunk-IXJ26KJJ.js +16 -0
- package/dist/chunk-IYV2YBHM.js +2 -0
- package/dist/chunk-JVZNWJBH.js +2 -0
- package/dist/chunk-K5MZYZV7.js +3 -0
- package/dist/{chunk-3G66UZBH.js → chunk-KFK7GF5C.js} +2 -2
- package/dist/chunk-KTRGJLY7.js +18 -0
- package/dist/chunk-KW6B5OL4.js +2 -0
- package/dist/chunk-KWARB5FZ.js +2 -0
- package/dist/chunk-LHTT5C3Z.js +2 -0
- package/dist/chunk-LPGDO2XA.js +3 -0
- package/dist/chunk-LXLD46LH.js +21 -0
- package/dist/chunk-MEI3PTUK.js +2 -0
- package/dist/chunk-MJNV7OCG.js +5 -0
- package/dist/chunk-MO226P4Q.js +4 -0
- package/dist/{chunk-3CLX5EOX.js → chunk-MOBF2GH6.js} +2 -2
- package/dist/chunk-MXNGIEPU.js +3 -0
- package/dist/chunk-MYUKI5VN.js +4 -0
- package/dist/{chunk-TFRAYKN6.js → chunk-N5C65OFK.js} +2 -2
- package/dist/{chunk-PXY7F6Y4.js → chunk-O2RM7E7L.js} +5 -5
- package/dist/chunk-OFUBXBYX.js +3 -0
- package/dist/chunk-OFY4HTMI.js +2 -0
- package/dist/chunk-OIRWZIYL.js +38 -0
- package/dist/chunk-OIVZ7PW6.js +438 -0
- package/dist/chunk-ORBKAUCH.js +4 -0
- package/dist/chunk-OUB4J26T.js +2 -0
- package/dist/chunk-OVPS2ILI.js +20 -0
- package/dist/chunk-PHSPBQM6.js +5 -0
- package/dist/{chunk-JVYA47YU.js → chunk-PIZY2GX6.js} +2 -2
- package/dist/chunk-PNISDVYC.js +3 -0
- package/dist/chunk-PQOL42AW.js +2 -0
- package/dist/chunk-PUVZNFVY.js +11 -0
- package/dist/chunk-PZEI2TVL.js +4 -0
- package/dist/{chunk-ZK26BAQL.js → chunk-Q2J2VZZT.js} +2 -2
- package/dist/chunk-Q7HB7BFJ.js +2 -0
- package/dist/{chunk-ZTETIQ35.js → chunk-QBANU5BQ.js} +2 -2
- package/dist/chunk-QD7IFBCR.js +10 -0
- package/dist/chunk-QDCCHMVZ.js +2 -0
- package/dist/chunk-QLQBZOJH.js +3 -0
- package/dist/{chunk-PQCI4SQX.js → chunk-QXR5QPSF.js} +2 -2
- package/dist/chunk-R2MOKIVO.js +2 -0
- package/dist/{chunk-EN3O7VJA.js → chunk-RFWAUHVW.js} +2 -2
- package/dist/chunk-RGCJ4646.js +16 -0
- package/dist/{chunk-BPAPWKP6.js → chunk-S3RTPPLQ.js} +8 -8
- package/dist/chunk-S73HBCGI.js +11 -0
- package/dist/chunk-SDPA5DKN.js +210 -0
- package/dist/chunk-SEUJVWT2.js +3 -0
- package/dist/chunk-SF7X6QNW.js +2 -0
- package/dist/chunk-SKUMCCC5.js +2 -0
- package/dist/chunk-SSSJO4RG.js +2 -0
- package/dist/chunk-SWFAFA4G.js +49 -0
- package/dist/chunk-SYUNTKO2.js +2 -0
- package/dist/chunk-T6FRID7Y.js +3 -0
- package/dist/chunk-TGWNNMPF.js +3 -0
- package/dist/chunk-TM5XEDDR.js +4 -0
- package/dist/chunk-TNOHGHZQ.js +2 -0
- package/dist/chunk-U2GPTA5U.js +3 -0
- package/dist/{chunk-SXP2MBJH.js → chunk-U7DR7MJD.js} +2 -2
- package/dist/chunk-U7LRSQG6.js +3 -0
- package/dist/chunk-UL4VJUMD.js +2 -0
- package/dist/chunk-UNORWZIJ.js +16 -0
- package/dist/chunk-UQ7XPRWU.js +2 -0
- package/dist/{chunk-6SHPK5ZE.js → chunk-URMZLV2N.js} +2 -2
- package/dist/chunk-URTX2BEA.js +6 -0
- package/dist/chunk-UZFCZ7SJ.js +2 -0
- package/dist/{chunk-KMKTIO2G.js → chunk-V7LQZTTZ.js} +2 -2
- package/dist/chunk-VETXXOYU.js +3 -0
- package/dist/chunk-VGRUM7JI.js +3 -0
- package/dist/{chunk-WXZLAAWK.js → chunk-VNKYRJKN.js} +2 -2
- package/dist/chunk-VWLIOEEF.js +11 -0
- package/dist/chunk-WB6LGCFB.js +6 -0
- package/dist/{chunk-W4ETQAXM.js → chunk-WK4FD4PG.js} +2 -2
- package/dist/{chunk-O64IZ6UX.js → chunk-WKPZCQLI.js} +2 -2
- package/dist/chunk-WSG3DK5H.js +2 -0
- package/dist/chunk-WULAPQUD.js +38 -0
- package/dist/chunk-WZQFY5S7.js +4 -0
- package/dist/chunk-X434XZAI.js +2 -0
- package/dist/chunk-X7PJJYKX.js +29 -0
- package/dist/chunk-XDAUYDFT.js +2 -0
- package/dist/chunk-XITQLISP.js +2 -0
- package/dist/chunk-XRXCANFQ.js +4 -0
- package/dist/chunk-XVDMJMES.js +3 -0
- package/dist/chunk-XXJ7WL3F.js +35 -0
- package/dist/chunk-Y4XQ7LES.js +9 -0
- package/dist/chunk-YIEFEPG6.js +16 -0
- package/dist/chunk-YRVERHJR.js +49 -0
- package/dist/{chunk-CJST5ETY.js → chunk-YUFWLWIC.js} +2 -2
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-Z3GCK3PD.js +3 -0
- package/dist/chunk-ZBNL3QCY.js +4 -0
- package/dist/chunk-ZD3Z54IW.js +2 -0
- package/dist/chunk-ZDVDSDFG.js +4 -0
- package/dist/{chunk-32LVLCLN.js → chunk-ZHSARYVS.js} +3 -3
- package/dist/{chunk-BDCC2NPY.js → chunk-ZW44MCJM.js} +2 -2
- package/dist/{chunk-N5W4YZMK.js → chunk-ZYREOING.js} +2 -2
- package/dist/cli-main.js +8 -0
- package/dist/cli.js +1 -3
- package/dist/code-CczEvHui.d.ts +121 -0
- package/dist/code-EQL6ZBLH.js +2 -0
- package/dist/code-result-json-6E4J6LGZ.js +2 -0
- package/dist/command-descriptors-QH3G2OVD.js +346 -0
- package/dist/{config-types-jVM3D7MA.d.ts → config-types-Cm-VSEBb.d.ts} +189 -23
- package/dist/dataflow-2BLMUZBP.js +2 -0
- package/dist/{db-B5PM5yNk.d.ts → db-LKJXAlNS.d.ts} +1 -1
- package/dist/dependence-slice-MGAJDZXB.js +2 -0
- package/dist/deps-GQMUYVKW.js +2 -0
- package/dist/direct-navigation-6RUJKLAV.js +3 -0
- package/dist/entry-map-V2NQP5JU.js +2 -0
- package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
- package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
- package/dist/file-kind-BKCVMNUf.d.ts +10 -0
- package/dist/files-VM53I4IU.js +2 -0
- package/dist/graph-evidence-CbUPCSKV.d.ts +126 -0
- package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
- package/dist/{health-Do5TKSJI.d.ts → health-Wl5G_LRt.d.ts} +33 -34
- package/dist/hierarchy-D553WRSZ.js +2 -0
- package/dist/imports-DOZAJWLW.js +2 -0
- package/dist/index.d.ts +4 -31
- package/dist/index.js +1 -1
- package/dist/members-HE67475K.js +2 -0
- package/dist/methods-K5JK4PPH.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-LKBUTNRL.js +3 -0
- package/dist/output-pagination-VAWOGX4R.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-4ARU6QCM.js +3 -0
- package/dist/queries/affected.d.ts +22 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +123 -0
- package/dist/queries/anchors.js +2 -0
- package/dist/queries/architecture.d.ts +3 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +26 -7
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +17 -3
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +5 -26
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +145 -0
- package/dist/queries/context.js +2 -0
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -3
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +34 -7
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +40 -14
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +3 -3
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +4 -38
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +47 -0
- package/dist/queries/dependence-slice.js +2 -0
- package/dist/queries/dependency-depth.d.ts +49 -0
- package/dist/queries/dependency-depth.js +2 -0
- package/dist/queries/deps.d.ts +4 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -4
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +121 -0
- package/dist/queries/entry-map.js +2 -0
- package/dist/queries/evidence.d.ts +70 -0
- package/dist/queries/evidence.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +18 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +5 -3
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +11 -5
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +4 -4
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +56 -136
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +5 -9
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +27 -64
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +4 -0
- package/dist/queries/reference-neighborhood.js +2 -0
- package/dist/queries/reference-reachability.d.ts +48 -0
- package/dist/queries/reference-reachability.js +2 -0
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +3 -36
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +209 -0
- package/dist/queries/source-inspection.js +2 -0
- package/dist/queries/source-search.d.ts +13 -0
- package/dist/queries/source-search.js +2 -0
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +13 -4
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +449 -0
- package/dist/queries/system-map.js +2 -0
- package/dist/queries/system.d.ts +5 -3
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +47 -3
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +3 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +3 -3
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +43 -0
- package/dist/queries/value-flow.js +2 -0
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +6 -0
- package/dist/query-service-server.js +5 -0
- package/dist/refs-NBHKL4UQ.js +2 -0
- package/dist/refs-pagination-BBVTIHMH.js +2 -0
- package/dist/reindex-worker.js +27 -45
- package/dist/reindex.d.ts +62 -42
- package/dist/reindex.js +32 -33
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +286 -7
- package/dist/runtime.js +4 -3
- 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-BnEwZRLJ.d.ts → scip-cli-CppzF5MK.d.ts} +33 -2
- package/dist/slice-U6S6LBSB.js +2 -0
- package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
- package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
- package/dist/stats-OOJ74B32.js +2 -0
- package/dist/surface-C7SS5CDQ.js +2 -0
- package/dist/symbol-resolution-3FVEKDTJ.js +2 -0
- package/dist/system-6K2NOO5C.js +2 -0
- package/dist/trace-II5K2TMH.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-MKFUUE5B.js +2 -0
- package/dist/watch-server.js +3 -2
- package/docs/AGENT_GUIDE.md +133 -476
- package/docs/AI_FAILURE_MODES.md +30 -301
- package/docs/API.md +1 -1
- package/docs/API_EVOLUTION.md +6 -0
- package/docs/CLI_JSON_OUTPUT.md +207 -29
- package/docs/COMMAND_REFERENCE.md +255 -154
- package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
- package/docs/DETECTOR_GUIDE.md +46 -138
- package/docs/DURABILITY.md +7 -1
- package/docs/INDEX_GENERATIONS.md +6 -0
- package/docs/LOCK_PROTOCOL.md +8 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
- package/docs/SECURITY_MODEL.md +39 -42
- package/docs/accuracy-audit-checklist.md +4 -0
- package/docs/accuracy-hardening-goal.md +9 -2
- package/docs/analyzer-inventory.md +59 -264
- package/docs/analyzer-validation-protocol.md +62 -170
- package/docs/architecture-coherence-vision.md +18 -12
- package/docs/locality-analyzer-design.md +1 -1
- package/docs/schemas/cli-json-envelope.schema.json +212 -27
- package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
- package/docs/schemas/cli-output-page.schema.json +1 -1
- package/docs/schemas/observation-receipt.schema.json +164 -0
- package/docs/schemas/project-config.schema.json +27 -45
- package/docs/schemas/suppression-record.schema.json +1 -34
- package/package.json +65 -8
- package/skills/concrete-plan/SKILL.md +8 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-explore/SKILL.md +3 -85
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/SKILL.md +185 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-plan/SKILL.md +67 -49
- package/skills/scip-plan/agents/openai.yaml +3 -3
- package/skills/scip-query/SKILL.md +77 -77
- package/skills/scip-query/agents/openai.yaml +3 -3
- package/skills/scip-setup/SKILL.md +10 -102
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/chunk-26QA6FAI.js +0 -8
- package/dist/chunk-2KAZEZ6M.js +0 -2
- package/dist/chunk-3ORVDL3H.js +0 -2
- package/dist/chunk-46XGSFNI.js +0 -2
- package/dist/chunk-4MAK2HOY.js +0 -6
- package/dist/chunk-4TURLRL5.js +0 -16
- package/dist/chunk-4UQVNCQE.js +0 -2
- package/dist/chunk-55Q3WLZX.js +0 -2
- package/dist/chunk-5I5G2QOX.js +0 -3
- package/dist/chunk-6LDJQXAH.js +0 -2
- package/dist/chunk-6O5TICIZ.js +0 -3
- package/dist/chunk-7O5IKBTZ.js +0 -16
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7WPLAODU.js +0 -5
- package/dist/chunk-AFHORGLH.js +0 -42
- package/dist/chunk-AIE7TFJW.js +0 -9
- package/dist/chunk-AQOFWNQJ.js +0 -1
- package/dist/chunk-B2PX5I6M.js +0 -2
- package/dist/chunk-B75HZHUP.js +0 -2
- package/dist/chunk-B7PBSLZN.js +0 -2
- package/dist/chunk-BBW6JFHN.js +0 -2
- package/dist/chunk-BNXCIFVY.js +0 -2
- package/dist/chunk-BS2NMXQZ.js +0 -4
- package/dist/chunk-C3KV2II6.js +0 -2
- package/dist/chunk-C43RDDP4.js +0 -20
- package/dist/chunk-DAFAHMNB.js +0 -42
- package/dist/chunk-DQLPXMH6.js +0 -8
- package/dist/chunk-EKZTZXHZ.js +0 -117
- package/dist/chunk-EW2NTSFA.js +0 -18
- package/dist/chunk-F3Z4OUDS.js +0 -8
- package/dist/chunk-FJH2NW7J.js +0 -66
- package/dist/chunk-FTFP6O3L.js +0 -11
- package/dist/chunk-FYLK2DEJ.js +0 -2
- package/dist/chunk-GH74ASD6.js +0 -11
- package/dist/chunk-GMXWZP2B.js +0 -2
- package/dist/chunk-GOUBFH5O.js +0 -3
- package/dist/chunk-HLF2TX6R.js +0 -2
- package/dist/chunk-HX7M4BDI.js +0 -30
- package/dist/chunk-HZ72SESS.js +0 -128
- package/dist/chunk-IB2N4FIY.js +0 -10
- package/dist/chunk-IZYYAFN5.js +0 -2
- package/dist/chunk-JFGGXWQF.js +0 -947
- package/dist/chunk-JN4NMBEX.js +0 -8
- package/dist/chunk-JW56N3KI.js +0 -4
- package/dist/chunk-JZ2OXNWB.js +0 -2
- package/dist/chunk-KFZNKUNT.js +0 -2
- package/dist/chunk-L5GJNV2T.js +0 -8
- package/dist/chunk-L7JDSCDF.js +0 -4
- package/dist/chunk-LU47HG23.js +0 -14
- package/dist/chunk-LVY7NPF7.js +0 -2
- package/dist/chunk-MKCDWWGV.js +0 -4
- package/dist/chunk-MNE7YG56.js +0 -2
- package/dist/chunk-MRXBEXSY.js +0 -26
- package/dist/chunk-MV7OWDUX.js +0 -2
- package/dist/chunk-NGEXCJJW.js +0 -11
- package/dist/chunk-NIW6JDC5.js +0 -29
- package/dist/chunk-PBUQFCNB.js +0 -16
- package/dist/chunk-POAVPHH7.js +0 -2
- package/dist/chunk-QZ4JVECJ.js +0 -2
- package/dist/chunk-RDO52JGY.js +0 -2
- package/dist/chunk-RJT3TUUZ.js +0 -2
- package/dist/chunk-RVLDN63O.js +0 -4
- package/dist/chunk-RXOXSKY3.js +0 -2
- package/dist/chunk-S7OYBOCK.js +0 -2
- package/dist/chunk-SMNXQT5Z.js +0 -3
- package/dist/chunk-SRAFT254.js +0 -2
- package/dist/chunk-T7YQSHPQ.js +0 -3
- package/dist/chunk-UJCOIXDY.js +0 -2
- package/dist/chunk-UJPRPGCO.js +0 -13
- package/dist/chunk-WCCFZ7V7.js +0 -113
- package/dist/chunk-WUPW3UN3.js +0 -3
- package/dist/chunk-X54AGLVX.js +0 -2
- package/dist/chunk-Y2MVPNKY.js +0 -5
- package/dist/chunk-YKUU5AIC.js +0 -3
- package/dist/chunk-YLCJLTPL.js +0 -2
- package/dist/chunk-YTQVETEO.js +0 -2
- package/dist/chunk-Z4N3MZYA.js +0 -38
- package/dist/chunk-ZJOOT3BG.js +0 -2
- package/dist/command-descriptors-DSS46KXI.js +0 -642
- package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
- package/dist/direct-navigation-6YHV6IB5.js +0 -3
- package/dist/queries/diff-gate.d.ts +0 -253
- package/dist/queries/diff-gate.js +0 -2
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
- package/docs/analyzer-validation-ledger.md +0 -516
- package/docs/schemas/outcome-event-record.schema.json +0 -95
- package/skills/_shared/SKILL.md +0 -101
- package/skills/_shared/agents/openai.yaml +0 -4
- package/skills/_shared/references/agent-contract-catalog.md +0 -105
- package/skills/_shared/references/command-catalog.md +0 -118
- package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
- package/skills/_shared/references/evidence-and-dead-code.md +0 -25
- package/skills/scip-audit/SKILL.md +0 -77
- package/skills/scip-audit/agents/openai.yaml +0 -4
- package/skills/scip-audit/references/claims.md +0 -98
- package/skills/scip-audit/references/cleanup.md +0 -100
- package/skills/scip-audit/references/directory.md +0 -222
- package/skills/scip-audit/references/frontend.md +0 -130
- package/skills/scip-audit/references/integrity.md +0 -154
- package/skills/scip-audit/references/maintainability.md +0 -162
- package/skills/scip-audit/references/twin-drift.md +0 -104
- package/skills/scip-diagnose/SKILL.md +0 -52
- package/skills/scip-diagnose/agents/openai.yaml +0 -4
- package/skills/scip-diagnose/references/debug.md +0 -117
- package/skills/scip-diagnose/references/probe-reachability.md +0 -77
- package/skills/scip-diagnose/references/root-cause.md +0 -145
- package/skills/scip-diagnose/references/triage.md +0 -119
- package/skills/scip-explore/references/diagrams.md +0 -40
- package/skills/scip-explore/references/language-playbook.md +0 -49
- package/skills/scip-improve/SKILL.md +0 -56
- package/skills/scip-improve/agents/openai.yaml +0 -4
- package/skills/scip-improve/references/cleanup-batches.md +0 -53
- package/skills/scip-improve/references/directory-moves.md +0 -53
- package/skills/scip-improve/references/doc-reconcile.md +0 -30
- package/skills/scip-improve/references/frontend-extraction.md +0 -39
- package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
- package/skills/scip-improve/references/twin-drift.md +0 -35
- package/skills/scip-plan/references/api-impact.md +0 -19
- package/skills/scip-plan/references/conductor.md +0 -41
- package/skills/scip-plan/references/high-assurance.md +0 -43
- package/skills/scip-plan/references/hyper-optimization.md +0 -50
- package/skills/scip-plan/references/tla-model.md +0 -88
- package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
- package/skills/scip-setup/references/language-verification.md +0 -61
- package/skills/scip-setup/references/lifecycle-commands.md +0 -119
- package/skills/scip-setup/references/per-repo-triage.md +0 -24
- package/skills/scip-verify/SKILL.md +0 -229
- package/skills/scip-verify/agents/openai.yaml +0 -4
- package/skills/scip-verify/references/calibrate-detectors.md +0 -170
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as R}from"./chunk-7TWP3MCP.js";import{d as U,e as H,f as J,m as j}from"./chunk-RGCJ4646.js";import{c as X,t as T,u as Y}from"./chunk-5IZTXSOL.js";import{g as k,l as E,p as N,r as z,w as A}from"./chunk-I3U2FN2T.js";import{C as w}from"./chunk-AA7K3XLM.js";import{x as K}from"./chunk-DMQ7ZKJG.js";import{C as q,F as G,d as M}from"./chunk-MO226P4Q.js";var ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap;function Ve(t,e){let n=te.get(t);n||(n=new Map,te.set(t,n));let r=n.get(e);if(r)return r;let i=w(t,e)?.rootNode;if(!i)return n.set(e,[]),[];let o=new Set;I(i,c=>{if(c.type!=="call_expression")return;let p=c.childForFieldName("function")??c.namedChild(0),s=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(p?.text.replace(/\s+/gu,"")??"");s&&o.add(s[1])});let m=A(t,e).filter(c=>!!c.sourcePath),u=new Set;for(let c of o){let p=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(c);if(p){for(let s of m)s.localName===p[1]&&u.add(s.sourcePath);continue}if(c==="Service"){T(t,e).some(s=>s.leaf==="Service")&&u.add(e);for(let s of m)(s.localName??s.importedName)==="Service"&&u.add(s.sourcePath)}}let l=W([...u]).sort();return n.set(e,l),l}function qe(t,e,n={}){let i=z(t,e)?.filter(a=>!n.ranges||n.ranges.some(d=>a.line>=d.startLine&&a.line<=d.endLine));if(!i)return{targets:[],unresolvedCallsites:0};let o=A(t,e).filter(a=>!!a.sourcePath),m=_e(K(t,e)??""),u=w(t,e)?.rootNode??null,l=u?pe(u):ae(),c=new Map,p=J(t),s=[],f=0;for(let a of i){if(!a.memberAccess)continue;let d=U(e,p.get(a.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&H(t,e,d,!0,a.calleeQualifier))continue;let h=a.calleeQualifier,L=Pe(t,e,a,o);if(L){s.push(L);continue}let S=de(t,e,a,o,ge(l,a.calleeQualifier,a.line));if(S.length>0){s.push(...S);continue}let x=he(t,e,a);if(x.length>0){s.push(...x);continue}let y=h?m.get(h)??h:null,P=(y?W(o.filter(g=>(g.localName??g.importedName)===y).map(g=>g.sourcePath)):[]).flatMap(g=>{let v=c.get(g);return v||(v=N(t,g)??[],c.set(g,v)),v.filter(b=>b.name===a.calleeLeaf).map(b=>({file:g,callable:b}))});if(P.length!==1){f+=1;continue}let _=P[0];s.push({calleeLeaf:a.calleeLeaf,line:a.line,sourceFile:e,targetFile:_.file,targetStartLine:_.callable.startLine,targetEndLine:_.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:s,unresolvedCallsites:f}}function de(t,e,n,r,i){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];if(i.size!==1)return[];let m=[...i][0],u=W(r.filter(p=>p.localName===m||p.importedName===m).map(p=>p.sourcePath));if(u.length!==1)return[];let l=u[0],c=xe(t,l,n.calleeLeaf);return c.map(p=>({calleeLeaf:p.name,line:n.line,sourceFile:e,targetFile:p.file,targetStartLine:p.startLine,targetEndLine:p.endLine,serviceFile:l,resolutionAlternativeCount:c.length,resolution:"imported-service-object-member",strength:"candidate"}))}function ae(){return{declarations:new Map,callbacks:[]}}function pe(t){let e=ae();return I(t,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),c=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!c)return;let p=new Set;if(I(c,s=>{if(s.type!=="member_expression")return;let f=s.childForFieldName("object")??s.namedChild(0),a=s.childForFieldName("property")??s.namedChild(1);f?.type==="identifier"&&a?.text==="Service"&&p.add(f.text)}),p.size===1){let s=e.declarations.get(l.text)??[];s.push({line:n.startPosition.row,alias:[...p][0]}),e.declarations.set(l.text,s)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let r=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!r)return;let i=n.parent;for(;i&&i.type!=="call_expression";)i=i.parent;if(!i)return;let o=i.childForFieldName("function")??i.namedChild(0),m=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(o?.text??"");if(!m)return;let u=new Set;I(r,l=>{l.type==="identifier"&&u.add(l.text)}),u.size!==0&&e.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:u,alias:m[1]})}),e}function ge(t,e,n){if(!e||!/^[A-Za-z_$][\w$]*$/u.test(e))return new Set;let r=new Set((t.declarations.get(e)??[]).filter(i=>i.line<=n).map(i=>i.alias));for(let i of t.callbacks)i.startLine<=n&&i.endLine>=n&&i.receivers.has(e)&&r.add(i.alias);return r}function he(t,e,n){let r=n.calleeQualifier;if(!r||!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=ye(t,e,i,n.line,n.calleeLeaf,r),m=o?Se(o,r):null;if(!m)return[];if(!Le(m))return[];let u=(N(t,e)??[]).filter(a=>a.startLine<=m.startPosition.row&&a.endLine>=m.endPosition.row).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine))[0];if(!u)return[];let l=T(t,e).filter(a=>a.isFunctionLike&&a.leaf===u.name);if(l.length!==1)return[];let c=l[0],p=re.get(t);p||(p=new Map,re.set(t,p));let s=`${c.symbol}\0${n.calleeLeaf}`,f=p.get(s);if(!f){let a=[];for(let d of j(t,c)){let h=w(t,d.file)?.rootNode;if(!h)continue;let L=h.descendantsOfType("call_expression").filter(y=>y.startPosition.row>d.line||y.endPosition.row<d.line?!1:(y.childForFieldName("function")??y.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===c.leaf);if(L.length!==1)continue;let x=L[0].childForFieldName("arguments")?.namedChildren.find(y=>F(y).type==="object");if(x)for(let y of F(x).namedChildren){if(y.type==="shorthand_property_identifier"&&y.text===n.calleeLeaf){a.push(...D(t,d.file,n.calleeLeaf,y,y));continue}if(y.type!=="pair")continue;let $=y.childForFieldName("key")??y.namedChild(0),P=y.childForFieldName("value")??y.namedChild(1);O($?.text)!==n.calleeLeaf||!P||a.push(...D(t,d.file,n.calleeLeaf,P,y))}}f=a.filter((d,h,L)=>L.findIndex(S=>S.file===d.file&&S.startLine===d.startLine&&S.endLine===d.endLine&&S.name===d.name)===h),p.set(s,f)}return f.map(a=>({calleeLeaf:a.name,line:n.line,sourceFile:e,targetFile:a.file,targetStartLine:a.startLine,targetEndLine:a.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function ye(t,e,n,r,i,o){let m=ne.get(t);m||(m=new Map,ne.set(t,m));let u=m.get(e);if(!u){u=new Map;for(let l of n.descendantsOfType("call_expression")){let c=l.childForFieldName("function")??l.namedChild(0),p=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(c?.text.replace(/\s+/gu,"")??"");if(p)for(let s=l.startPosition.row;s<=l.endPosition.row;s+=1){let f=`${s}\0${p[1]}\0${p[2]}`,a=u.get(f);(!a||l.endIndex-l.startIndex<a.endIndex-a.startIndex)&&u.set(f,l)}}m.set(e,u)}return u.get(`${r}\0${o}\0${i}`)??null}function Le(t){return t.descendantsOfType("return_statement").some(e=>{let n=e.childForFieldName("argument")??e.namedChild(0);return!!(n&&F(n).type==="object")})}function Se(t,e){let n=t.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let r=n.childForFieldName("parameters")??n.childForFieldName("parameter"),i=!1;if(r&&I(r,o=>{o.type==="identifier"&&o.text===e&&(i=!0)}),i)return n}n=n.parent}return null}function D(t,e,n,r,i){if(r.type==="identifier")return(N(t,e)??[]).filter(l=>l.name===r.text).map(l=>({...l,file:e}));let o=Z(t,e,r.text);if(o.length>0)return o;if(!B(r))return[];let u=(N(t,e)??[]).filter(l=>l.startLine>=i.startPosition.row&&l.endLine<=i.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,c)=>l.endLine-l.startLine-(c.endLine-c.startLine))[0];return[u?{...u,file:e}:{name:n,file:e,startLine:i.startPosition.row,endLine:i.endPosition.row}]}function xe(t,e,n){let r=ie.get(t);r||(r=new Map,ie.set(t,r));let i=`${e}\0${n}`,o=r.get(i);if(o)return o;let m=Ne(t,e).flatMap(u=>be(t,u,e,n));return r.set(i,m),m}function be(t,e,n,r){let i=w(t,e)?.rootNode,o=N(t,e)??[];if(!i)return[];let m=ve(t,e,n);if(m.size===0)return[];let u=new Set,l=[],c=[],p=[];return I(i,f=>{if(Ce(f,m)){if(f.type==="pair"){let a=f.childForFieldName("key")??f.namedChild(0),d=f.childForFieldName("value")??f.namedChild(1);if(O(a?.text)!==r||!d)return;if(d.type==="identifier")u.add(d.text);else if(B(d))l.push({name:r,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let h=we(t,e,d.text),L=Z(t,e,d.text);if(h.length>0)p.push(...h);else if(L.length>0)p.push(...L);else{let S=Ie(f);S&&c.push(S)}}return}f.type==="shorthand_property_identifier"&&f.text===r&&u.add(r)}}),[...o.filter(f=>u.has(f.name)).map(f=>({...f,file:e})),...l.map(f=>({...f,file:e})),...c.map(f=>({...f,file:e})),...p].filter((f,a,d)=>d.findIndex(h=>h.file===f.file&&h.name===f.name&&h.startLine===f.startLine&&h.endLine===f.endLine)===a)}function Ce(t,e){let n=t,r=null;for(;n;){if(n.type==="object"&&(r=n),n.type==="call_expression"){if(!r)return!1;let i=n.childForFieldName("function")??n.namedChild(0);return i?e.has(i.text.replace(/\.of$/u,""))&&i.text.endsWith(".of"):!1}n=n.parent}return!1}function Ne(t,e){let n=ee.get(t);n||(n=new Map,ee.set(t,n));let r=n.get(e);if(r)return r;let i=new Set([e]),o=T(t,e).filter(u=>u.leaf==="Service"&&u.isTypeLike);for(let u of o)for(let l of j(t,u))i.add(l.file);let m=[...i].sort();return n.set(e,m),m}function ve(t,e,n){let r=new Set;M(e,n)&&r.add("Service");for(let i of A(t,e)){if(!i.sourcePath||!M(i.sourcePath,n))continue;if(i.kind==="namespace"&&i.localName){r.add(`${i.localName}.Service`);continue}(i.importedName==="default"?i.localName:i.importedName)==="Service"?r.add(i.localName??i.importedName):i.localName&&i.importedName!=="default"&&r.add(`${i.localName}.Service`)}return r}function Z(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=se(i,r[1]),m=o?oe(o):null;if(!m)return[];let u=m.childForFieldName("function")??m.namedChild(0),l=u?le(t,e,u.text):[];if(l.length!==1)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=k(p,c.startLine,c.endLine);if(!s)return[];let f=[];for(let a of s.descendantsOfType("return_statement")){let d=a.childForFieldName("argument")??a.namedChild(0);if(!d)continue;let h=F(d);if(h.type==="object")for(let L of h.namedChildren){if(L.type==="shorthand_property_identifier"&&L.text===r[2]){for(let y of N(t,c.relativePath)??[])y.name===r[2]&&f.push({...y,file:c.relativePath});continue}if(L.type!=="pair")continue;let S=L.childForFieldName("key")??L.namedChild(0),x=L.childForFieldName("value")??L.namedChild(1);if(!(O(S?.text)!==r[2]||!x))if(x.type==="identifier")for(let y of N(t,c.relativePath)??[])y.name===x.text&&f.push({...y,file:c.relativePath});else B(x)&&f.push({name:r[2],startLine:L.startPosition.row,endLine:L.endPosition.row,file:c.relativePath})}}return f.filter((a,d,h)=>h.findIndex(L=>L.file===a.file&&L.name===a.name&&L.startLine===a.startLine&&L.endLine===a.endLine)===d)}function we(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=se(i,r[1]),m=o?oe(o):null,u=m?.childForFieldName("function")??m?.namedChild(0),l=u?le(t,e,u.text):[];if(l.length!==1||!m)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=k(p,c.startLine,c.endLine);if(!s)return[];let f=new Set,a=s.childForFieldName("parameters")??s.childForFieldName("parameter");if(a&&I(a,g=>{g.type==="identifier"&&f.add(g.text)}),f.size===0)return[];let d=Z(t,e,n);if(d.length===0)return[];let h=(N(t,c.relativePath)??[]).filter(g=>g.startLine>=c.startLine&&g.endLine<=c.endLine),L=(z(t,c.relativePath)??[]).filter(g=>g.line>=c.startLine&&g.line<=c.endLine),S=new Set,x=d.map(g=>({name:g.name,startLine:g.startLine,endLine:g.endLine})),y=new Set;for(;x.length>0&&y.size<32;){let g=x.shift(),v=`${g.name}\0${g.startLine}\0${g.endLine}`;if(!y.has(v)){y.add(v);for(let b of L.filter(C=>C.line>=g.startLine&&C.line<=g.endLine)){if(b.memberAccess&&b.calleeQualifier&&f.has(b.calleeQualifier)){S.add(b.calleeLeaf);continue}if(b.memberAccess)continue;let C=h.filter(me=>me.name===b.calleeLeaf);C.length===1&&x.push(C[0])}}}if(S.size===0)return[];let P=m.childForFieldName("arguments")?.namedChildren.find(g=>F(g).type==="object");if(!P)return[];let _=[];for(let g of F(P).namedChildren){if(g.type==="shorthand_property_identifier"&&S.has(g.text)){_.push(...D(t,e,g.text,g,g));continue}if(g.type!=="pair")continue;let v=g.childForFieldName("key")??g.namedChild(0),b=g.childForFieldName("value")??g.namedChild(1),C=O(v?.text);!C||!S.has(C)||!b||_.push(...D(t,e,C,b,g))}return _.filter((g,v,b)=>b.findIndex(C=>C.file===g.file&&C.name===g.name&&C.startLine===g.startLine&&C.endLine===g.endLine)===v)}function se(t,e){for(let n of t.descendantsOfType("variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===e)return n.childForFieldName("value")??n.namedChild(1);return null}function oe(t){return t.type==="call_expression"?t:t.descendantsOfType("call_expression")[0]??null}function le(t,e,n){let r=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),i=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(r);if(i){let s=A(t,e).filter(d=>d.localName===i[1]&&d.sourcePath);if(s.length!==1||!s[0].sourcePath)return[];let f=s[0].sourcePath,a=R(t,f,i[2]).filter(d=>d.isFunctionLike);return a.length>0?a:(N(t,f)??[]).filter(d=>d.name===i[2]).map(d=>({...d,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let o=T(t,e).filter(s=>s.leaf===r&&s.isFunctionLike);if(o.length>0)return o;let m=(N(t,e)??[]).filter(s=>s.name===r).map(s=>({...s,relativePath:e}));if(m.length>0)return m;let u=A(t,e).filter(s=>s.localName===r&&s.sourcePath&&s.kind!=="namespace");if(u.length!==1||!u[0].sourcePath)return[];let l=u[0].sourcePath,c=u[0].importedName==="default"?r:u[0].importedName,p=R(t,l,c).filter(s=>s.isFunctionLike);return p.length>0?p:(N(t,l)??[]).filter(s=>s.name===c).map(s=>({...s,relativePath:l}))}function B(t){return["arrow_function","function_expression","generator_function"].includes(t.type)||t.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function Ie(t){let e=t.parent;for(;e;){if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row}}e=e.parent}return null}function O(t){return t?t.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function Pe(t,e,n,r){let i=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!i)return null;let o=w(t,e)?.rootNode;if(!o)return null;let m=$e(o,n.line);if(!m)return null;let u=new Set;if(I(m,h=>{if(h.type!=="assignment_expression")return;let L=h.childForFieldName("left")??h.namedChild(0),S=h.childForFieldName("right")??h.namedChild(h.namedChildCount-1);if(L?.text.replace(/\s+/gu,"")!==`this.${i[1]}`||!S)return;let x=F(S);if(x.type!=="new_expression")return;let $=(x.childForFieldName("constructor")??x.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];$&&u.add($)}),u.size!==1)return null;let l=[...u][0],c=r.filter(h=>h.localName===l);if(c.length!==1)return null;let p=c[0].importedName==="default"?l:c[0].importedName,s=c[0].importedName==="default"?R(t,c[0].sourcePath,l):[],f=s.length===1?s[0].leaf:p,a=T(t,c[0].sourcePath).filter(h=>h.isFunctionLike&&h.leaf===n.calleeLeaf&&X(h.symbol)===f);if(a.length!==1)return null;let d=a[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:e,targetFile:d.relativePath,targetStartLine:d.startLine,targetEndLine:d.endLine,targetSymbol:d.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function $e(t,e){let n=[];return I(t,r=>{["class","class_declaration","class_definition"].includes(r.type)&&r.startPosition.row<=e&&r.endPosition.row>=e&&n.push(r)}),n.sort((r,i)=>r.endPosition.row-r.startPosition.row-(i.endPosition.row-i.startPosition.row))[0]??null}function F(t){let e=t;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(e.type)&&e.namedChildCount===1;)e=e.namedChild(0);return e}function I(t,e){e(t);for(let n of t.namedChildren)I(n,e)}function _e(t){let e=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let r of t.matchAll(n)){let i=r[1],o=r[2];i&&o&&e.set(i,o)}return e}function W(t){let e=[];for(let n of t)e.some(r=>M(r,n))||e.push(n);return e}import{existsSync as Ae}from"fs";import{SymbolRole as Te}from"@c4312/scip";import{deserializeSCIP as Fe}from"@c4312/scip";function ce(t,e){return Fe(G(t,{inputKind:e,maxBytes:q}))}var Q=new WeakMap;function nt(t,e,n,r){let i=E(t,e),o=(i?.callSites??[]).filter(a=>a.line>=n&&a.line<=r);if(!i||o.length===0)return{available:!!i,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let m=V(t);if(!m)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:o.length};let u=(m.byFile.get(e)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=r).map(a=>({...a,calleeLeaf:a.definition.leaf})),l=ue(o.map(a=>({line:a.line,leaf:a.calleeLeaf}))),c=ue(u.map(a=>({line:a.sourceLine,leaf:a.calleeLeaf}))),p=new Set([...l].flatMap(([a,d])=>c.get(a)===d?[a]:[])),s=u.filter(a=>p.has(fe(a.sourceLine,a.calleeLeaf))),f=[...p].reduce((a,d)=>a+(l.get(d)??0),0);return{available:!0,targets:s,resolvedCallsites:f,unresolvedCallsites:Math.max(0,o.length-f)}}function rt(t,e,n,r){let i=V(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r)}:{available:!1,targets:[]}}function it(t,e,n,r){let i=V(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r&&Re(t,o.definition)).map(o=>({...o,calleeLeaf:o.definition.leaf}))}:{available:!1,targets:[]}}function V(t){if(Q.has(t))return Q.get(t)??null;let e=Me(t);return Q.set(t,e),e}function Me(t){if(!t.generation.indexPath||!Ae(t.generation.indexPath))return null;try{let e=Y(t),n=new Map(e.map(o=>[o.symbol,o])),r=ce(t.generation.indexPath,"SCIP source-range call-target index"),i=new Map;for(let o of r.documents??[]){let m=o.relativePath;if(!m||t.isIgnored(m))continue;let u=[];for(let l of o.occurrences??[]){if(!l.symbol||(l.symbolRoles&Te.Definition)!==0)continue;let c=n.get(l.symbol),p=l.range?.[0];!c||!Number.isInteger(p)||u.push({sourceLine:p,definition:c})}i.set(m,u)}return{byFile:i}}catch{return null}}function Re(t,e){if(!e.isFunctionLike)return!1;let n=E(t,e.relativePath);return!n||n.callables.some(r=>r.name===e.leaf&&r.startLine===e.startLine&&r.endLine===e.endLine)?!0:De(e)}function De(t){let e=t.documentation;if(!e)return!1;let n=t.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(e)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(e)}function ue(t){let e=new Map;for(let n of t){let r=fe(n.line,n.leaf);e.set(r,(e.get(r)??0)+1)}return e}function fe(t,e){return`${t}\0${e}`}export{Ve as a,qe as b,nt as c,rt as d,it as e,Re as f};
|
|
2
|
+
//# sourceMappingURL=chunk-FEQIQ26E.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{W as p}from"./chunk-SDPA5DKN.js";import{f as c}from"./chunk-VWLIOEEF.js";import{a as f,c as g,e as d}from"./chunk-DRENNWRG.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
|
|
2
|
+
FROM defn_enclosing_ranges der
|
|
3
|
+
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
4
|
+
JOIN documents d ON der.document_id = d.id
|
|
5
|
+
WHERE gs.kind IS NOT NULL
|
|
6
|
+
AND gs.kind != 0
|
|
7
|
+
AND gs.symbol NOT LIKE '%#'
|
|
8
|
+
AND d.relative_path IN (${i})
|
|
9
|
+
GROUP BY gs.kind`,...e);for(let u of l)t.set(u.kind,(t.get(u.kind)??0)+u.count)}return t}function S(n,s){let t=[];for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", ");t.push(...n.all(`SELECT gs.symbol,
|
|
10
|
+
gs.kind,
|
|
11
|
+
gs.documentation,
|
|
12
|
+
gs.enclosing_symbol,
|
|
13
|
+
d.relative_path,
|
|
14
|
+
der.start_line,
|
|
15
|
+
der.end_line
|
|
16
|
+
FROM defn_enclosing_ranges der
|
|
17
|
+
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
18
|
+
JOIN documents d ON der.document_id = d.id
|
|
19
|
+
WHERE (gs.kind IS NULL OR gs.kind = 0 OR gs.symbol LIKE '%#')
|
|
20
|
+
${n.symbolNoiseFor("gs")}
|
|
21
|
+
AND d.relative_path IN (${i})
|
|
22
|
+
ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
|
|
23
|
+
//# sourceMappingURL=chunk-FGB567HK.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-COTMS5KM.js";import{Gb as Z,Ub as h,Vb as ee,Wb as C,Yb as E,jc as te,lc as ne,n as H,o as X,pc as oe,v as w}from"./chunk-4UUCUASK.js";import{$b as L,Ac as D,Bc as x,Dc as I,Kb as q,Qc as _,Rc as Q,Tc as Y,dc as z}from"./chunk-OIVZ7PW6.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
|
|
3
|
+
`).map((i,c)=>({line:S(e.startLine+c),text:i}))},r=N(t,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}function ve(t){return{requested:t.requested,matched:t.matched,ambiguous:t.ambiguous,missing:t.missing,entries:t.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(e=>({file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
|
|
4
|
+
`).map((o,r)=>({line:S(e.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:t.bindingClosure.inline}}function S(t){return t+1}function Se(t,n){let e=x(t,n),o=Ke(e);for(let r of o)console.log(r)}function xe(t,n,e="No results found for resolved symbol."){return x(t,n).match?e:U(n,I(t,n,5))}function K(t,n,e,o){return{...N(t,n),[o]:e}}function U(t,n){let e=`No definition matched '${t}'.`;return n.length>0?`${e} Suggestions: ${n.join(", ")}`:e}function Ke(t){if(!t.match||t.total<=1)return[];let n=t.match,e=Math.max(0,t.total-1),o=[`Resolved: ${L(n.symbol)} (${n.relativePath}) -- ${e} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=t.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${h(s.startLine)})`).join("; ")}`),o.push(""),o}var Ue=k(({db:t,args:n,opts:e})=>{let o=T(n,0),r=R(e,"signatures"),s=H(t,o);if(R(e,"json")){P("outline",n,e,s);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
|
|
5
|
+
file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),s.length===0){console.log(`
|
|
6
|
+
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
|
|
7
|
+
No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
|
|
8
|
+
\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
|
|
9
|
+
Missing compiler constructs do not establish that the current text file is empty or irrelevant.`),console.log(`
|
|
10
|
+
\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
|
|
11
|
+
Compiler ownership is unavailable or empty for this exact file selector.`),console.log(`
|
|
12
|
+
\u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
|
|
13
|
+
Read current source exactly with: scip-query code ${W(o)}`);return}function i(c,a){for(let l of c){let u=" ".repeat(a),p=r&&l.signature?` - ${Ee(l.signature)}`:"";console.log(`${u}${ee(l.startLine,l.endLine)} ${l.shortName}${p}`),i(l.children,a+1)}}console.log(`
|
|
14
|
+
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550`),i(s,0),console.log(`
|
|
15
|
+
\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
|
|
16
|
+
These are compiler-owned identities and source ranges. Ownership and nesting do not establish execution or task relevance.`),console.log(`
|
|
17
|
+
\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
|
|
18
|
+
${we(s)} compiler construct(s) returned in ${s.length} top-level tree(s).`),console.log(`
|
|
19
|
+
\u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
|
|
20
|
+
Every displayed file:line is an exact evidence root. Exact top-level symbol selectors:`);for(let c of s){let a=`'${c.symbol.replaceAll("'","'\\''")}'`;console.log(` ${c.shortName}: ${a}`)}});function we(t){return t.reduce((n,e)=>n+1+we(e.children),0)}function Ee(t){return t.length>120?`${t.slice(0,117)}...`:t}var We=ie("refs",({db:t,args:n,opts:e,budget:o})=>{let r=T(n,0),s=j(e,"cursor"),i=ae(e,"limit"),c=M(t),a=s?ye(s,{command:"refs",target:r,indexGeneration:c}):void 0,l=!a&&i===void 0,u=l?qe(t,r,o.semantic):a?.version===1?ze(t,r,a.offset,i??50,o.semantic):_e(t,r,{limit:i??50,cursor:a,semantic:a?.semanticEnrichment??R(e,"full"),indexGeneration:c}),{rows:p,continuation:d,coverage:m}=u;if(R(e,"json")){let f={...K(t,r,p,"references"),pagination:u.pagination};P("refs",n,e,f,{analysisBudget:o.analysisBudget,coverage:m});return}if(p.length===0)return E.empty(xe(t,r,"No references found."));if(Se(t,r),E.groupedByFile(p,f=>` line ${h(f.line)}`),u.pagination.producer==="complete-only"&&!l&&console.error(`
|
|
21
|
+
This evidence provider required complete analysis; --limit bounded the returned rows, not analysis work.`),d){let f=m.totalKnown?`${m.omitted} omitted; `:"More references are available; ";console.log(`
|
|
22
|
+
${f}continue with --cursor ${d.cursor}`)}});function qe(t,n,e){let o=w(t,n,{semantic:e}).sort(b);return{rows:o,coverage:{complete:!0,totalKnown:!0,returned:o.length,total:o.length,omitted:0},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:e}}}function ze(t,n,e,o,r){let s=w(t,n,{semantic:r}).sort(b);if(e>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let i=s.slice(e,e+o),c=e+i.length,a=i[i.length-1],l=e===0&&i.length===s.length,u=c<s.length&&a?{cursor:J({command:"refs",target:n,after:a,producer:"complete-only",semanticEnrichment:r,indexGeneration:M(t)}),indexGeneration:M(t)}:void 0;return{rows:i,continuation:u,coverage:l?{complete:!0,totalKnown:!0,returned:i.length,total:i.length,omitted:0}:{complete:!1,totalKnown:!0,returned:i.length,total:s.length,omitted:s.length-i.length,...u?{continuation:u}:{}},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:r}}}function _e(t,n,e){let o=de(t,n,{limit:e.limit,after:e.cursor?.after,producer:e.cursor?.producer,semantic:e.semantic}),r=o.rows[o.rows.length-1],s=o.hasMore&&r?{cursor:J({command:"refs",target:n,after:r,producer:o.producer,semanticEnrichment:o.semanticEnrichment,indexGeneration:e.indexGeneration}),indexGeneration:e.indexGeneration}:void 0,i=!e.cursor&&!o.hasMore;return{rows:o.rows,continuation:s,coverage:i?{complete:!0,totalKnown:!0,returned:o.rows.length,total:o.rows.length,omitted:0}:{complete:!1,totalKnown:!1,returned:o.rows.length,...s?{continuation:s}:{}},pagination:{cursorVersion:2,producer:o.producer,semanticEnrichment:o.semanticEnrichment}}}var Qe=k(({db:t,args:n,opts:e})=>{oe(t.config.projectRoot,"code",e.session!==!1);let o=se(n,0),r=ce(e,"context",0),s=He(e),i=X(t,o,{context:r,members:s}),c=Re(i);if(R(e,"json")){if(c){let u=o[0];P("code",o,e,K(t,u,c,"code"),{resultOnly:be(t,u,c)});return}P("code",o,e,i,{coverage:{complete:!0,totalKnown:!0,returned:i.entries.length,total:i.requested,omitted:0},resultOnly:ve(i)});return}let a=c?et(c,i.bindingClosure,!0):Xe(i,!0);if(c){process.stdout.write(a);return}let l=i.entries[0];if(i.requested===1&&l?.status==="missing")return E.empty(U(l.selector,l.suggestions));process.stdout.write(a)}),Ye=k(({opts:t})=>{let n=R(t,"reset"),e=ne(n);if(!e.enabled){E.empty(e.reason??"Exploration-session deduplication is unavailable.");return}console.log(n?"Exploration-session ledger reset; subsequent exploration will emit evidence again.":`Exploration session: ${e.uniqueLines.toLocaleString()} unique source line(s) and ${e.evidenceItems.toLocaleString()} graph evidence item(s) delivered across ${e.emissions.toLocaleString()} emission(s).`),!n&&e.rows.length>0&&console.log(e.rows.join(`
|
|
23
|
+
`))});function He(t){let n=j(t,"members")??"exported";if(n==="exported"||n==="all")return n;throw new RangeError(`--members must be "exported" or "all", got "${n}".`)}function Xe(t,n=!1){let e=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` ${t.entries.map(a=>a.selector).join(", ")}`,"",`\u2550\u2550\u2550 OBSERVED FACTS (${t.requested} requested: ${t.matched} matched, ${t.ambiguous} ambiguous, ${t.missing} missing) \u2550\u2550\u2550`],o=new Set;for(let a of t.entries)for(let l of a.results){let u=`${l.relativePath}:${l.startLine}:${l.endLine}`;if(o.has(u)){e.push("",` ${a.selector}: source already included at ${C(l.relativePath,l.startLine,l.endLine)}.`);continue}o.add(u),(t.requested>1||a.status==="ambiguous")&&e.push("",` selector ${a.selector}`),$e(e,l,n)}let r=t.entries.filter(a=>a.kind==="file-source");if(r.length>0){e.push("","\u2550\u2550\u2550 FILE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of r)tt(e,a)}let s=t.entries.filter(a=>a.rangeCoverage);if(s.length>0){e.push("","\u2550\u2550\u2550 RANGE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of s)Ze(e,a)}let i=t.entries.filter(a=>a.status==="ambiguous");if(i.length>0){e.push("","\u2550\u2550\u2550 AMBIGUOUS SELECTORS \u2550\u2550\u2550");for(let a of i)nt(e,a)}let c=t.entries.filter(a=>a.status==="missing");if(c.length>0){e.push("","\u2550\u2550\u2550 MISSING SELECTORS \u2550\u2550\u2550");for(let a of c){let l=a.suggestions.length>0?` Suggestions: ${a.suggestions.join(", ")}`:"";e.push(` ${a.selector}: ${a.reason==="definition-source-unreadable"?"definition source unreadable.":"no definition matched."}${l}`)}}return Oe(e,t.bindingClosure),Pe(e,t.entries.flatMap(a=>a.results)),ot(e,t),`${e.join(`
|
|
24
|
+
`)}
|
|
25
|
+
`}function Ze(t,n){let e=n.rangeCoverage;if(e&&(t.push(` ${n.selector} \u2014 requested lines returned plus ${e.returnedBodies} same-file callable body(ies), covering ${e.returnedDefinitions}/${e.referencedDefinitions} statically attributed same-file definition(s).`,` basis: ${e.basis}; dynamic calls and references outside the requested lines are not claimed`),e.omittedLedger.length!==0)){t.push(" OMITTED REFERENCED DEFINITIONS");for(let o of e.omittedLedger)t.push(` ${C(o.relativePath,o.startLine,o.endLine)} ${o.shortName}`)}}function et(t,n,e=!1){let o=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` resolved-selector=${t.symbol}`,"","\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550"];return $e(o,t,e),Oe(o,n),Pe(o,[t]),o.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550"," One exact selector resolved to the complete source body shown; callers and runtime relationships are not implied."),`${o.join(`
|
|
26
|
+
`)}
|
|
27
|
+
`}function Pe(t,n){let e=n.flatMap(r=>r.freshness?[r.freshness]:[]);if(t.push("","\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550"," Source bodies are exact working-tree bytes; compiler identity and bindings are limited to reported semantic coverage."),e.length===0){t.push(" No source-freshness overlay was available.");return}let o={aligned:e.filter(r=>r.semantic.state==="aligned").length,stale:e.filter(r=>r.semantic.state==="stale").length,unavailable:e.filter(r=>r.semantic.state==="unavailable").length};t.push(` Freshness: ${e.length}/${n.length} text current; semantics ${o.aligned} aligned, ${o.stale} stale, ${o.unavailable} unavailable.`)}function $e(t,n,e){if(e){t.push(te({relativePath:n.relativePath,startLine:n.startLine,source:n.source,sessionPolicy:"exact-unit",ownerSymbol:n.shortName,headerSuffix:` ${n.shortName} [${n.language??"unknown"}]`,indent:"",sourceIndent:" ",showFocusMarker:!1,lineNumberWidth:4,blankAfterHeader:!0}));return}t.push(`${C(n.relativePath,n.startLine,n.endLine)} ${n.shortName} [${n.language??"unknown"}]`,"");let o=n.source.split(`
|
|
28
|
+
`);for(let r=0;r<o.length;r++)t.push(` ${String(h(n.startLine+r)).padStart(4)} ${o[r]}`)}function tt(t,n){let e=n.fileCoverage;if(!e||(t.push(` ${n.selector} \u2014 ${e.returnedBodies} source body(ies) cover ${e.returnedDefinitions}/${e.totalDefinitions} indexed definition(s); ${e.omittedDefinitions} omitted definition(s) disclosed below.`,` basis: ${e.basis}; members=${e.members}`),e.omittedLedger.length===0))return;t.push(" OMITTED FILE-LOCAL DEFINITIONS");for(let r of e.omittedLedger){let s=r.signature?` \u2014 ${Ee(r.signature)}`:"",i=r.nestedDefinitions>0?` (+${r.nestedDefinitions} nested definition(s))`:"";t.push(` ${" ".repeat(r.depth)}${C(r.relativePath,r.startLine,r.endLine)} ${r.shortName}${s}${i}`)}let o=e.omittedLedger.filter(r=>r.depth===0);for(let r=0;r<o.length;r+=24){let s=o.slice(r,r+24);t.push(` Read omitted units together: scip-query code ${s.map(i=>W(`${i.relativePath}:${h(i.startLine)}-${h(i.endLine)}`)).join(" ")}`)}}function nt(t,n){t.push(` ${n.selector} \u2014 ${n.totalCandidates} candidate(s); ${n.results.length>0?"all candidate bodies returned above":"no body selected"}.`);for(let e of n.candidates)t.push(` ${C(e.relativePath,e.startLine,e.endLine)} ${e.shortName}`);n.omittedCandidates>0&&t.push(` ... ${n.omittedCandidates} additional candidate identity(ies).`),n.candidates.length>0&&t.push(` Read shown candidates together: scip-query code ${n.candidates.map(e=>W(`${e.relativePath}:${h(e.startLine)}-${h(e.endLine)}`)).join(" ")}`)}function Oe(t,n){if(!(!n||n.inline.length===0)){t.push("","LITERAL VALUES");for(let e of n.inline)t.push(` inline ${e.name} @ ${C(e.relativePath,e.startLine,e.endLine)}`),t.push(` ${e.source??""}`)}}function ot(t,n){let e=n.entries.flatMap(d=>d.fileCoverage?[d.fileCoverage]:[]),o=n.entries.flatMap(d=>d.rangeCoverage?[d.rangeCoverage]:[]);if(e.length===0&&o.length===0){t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selector(s) resolved to shown source bodies; referenced definitions and runtime relationships are not claimed. Source lines use absolute file line numbers and are citation-ready.`);return}let r=e.reduce((d,m)=>d+m.returnedBodies,0),s=e.reduce((d,m)=>d+m.returnedDefinitions,0),i=e.reduce((d,m)=>d+m.totalDefinitions,0),c=e.reduce((d,m)=>d+m.omittedDefinitions,0),a=o.reduce((d,m)=>d+m.referencedDefinitions,0),l=o.reduce((d,m)=>d+m.returnedDefinitions,0),u=o.reduce((d,m)=>d+m.omittedDefinitions,0),p=[...e.length>0?[`${e.length} file selector(s) returned ${r} source body(ies) covering ${s}/${i} indexed definition(s); ${c} file-local definition(s) omitted and disclosed`]:[],...o.length>0?[`${o.length} range selector(s) covered ${l}/${a} statically attributed same-file definition(s); ${u} referenced definition(s) omitted and disclosed`]:[]];t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selectors resolved; ${p.join("; ")}. Source lines use absolute file line numbers and are citation-ready.`)}function W(t){return`'${t.replaceAll("'","'\\''")}'`}var Qt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[g("--reset","Clear this agent exploration-session ledger")],agent:pe("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",re("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:Ye},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:ge([g("--full","Run unbounded semantic analysis on large indexes"),g("-n, --limit <n>","Maximum reference sites to return",fe),g("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:F("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["scip-query refs login"]),handler:We},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...O("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,he(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:A([g("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:Ue},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...O("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Ce(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:A([g("-C, --context <n>","Extra lines of context above/below",me,0),g("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["scip-query code parseRequest handleRequest","scip-query code src/api.ts src/web.ts"]),handler:Qe}];export{gt as a,pt as b,me as c,fe as d,ht as e,g as f,Te as g,ge as h,A as i,$ as j,Ct as k,yt as l,Rt as m,bt as n,O as o,vt as p,pe as q,he as r,St as s,Ce as t,F as u,N as v,Se as w,xe as x,K as y,Qt as z};
|
|
29
|
+
//# sourceMappingURL=chunk-FHV7NMFU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as O,b as y,c as b,d as T,f as _,g as z,h as G}from"./chunk-35ELD3RM.js";import{b as J}from"./chunk-GTDP2SKQ.js";import{b as B}from"./chunk-OIRWZIYL.js";import{d as N}from"./chunk-CT5SI2I4.js";import{a as v,b as g,e as U,g as P,p as d}from"./chunk-SDPA5DKN.js";import{b as A}from"./chunk-VWLIOEEF.js";import{a as j,e as m}from"./chunk-HGFDYOVB.js";var ce={references:_,referenceMap:z,callerMap:(e,s)=>b(e).callerMap(s),calleeMap:q};function q(e,s){let a=j(),i=new Map,o=T(e,s),l=[],n=[],h=0,c=0,p=0,f=0,E=0,H=0,I=0;for(let{definition:t,callees:r}of o.hits)E+=1,r.length>0&&(H+=1,I+=r.length,i.set(t.symbolId,r));let u=K(e,o.hits);if(u.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(e,u.entries),()=>({entries:u.entries.length,sourceMissing:u.sourceMissing,skippedUnsupportedLanguage:u.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[t,r]of O(o.misses)){if(!y(t)){a&&(h+=r.length);continue}let R=d(e,t);if(!R){a&&(c+=r.length),n.push(...r);continue}let x=g(e,t,R),C=$(e,t);if(!C){n.push(...r);continue}let Y=U(e,t,x,C);for(let D of r){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}l.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:h,sourceMissing:c,cacheHits:p,parseFailures:f,misses:l.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:H,inMemoryCalleeCount:I,resultRows:i.size})),l.length===0&&n.length===0)return i;let k=[...n,...l.map(t=>t.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let t=G(e,k);return w=t.size,t},()=>({definitions:k.length,misses:l.length,unkeyed:n.length,rows:w}));for(let[t,r]of F)i.set(t,r);let S=l.filter(t=>b(e).capability("semantic-callees",t.def.relativePath).available).map(t=>({relativePath:t.def.relativePath,symbol:t.def.symbol,contentHash:t.contentHash,depsDigest:t.depsDigest,payload:JSON.stringify(F.get(t.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(e,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:l.length})),i}function K(e,s){let a=[],i=new Map,o=0,l=0;for(let{definition:n,callees:h}of s){if(!y(n.relativePath)){l+=1;continue}if(!i.has(n.relativePath)){let p=d(e,n.relativePath),f=p?$(e,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(e,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(h)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:l}}var Q="typescript-callees-v2-callsite-line";function $(e,s){let a=y(s);if(a==="typescript")return J(e,s,Q)?.key??null;let i=X(e,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:N(e.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(e){try{return JSON.parse(e)}catch{return null}}var W=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(e,s){return W.get(e,s,()=>{let i=[...B(e).get(s)??[]].sort().map(o=>`${o}:${g(e,o,d(e,o))}`);return v(i.join("|"))})}export{ce as a,q as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FTSQNONX.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as x}from"./chunk-B7ECWJAZ.js";import{C as b}from"./chunk-AA7K3XLM.js";import{z as p}from"./chunk-DMQ7ZKJG.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(e,t,n,r){if(!Number.isSafeInteger(n)||n<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=p(e,t);if(i.length===0||n>=i.length)return null;let o=Math.max(0,n-r),c=Math.min(i.length-1,n+r);return{relativePath:t,startLine:o,endLine:c,focusLine:n,source:i.slice(o,c+1).join(`
|
|
2
|
+
`)}}function F(e,t,n,r,i){let o=h(e,t,n,r);if(!o)return null;let c=b(e,t)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,n,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=p(e,t),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,d=Math.min(a.length-1,Math.max(u,S));return{relativePath:t,startLine:u,endLine:d,focusLine:n,source:a.slice(u,d+1).join(`
|
|
3
|
+
`),kind:"complete-call-expression"}}function L(e,t,n,r,i){if(!Number.isSafeInteger(i)||i<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${i}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=Math.min(o.length-1,r,n+i-1);return{relativePath:t,startLine:n,endLine:c,focusLine:n,source:o.slice(n,c+1).join(`
|
|
4
|
+
`)}}function k(e,t,n,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=x(e,t,n);if(!c){let m=h(e,t,n,i);return m?{...m,unitType:null,unitStartLine:m.startLine,unitEndLine:m.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=n-s-Math.floor(u/2),d=Math.max(0,Math.min(a-u,S)),f=s+d,g=f+u-1;return{relativePath:t,startLine:f,endLine:g,focusLine:n,source:o.slice(f,g+1).join(`
|
|
5
|
+
`),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(e,t,n){let r=[];return N(e,t,n,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(e,t,n,r){if(M(e,t)){y.has(e.type)&&w(e)===n&&r.push(e);for(let i of e.namedChildren)N(i,t,n,r)}}function w(e){let t=e.childForFieldName("function")??e.childForFieldName("constructor")??e.childForFieldName("method")??e.childForFieldName("name")??e.namedChild(0);return t?t.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(e,t){return e.startPosition.row<=t&&e.endPosition.row>=t}export{h as a,F as b,L as c,k as d};
|
|
6
|
+
//# sourceMappingURL=chunk-FUG6RPYY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as Q,d as Y,e as I}from"./chunk-UZFCZ7SJ.js";import{a as C,b as _,c as K,d as x,e as G,g as J,h as W}from"./chunk-G6OGPXJW.js";import{b as v}from"./chunk-H5EXS3HM.js";import{a as j,b as R,c as b,d as P}from"./chunk-3VLJ2DCA.js";import{S as U,W as T,h as y,u as q,v as f,w as V}from"./chunk-4DCKBY6T.js";import{watch as fe}from"fs";function Le(e){let t=!1,r=!1,i,n=[],s=()=>{r=!0;let o=i;i=void 0,o?.()};for(let o of new Set(e))try{let a=fe(o,{persistent:!1},s);a.on("error",()=>{}),n.push(a)}catch{}return{wait(o){return t||o<=0?(r=!1,Promise.resolve()):new Promise(a=>{let c=setTimeout(()=>{i===d&&(i=void 0),a()},o),d=()=>{clearTimeout(c),i===d&&(i=void 0),a()};i=d,(r||t)&&(r=!1,d())})},close(){if(!t){t=!0;for(let o of n)try{o.close()}catch{}n.length=0}s()}}}import{spawn as qe}from"child_process";import{existsSync as Ce,rmSync as oe}from"fs";import{dirname as nt,resolve as F}from"path";import{fileURLToPath as ot}from"url";import{createHash as me,randomUUID as O}from"crypto";import{existsSync as ve,linkSync as Se,readdirSync as ge,rmSync as m}from"fs";import{basename as ye,dirname as Re,join as u}from"path";var p=1,We=10*6e4,Ie=10080*6e4,k="requests",S="claims",w="completions",B="staging";function Ge(e,t,r={}){let i=r.now?.()??new Date,n=Ee(r.ttlMs),s=Ae(r.idempotencyKey),o=s?`key-${me("sha256").update(s).digest("hex")}`:`request-${(r.randomId??O)()}`,a={version:p,requestId:o,...s?{idempotencyKey:s}:{},createdAt:i.toISOString(),deadlineAt:new Date(i.getTime()+n).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},c=ie(e,o),d=M(e,c,a,r.onStage);if(d.published)return{disposition:"accepted",request:a,achievedDurability:d.achievedDurability,directorySync:d.directorySync};let l=D(c);if(!l)throw new Error(`Watch refresh request identity ${o} exists but is malformed.`);return{disposition:"duplicate",request:l}}function Je(e,t={}){let r=t.now?.()??new Date,i=`claim-${(t.randomId??O)()}`,n=Math.max(1,Math.floor(t.limit??64)),s=ee(e).sort(be),o=[];for(let a of s){if(o.length>=n)break;if(z(e,a.requestId))continue;if(Date.parse(a.deadlineAt)<=r.getTime()){Z(e,{version:p,requestId:a.requestId,outcome:"expired",completedAt:r.toISOString()});continue}let c={version:p,requestId:a.requestId,claimId:i,claimedAt:r.toISOString()};if(M(e,ne(e,a.requestId),c).published){if(z(e,a.requestId)){te(e,a.requestId,i);continue}o.push(a)}}return{claimId:i,requests:o}}function Qe(e,t,r=()=>new Date,i){let n=r().toISOString();for(let s of t.requests)Z(e,{version:p,requestId:s.requestId,claimId:t.claimId,outcome:"completed",completedAt:n});i?.("after-completion"),we(e,t),i?.("after-claim-release")}function we(e,t){for(let r of t.requests)te(e,r.requestId,t.claimId)}function Ye(e){let t=0;for(let r of h(u(e,S)))m(r,{force:!0}),t++;return t>0&&f(u(e,S)),re(e),t}function ze(e){let t=ee(e),r=new Map,i=ke(u(e,k),D);for(let c of h(u(e,w))){let d=E(c);if(!d){i++;continue}r.set(d.requestId,d)}let n=new Set;for(let c of h(u(e,S))){let d=X(c);if(!d){i++;continue}n.add(d.requestId)}let s=t.filter(c=>!r.has(c.requestId)&&!n.has(c.requestId)),o=[...r.values()].filter(c=>c.outcome==="completed").length,a=[...r.values()].filter(c=>c.outcome==="expired").length;return{pending:s.length,claimed:t.filter(c=>!r.has(c.requestId)&&n.has(c.requestId)).length,completed:o,expired:a,invalid:i,...s.length>0?{oldestPendingAt:s.map(c=>c.createdAt).reduce((c,d)=>Pe(c,d))}:{}}}function Be(e,t={}){let r=(t.now?.()??new Date).getTime(),i=Math.max(0,t.retentionMs??Ie),n=0;for(let s of h(u(e,w))){let o=E(s);!o||r-Date.parse(o.completedAt)<i||(m(s,{force:!0}),m(ie(e,o.requestId),{force:!0}),n++)}return n>0&&(f(u(e,w)),f(u(e,k))),re(e),n}function D(e){return L(e,t=>{let r=t;return r.version===p&&g(r.requestId)&&(r.idempotencyKey===void 0||typeof r.idempotencyKey=="string")&&v(r.createdAt)&&v(r.deadlineAt)&&Date.parse(r.deadlineAt)>=Date.parse(r.createdAt)&&typeof r.detail=="string"&&r.detail.length>0})}function X(e){return L(e,t=>{let r=t;return r.version===p&&g(r.requestId)&&g(r.claimId)&&v(r.claimedAt)})}function E(e){return L(e,t=>{let r=t;return r.version===p&&g(r.requestId)&&(r.claimId===void 0||g(r.claimId))&&(r.outcome==="completed"||r.outcome==="expired")&&v(r.completedAt)})}function Z(e,t){let r=se(e,t.requestId);if(M(e,r,t).published)return;let i=E(r);if(!i||i.requestId!==t.requestId||i.outcome!==t.outcome)throw new Error(`Watch refresh completion ${t.requestId} conflicts with an existing record.`)}function M(e,t,r,i){let n=u(e,B),s=Re(t),o=q(n),a=q(s),c=u(n,`${ye(t)}.${process.pid}.${O()}.tmp`);try{let d=W(c,r,{spacing:2,trailingNewline:!0});i?.("after-staged");try{Se(c,t)}catch(H){if(H.code==="EEXIST")return{published:!1};throw H}let l=V(o,a,d.directorySync,f(s));return i?.("after-published"),{published:!0,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}finally{m(c,{force:!0})}}function ee(e){let t=[];for(let r of h(u(e,k))){let i=D(r);i&&t.push(i)}return t}function te(e,t,r){let i=ne(e,t),n=X(i);!n||n.claimId!==r||(m(i,{force:!0}),f(u(e,S)))}function re(e){for(let t of h(u(e,B),".tmp"))m(t,{force:!0})}function ke(e,t){return h(e).filter(r=>!t(r)).length}function h(e,t=".json"){return ve(e)?ge(e,{withFileTypes:!0}).filter(r=>r.isFile()&&r.name.endsWith(t)).map(r=>u(e,r.name)).sort():[]}function L(e,t){try{let r=JSON.parse(y(e,"watch refresh request record"));return t(r)?r:null}catch{return null}}function ie(e,t){return u(e,k,`${t}.json`)}function ne(e,t){return u(e,S,`${t}.json`)}function se(e,t){return u(e,w,`${t}.json`)}function z(e,t){return E(se(e,t))!==null}function Ee(e){if(e===void 0)return We;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Ae(e){let t=e?.trim();return t?t.slice(0,512):void 0}function g(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function be(e,t){return Date.parse(e.createdAt)-Date.parse(t.createdAt)||e.requestId.localeCompare(t.requestId)}function Pe(e,t){return Date.parse(t)<Date.parse(e)?t:e}var Te=6e3,_e=1e3,ce=10;function mt(e,t,r){let i=T(F(e));if(r&&T(r.projectRoot)===i)return{projectRoot:i,worktreeKind:"git",worktreeId:r.worktreeId,cliVersion:t};let n=U(i);if(n.kind==="error")throw new Error(`Could not establish Git worktree identity for ${i}: ${n.message}`);return n.kind==="non-git"?{projectRoot:i,worktreeKind:"non-git",cliVersion:t}:{projectRoot:i,worktreeKind:"git",worktreeId:n.identity.worktreeId,cliVersion:t}}function vt(e){let t=e.runtime??De,r=Q(e.cacheDir),i=Y(r.statePath),n=i?de(i,t)?{kind:"live",state:i}:{kind:"stale",state:i,reason:"dead-process"}:{kind:"stopped"},s=xe("stop",n);if(s.kind==="signal-stop")return ae(s.state,e,t),N(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};if(s.kind==="clean-stale")return N(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};let o=le(r.lockPath);return s.kind==="already-stopped"&&o?(de(o,t)&&ae(o,e,t),N(r,o.pid,t),{disposition:"stopped",pid:o.pid}):{disposition:"already-stopped"}}function St(e,t,r={}){let{durability:i="durable",...n}=r;i==="durable"?W(e,t,n):J(e,t,n)}function gt(e){try{let t=JSON.parse(y(e,"watch activity record"));return t.version!==1||!I(t.at)||t.refreshRequestedAt!==void 0&&!I(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function yt(e,t,r={}){let i=r.pid??process.pid,n=r.isProcessAlive??C,s=()=>{},o=r.readProcessIdentity??b,a=r.now??(()=>new Date),c={..._,wallNow:()=>a().getTime(),isProcessAlive:n,readProcessIdentity:o},d=K(e,{kind:"watch",pid:i,processIdentity:o(i),detail:{projectRoot:F(t)},parseLegacy:A,runtime:c});if(d.kind==="contended"){let l=pe(d.observation);return{acquired:!1,lockPath:e,message:Oe(e,t,l),release:s}}return{acquired:!0,lockPath:e,message:"",release:()=>{d.lock.release()}}}function le(e){return pe(x(e,{parseLegacy:A}))}var A=e=>{let t=he(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function pe(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return he(e.parsed)}function he(e){try{let t=e;if(t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!I(t.startedAt))return null;let r=t.processIdentity===void 0?null:j(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{version:1,pid:t.pid,...r?{processIdentity:r}:{},projectRoot:t.projectRoot,startedAt:t.startedAt}}catch{return null}}function xe(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"refuse-replace",state:t.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return $(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return $(t)}default:return $(e)}}function Rt(e){return e.idleTimeoutMs===0||e.watcher.state!=="idle"?!1:e.nowMs-e.lastActivityAtMs>=e.idleTimeoutMs}function ae(e,t,r){let{pid:i}=e;if(!r.isProcessAlive(i))return;ue(e,r),r.signalProcess(i);let n=t.stopTimeoutMs??Te,s=r.monotonicNow??P,o=s()+n;for(;s()<=o;){if(!r.isProcessAlive(i))return;r.sleep(ce)}if(!r.forceSignalProcess)throw new Error(`scip-query watch service pid ${i} did not stop within ${n}ms and forced termination is unavailable.`);ue(e,r),r.forceSignalProcess(i);let a=t.forceStopTimeoutMs??_e,c=s()+a;for(;s()<=c;){if(!r.isProcessAlive(i))return;let d=r.readProcessIdentity(i);if(e.processIdentity&&d&&!R(e.processIdentity,d))return;r.sleep(ce)}throw new Error(`scip-query watch service pid ${i} remained alive ${a}ms after forced termination.`)}function N(e,t,r){if(oe(e.statePath,{force:!0}),oe(e.activityPath,{force:!0}),le(e.lockPath)?.pid===t){let n={..._,wallNow:r.now,isProcessAlive:r.isProcessAlive,readProcessIdentity:r.readProcessIdentity},s=x(e.lockPath,{parseLegacy:A,runtime:n});G(e.lockPath,s,{parseLegacy:A,runtime:n})}}function de(e,t){if(!t.isProcessAlive(e.pid))return!1;if(!e.processIdentity)return!0;let r=t.readProcessIdentity(e.pid);return r===null||R(e.processIdentity,r)}function Oe(e,t,r){return`error: scip-query watch is already running for ${F(t)}${r?` (pid ${r.pid}, started ${r.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}var De={now:Date.now,monotonicNow:P,isProcessAlive:C,readProcessIdentity:b,spawnServer(e,t,r,i){if(!Ce(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);qe(process.execPath,[e,t,r,JSON.stringify(i)],{detached:!0,stdio:"ignore",env:{...process.env,SCIP_QUERY_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function ue(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its ownership record has no process identity.`);let r=t.readProcessIdentity(e.pid);if(!r)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity is unavailable.`);if(!R(e.processIdentity,r))throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity does not match the ownership record.`)}function $(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}export{Le as a,Ge as b,Je as c,Qe as d,we as e,Ye as f,ze as g,Be as h,mt as i,vt as j,St as k,gt as l,yt as m,Rt as n};
|
|
2
|
+
//# sourceMappingURL=chunk-G2F6T5BV.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as E,b as I,c as le,d as B}from"./chunk-3VLJ2DCA.js";import{e as ae,g as de,h,r as v,s as _,t as ue,u as M,v as b,w as p}from"./chunk-4DCKBY6T.js";function me(r){try{return process.kill(r,0),!0}catch(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EPERM"}}import{randomUUID as $e}from"crypto";import{closeSync as _e,fsyncSync as Je,linkSync as je,mkdirSync as Ke,openSync as Ue,statSync as We,unlinkSync as ze,writeSync as Xe}from"fs";import{dirname as W}from"path";var j="scip-query-process-lock",K=1,O=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:me,readProcessIdentity:le,randomToken:()=>$e(),makeDirectory:r=>Ke(r,{recursive:!0}),openFile:(r,e,t)=>Ue(r,e,t),writeFile:(r,e,t,i)=>Xe(r,e,t,i),syncFile:r=>Je(r),closeFile:r=>_e(r),linkFile:(r,e)=>je(r,e),readFile:r=>h(r,"process lock record"),statFile:r=>{let e=We(r);return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs}},removeFile:r=>ze(r)});function $r(r,e){let t=e.runtime??O;t.makeDirectory(W(r));let i;for(let n=0;n<2;n+=1)try{return{kind:"acquired",lock:ye(r,e,t),...i?{reclaimed:i}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=L(r,{parseLegacy:e.parseLegacy,runtime:t});if(n===0&&Ve(r,s,{creationGraceMs:e.creationGraceMs,parseLegacy:e.parseLegacy,runtime:t})){i=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:L(r,{parseLegacy:e.parseLegacy,runtime:t})}}function L(r,e={}){let t=e.runtime??O,i,n;try{i=t.statFile(r),n=t.readFile(r)}catch(a){return a.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(n)}catch{return{state:"malformed",raw:n,identity:i}}let s=He(o);if(s)return{state:"valid",raw:n,identity:i,record:s,owner:Qe(s),parsed:o};let c=e.parseLegacy?.(o)??null;return c?{state:"legacy",raw:n,identity:i,owner:c,parsed:o}:{state:"malformed",raw:n,identity:i,parsed:o}}function He(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r;if(e.protocol!==j||e.version!==K||typeof e.kind!="string"||e.kind.trim()===""||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.token!="string"||e.token.trim()===""||typeof e.startedAt!="string"||!Number.isFinite(Date.parse(e.startedAt))||e.detail!==void 0&&(typeof e.detail!="object"||e.detail===null||Array.isArray(e.detail)))return null;let t=e.processIdentity===void 0?null:E(e.processIdentity);return e.processIdentity!==void 0&&(!t||t.pid!==e.pid)?null:{protocol:j,version:K,kind:e.kind,pid:e.pid,token:e.token,...t?{processIdentity:t}:{},startedAt:e.startedAt,...e.detail?{detail:e.detail}:{}}}function Ve(r,e,t={}){let i=t.runtime??O;if(!U(e,i))return!1;let n=Ye(`${r}.reclaim`,i);if(!n)return!1;try{let o=L(r,{parseLegacy:t.parseLegacy,runtime:i});return!be(e,o)||!U(o,i)?!1:z(r,i)}finally{n.release()}}function ye(r,e,t){let i=e.directoryDurability??"durable",n=e.pid??process.pid,o=t.randomToken(),s=e.processIdentity===void 0?t.readProcessIdentity(n):e.processIdentity,c={protocol:j,version:K,kind:e.kind,pid:n,token:o,...s?{processIdentity:s}:{},startedAt:new Date(t.wallNow()).toISOString(),...e.detail?{detail:e.detail}:{}},a=`${r}.${o}.candidate`,d=t.openFile(a,"wx",384),l;try{v(d,Buffer.from(`${JSON.stringify(c)}
|
|
2
|
+
`),t,"process lock"),t.syncFile(d)}catch(f){l=f}try{t.closeFile(d)}catch(f){l??=f}if(l!==void 0)throw J(a,t),l;try{t.linkFile(a,r)}catch(f){throw J(a,t),f}if(J(a,t),i==="durable")try{pe(W(r),t)}catch(f){throw Ge(r,c,t),f}let m=!1;return{path:r,record:c,release:()=>m?!1:(m=!0,fe(r,c,t,i))}}function Ge(r,e,t=O){return fe(r,e,t,"durable")}function fe(r,e,t,i){let n=L(r,{runtime:t});return n.state!=="valid"||!n.record||n.record.pid!==e.pid||n.record.token!==e.token||e.processIdentity&&(!n.record.processIdentity||!I(e.processIdentity,n.record.processIdentity))?!1:z(r,t,i)}function Ye(r,e){for(let t=0;t<2;t+=1)try{return ye(r,{kind:"reclaim-guard",runtime:e},e)}catch(i){if(i.code!=="EEXIST")return null;let n=L(r,{runtime:e});if(t>0||!U(n,e))return null;let o=L(r,{runtime:e});if(!be(n,o)||!z(r,e))return null}return null}function U(r,e){if(r.state==="missing")return!1;if(r.owner){if(!e.isProcessAlive(r.owner.pid))return!0;if(!r.owner.processIdentity)return!1;let t=e.readProcessIdentity(r.owner.pid);return t!==null&&!I(r.owner.processIdentity,t)}return!1}function be(r,e){return r.state===e.state&&r.raw===e.raw&&r.identity!==void 0&&e.identity!==void 0&&r.identity.dev===e.identity.dev&&r.identity.ino===e.identity.ino&&r.identity.size===e.identity.size&&r.identity.mtimeMs===e.identity.mtimeMs}function Qe(r){return{pid:r.pid,...r.processIdentity?{processIdentity:r.processIdentity}:{}}}function pe(r,e){let t;try{t=e.openFile(r,"r")}catch(i){if(_(i,process.platform))return;throw i}try{e.syncFile(t)}catch(i){if(!_(i,process.platform))throw i}finally{e.closeFile(t)}}function z(r,e,t="durable"){try{return e.removeFile(r),t==="durable"&&pe(W(r),e),!0}catch{return!1}}function J(r,e){try{e.removeFile(r)}catch{}}import{randomUUID as nr}from"crypto";import{closeSync as or,existsSync as sr,fsyncSync as cr,linkSync as ar,mkdirSync as dr,openSync as lr,renameSync as ur,unlinkSync as mr,writeSync as yr}from"fs";import{dirname as xe}from"path";import{chmodSync as Ze,constants as er,copyFileSync as rr}from"fs";import{dirname as tr}from"path";var ge=Object.freeze({...ue,copyFile:(r,e)=>rr(r,e,er.COPYFILE_FICLONE),chmodFile:(r,e)=>Ze(r,e)});function ir(r,e,t={}){let i=t.runtime??ge,n=tr(e),o=M(n,i);i.copyFile(r,e),t.mode!==void 0&&i.chmodFile(e,t.mode);let s=i.openFile(e,"r");try{i.syncFile(s)}finally{i.closeFile(s)}return p(o,b(n,i))}var we=Object.freeze({platform:process.platform,randomToken:()=>nr(),pathExists:r=>sr(r),makeDirectory:r=>dr(r,{recursive:!0}),openFile:(r,e,t)=>lr(r,e,t),writeFile:(r,e,t,i)=>yr(r,e,t,i),syncFile:r=>cr(r),closeFile:r=>or(r),renameFile:(r,e)=>ur(r,e),linkFile:(r,e)=>ar(r,e),removeFile:r=>mr(r)});function X(r,e,t={}){let i=t.durability??"visibility",n=t.runtime??we,o=xe(r),s=i==="durable"?M(o,n):(n.makeDirectory(o),"not-requested"),c=`${r}.tmp-${n.randomToken()}`,a=typeof e=="string"?Buffer.from(e):e,d,l=!1;try{d=n.openFile(c,"wx",t.mode??384),l=!0,v(d,a,n,"atomic file"),i==="durable"&&n.syncFile(d),n.closeFile(d),d=void 0,n.renameFile(c,r),l=!1;let m=i==="durable"?p(s,b(o,n)):"not-requested";return Me(i,m)}finally{if(d!==void 0)try{n.closeFile(d)}catch{}if(l)try{n.removeFile(c)}catch{}}}function N(r,e,t={}){let i=t.durability??"visibility",n=t.runtime??we;if(!n.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=xe(r),s=i==="durable"?M(o,n):(n.makeDirectory(o),"not-requested"),c=`${r}.tmp-${n.randomToken()}`,a=typeof e=="string"?Buffer.from(e):e,d,l=!1;try{d=n.openFile(c,"wx",t.mode??384),l=!0,v(d,a,n,"exclusive atomic file"),i==="durable"&&n.syncFile(d),n.closeFile(d),d=void 0,n.linkFile(c,r);let m=i==="durable"?b(o,n):"not-requested";n.removeFile(c),l=!1;let f=i==="durable"?p(s,m,b(o,n)):"not-requested";return Me(i,f)}finally{if(d!==void 0)try{n.closeFile(d)}catch{}if(l)try{n.removeFile(c)}catch{}}}function Me(r,e){return{requestedDurability:r,achievedDurability:r==="visibility"?"visibility":e==="synced"?"directory-durable":"file-flushed",directorySync:e}}function Fe(r,e,t={}){X(r,he(e,t),{durability:"visibility",runtime:t.runtime})}function H(r,e,t={}){return X(r,he(e,t),{durability:"durable",runtime:t.runtime})}function he(r,e){let t=JSON.stringify(r,null,e.spacing);return e.trailingNewline?`${t}
|
|
3
|
+
`:t}import{createHash as V,randomUUID as ve}from"crypto";import{existsSync as F,lstatSync as A,mkdirSync as pr,readdirSync as k,renameSync as G,rmSync as g}from"fs";import{basename as R,dirname as Y,join as y}from"path";function De(r){return q(r,fr)}function rt(r){return q(r,br)}function q(r,e){return Array.isArray(r)?`[${r.map(t=>q(t,e)).join(",")}]`:r&&typeof r=="object"?`{${Object.entries(r).sort(([t],[i])=>e(t,i)).map(([t,i])=>`${JSON.stringify(t)}:${q(i,e)}`).join(",")}}`:JSON.stringify(r)}function fr(r,e){return r.localeCompare(e)}function br(r,e){return r<e?-1:r>e?1:0}var Q=1,gr=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),x=class extends Error{constructor(t,i,n,o){let s=t==="item-too-large"?`request is ${o} bytes; per-item limit is ${n.maxItemBytes}`:t==="item-capacity"?`mailbox has ${i.totalItems} retained items; limit is ${n.maxItems}`:t==="byte-capacity"?`mailbox retains ${i.totalBytes} bytes and the request adds ${o}; limit is ${n.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=t;this.status=i;this.limits=n;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Pe=".owner.json",Z={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function mt(r){return{rootDir:r,pendingDir:y(r,"pending"),inflightDir:y(r,"inflight"),responseDir:y(r,"responses"),deadLetterDir:y(r,"dead-letter"),legacyRequestDir:y(r,"requests")}}function S(r={}){let e={...gr,...r};for(let[t,i]of Object.entries(e))if(!Number.isFinite(i)||i<=0||!Number.isInteger(i))throw new Error(`Mailbox limit ${t} must be a positive integer.`);return e}function T(r){let e=[r.pendingDir,r.inflightDir,r.responseDir,r.deadLetterDir,r.legacyRequestDir].map(t=>M(t));return p(...e)}function yt(r,e){return V("sha256").update(De({namespace:r,payload:e})).digest("hex")}function Ee(r){if(!/^[a-f0-9]{64}$/.test(r))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${r}`}function ft(r,e,t={}){let i=S(t.limits),n=t.nowMs??Date.now(),o=T(r);return Rr(e),re(r,i,t.admissionLockTimeoutMs??2e3,t.monotonicNow??B,t.durability??"durable",()=>{ee(r,n,i);let s=y(r.pendingDir,`${e.id}.json`),c=y(r.responseDir,`${e.id}.json`),a=ke(r,e.id);if(a){let f=Ie(a,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:c,authoritativeDeadlineAtMs:f.deadlineAtMs??e.deadlineAtMs}}let d=`${JSON.stringify(e)}
|
|
4
|
+
`,l=Buffer.byteLength(d),m=$(r);if(l>i.maxItemBytes)throw new x("item-too-large",m,i,l);if(m.totalItems+1>i.maxItems)throw new x("item-capacity",m,i,l);if(m.totalBytes+l>i.maxBytes)throw new x("byte-capacity",m,i,l);t.onBeforePublish?.();try{let f=t.durability??"durable",u=N(s,d,{durability:f}),w=f==="durable"?p(o,u.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:c,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:u.achievedDurability,directorySync:w}}catch(f){if(f.code!=="EEXIST")throw f;let u=ke(r,e.id);if(!u)throw f;let w=Ie(u,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:c,authoritativeDeadlineAtMs:w.deadlineAtMs??e.deadlineAtMs}}})}function xr(r,e){if(!e.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");if(e.owner&&(!Number.isSafeInteger(e.owner.pid)||e.owner.pid<=0||e.owner.processIdentity!==void 0&&e.owner.processIdentity.pid!==e.owner.pid))throw new Error("Mailbox claim process identity is invalid.");let t=e.nowMs??Date.now(),i=S(e.limits),n=T(r);try{return re(r,i,2e3,e.monotonicNow??B,e.durability??"durable",()=>wr(r,e.ownerId,t,i,e.liveness??Z,e.owner??{pid:process.pid},n,e.durability??"durable",e.onClaimStage))}catch(o){if(o instanceof x&&o.code==="admission-busy")return[];throw o}}function bt(r,e){return!Ae(r.pendingDir)&&!Ae(r.legacyRequestDir)?[]:xr(r,e)}function wr(r,e,t,i,n,o,s,c,a){ee(r,t,i,n);let d=y(r.inflightDir,C(e)),l=[...Le(r.pendingDir,!1),...Le(r.legacyRequestDir,!0)].sort((u,w)=>u.orderAtMs-w.orderAtMs||u.header.id.localeCompare(w.header.id)||u.path.localeCompare(w.path)),m=c==="durable"?s:"not-requested";l.length>0&&(c==="durable"?m=p(m,M(d)):pr(d,{recursive:!0}),a?.("after-owner-directory-durable"),Ir(d,e,o,c),a?.("after-owner-record-published"));let f=[];for(let u of l){if(f.length>=i.maxBatch)break;let w=y(r.responseDir,`${u.header.id}.json`);if(F(w)){g(u.path,{force:!0});continue}let ne=Math.max(t+i.claimLeaseMs,(u.header.deadlineAtMs??t)+5e3),Ne=`${C(u.originalFile)}.${ne}.claim`,oe=y(d,Ne);try{G(u.path,oe)}catch(se){let ce=se.code;if(ce==="ENOENT"||ce==="EEXIST")continue;throw se}a?.("after-claim-renamed");let qe=c==="durable"?b(Y(u.path)):"not-requested";a?.("after-source-directory-synced");let Ce=c==="durable"?b(d):"not-requested";a?.("after-destination-directory-synced");let Te=p(m,qe,Ce);f.push({requestId:u.header.id,ownerId:e,path:oe,originalFile:u.originalFile,claimedAtMs:t,claimExpiresAtMs:ne,byteLength:u.byteLength,...u.header.operationKey?{operationKey:u.header.operationKey}:{},...u.header.clientId?{clientId:u.header.clientId}:{},...u.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.header.enqueuedAtMs},...u.header.deadlineAtMs===void 0?{}:{deadlineAtMs:u.header.deadlineAtMs},legacy:u.legacy,directorySync:Te})}return f}function pt(r,e={}){let t=S(e);if(r.byteLength>t.maxItemBytes)throw new x("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:r.byteLength},t,r.byteLength);return de(r.path,{maxBytes:t.maxItemBytes,inputKind:"bounded mailbox item"})}function Mr(r,e,t,i={}){let n=i.nowMs??Date.now(),o=S(i.limits),s={...t,mailboxVersion:Q,operationKey:e.operationKey??`legacy-${e.requestId}`,clientId:e.clientId??"legacy",...e.deadlineAtMs===void 0?{}:{deadlineAtMs:e.deadlineAtMs},completedAtMs:n,expiresAtMs:n+o.responseRetentionMs},c=Buffer.byteLength(`${JSON.stringify(s)}
|
|
5
|
+
`),a=$(r);if(c>o.maxItemBytes)throw new x("item-too-large",a,o,c);let d=Math.max(0,a.totalBytes-e.byteLength)+c;if(d>o.maxBytes&&d>a.totalBytes)throw new x("byte-capacity",a,o,c);let l=i.durability??"durable";if(Fr(r,e,s,l),i.onAfterResponsePublished?.(),g(e.path,{force:!0}),l==="durable"){let m=Y(e.path);b(F(m)?m:r.inflightDir)}}function gt(r,e,t,i,n={}){let o=n.nowMs??Date.now(),s=S(n.limits);if(Mr(r,e,t,{...n,nowMs:o,limits:s}),!F(e.path)){let c=y(r.deadLetterDir,`${vr(e.requestId)}.${o}.${V("sha256").update(i).digest("hex").slice(0,12)}.json`),a={mailboxVersion:Q,requestId:e.requestId,ownerId:e.ownerId,rejectedAtMs:o,reason:i,originalFile:e.originalFile},d=Buffer.byteLength(`${JSON.stringify(a,null,2)}
|
|
6
|
+
`),l=$(r);l.totalItems<s.maxItems&&l.totalBytes+d<=s.maxBytes&&H(c,a,{spacing:2,trailingNewline:!0})}}function xt(r,e={}){let t=e.nowMs??Date.now(),i=S(e.limits);return T(r),re(r,i,2e3,e.monotonicNow??B,"durable",()=>ee(r,t,i,e.liveness??Z))}function ee(r,e,t,i=Z){let n={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=t.cleanupBatch;for(let s of ie(r.inflightDir)){if(o<=0)break;let c=y(r.responseDir,`${s.requestId}.json`);if(F(c)){g(s.path,{force:!0}),n.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||Lr(r,s.ownerId,i)!=="dead")continue;let a=y(r.pendingDir,s.originalFile);try{G(s.path,a),n.reclaimed++}catch(d){if(d.code!=="EEXIST")throw d;g(s.path,{force:!0})}b(Y(s.path)),b(r.pendingDir),o--}o=Re(r.responseDir,o,(s,c)=>c+t.responseRetentionMs,e,()=>{n.responsesRemoved++}),o=Re(r.deadLetterDir,o,(s,c)=>c+t.deadLetterRetentionMs,e,()=>{n.deadLettersRemoved++});for(let s of[r.pendingDir,r.inflightDir,r.responseDir,r.deadLetterDir,r.legacyRequestDir]){if(o<=0)break;for(let c of Oe(s)){if(o<=0)break;if(!R(c).includes(".tmp-"))continue;let a;try{a=A(c).mtimeMs}catch(d){if(d.code==="ENOENT")continue;throw d}a+t.temporaryRetentionMs>e||(g(c,{force:!0}),n.temporaryFilesRemoved++,o--)}}return Ar(r.inflightDir),n}function $(r){T(r);let e=[...D(r.pendingDir).map(a=>({path:a,pending:!0})),...D(r.legacyRequestDir).map(a=>({path:a,pending:!0}))],t=ie(r.inflightDir).map(a=>({path:a.path,pending:!1})),i=D(r.responseDir).map(a=>({path:a,pending:!1})),n=D(r.deadLetterDir).map(a=>({path:a,pending:!1})),o=[...e,...t,...i,...n],s=0,c;for(let a of e){let d=P(a.path);if(!d){s++;continue}let l=d.enqueuedAtMs;if(l===void 0)try{l=A(a.path).mtimeMs}catch(m){if(m.code==="ENOENT")continue;throw m}c=c===void 0?l:Math.min(c,l)}return{pending:e.length,inflight:t.length,responses:i.length,deadLetters:n.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((a,d)=>a+Sr(d.path),0),...c===void 0?{}:{oldestPendingAt:new Date(c).toISOString()}}}function Fr(r,e,t,i){let n=y(r.responseDir,`${e.requestId}.json`),o=`${JSON.stringify(t)}
|
|
7
|
+
`;try{N(n,o,{durability:i})}catch(s){if(s.code!=="EEXIST")throw s;let c=P(n),a=e.operationKey??`legacy-${e.requestId}`;if(c?.operationKey!==a)throw new Error(`Mailbox completion ${e.requestId} conflicts with an existing operation.`,{cause:s})}}function re(r,e,t,i,n,o){let s=y(r.rootDir,".admission.lock"),c=`${process.pid}-${ve()}`,a=i()+Math.max(0,t);for(;!hr(r.rootDir,s,c,n);){if(Dr(s),i()>=a)throw new x("admission-busy",$(r),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{te(s).ownerToken===c&&(g(s,{recursive:!0,force:!0}),n==="durable"&&b(r.rootDir))}catch{}}}function hr(r,e,t,i){let n=`${JSON.stringify({ownerToken:t,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
8
|
+
`;try{return N(e,n,{durability:i}),!0}catch(o){if(o.code==="EEXIST")return!1;try{te(e).ownerToken===t&&(g(e,{force:!0}),i==="durable"&&b(r))}catch{}throw o}}function Dr(r){let e=null;try{let i=te(r);typeof i.ownerToken=="string"&&Number.isSafeInteger(i.pid)&&Number(i.pid)>0&&(e=Number(i.pid))}catch{}if(e===null||kr(e))return;let t=`${r}.stale-${ve()}`;try{G(r,t)}catch(i){let n=i.code;if(n==="ENOENT"||n==="EEXIST")return;throw i}g(t,{recursive:!0,force:!0})}function te(r){try{return JSON.parse(h(r,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof ae&&e.reason==="not-regular"))throw e;return JSON.parse(h(y(r,"owner.json"),"mailbox lock owner record"))}}function kr(r){try{return process.kill(r,0),!0}catch(e){let t=e.code;return t==="EPERM"||t!=="ESRCH"}}function Ir(r,e,t,i){let n=y(r,Pe),o=t.processIdentity,s=Be(n);if(s&&s.ownerId===e&&s.pid===t.pid&&(!s.processIdentity&&!o||s.processIdentity&&o&&I(s.processIdentity,o)))return;if(D(r).some(a=>a.endsWith(".claim")))throw new Error(`Mailbox owner identity ${e} collides with retained work from another process instance.`);let c={version:1,ownerId:e,pid:t.pid,...o?{processIdentity:o}:{}};i==="durable"?H(n,c):Fe(n,c)}function Lr(r,e,t){let i=Be(y(r.inflightDir,C(e),Pe));if(!i)return"unknown";if(!t.isProcessAlive(i.pid))return"dead";if(!i.processIdentity)return"live";let n=t.readProcessIdentity(i.pid);return n?I(i.processIdentity,n)?"live":"dead":"unknown"}function Be(r){try{let e=JSON.parse(h(r,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let t=e.processIdentity===void 0?null:E(e.processIdentity);return e.processIdentity!==void 0&&(!t||t.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...t?{processIdentity:t}:{}}}catch{return null}}function ke(r,e){for(let t of[y(r.pendingDir,`${e}.json`),y(r.legacyRequestDir,`${e}.json`),y(r.responseDir,`${e}.json`)])if(F(t))return t;for(let t of ie(r.inflightDir))if(t.requestId===e)return t.path;return null}function Ie(r,e,t){let i=P(r);if(i?.operationKey===e)return i;if(R(r)===`${Ee(e)}.json`)return{id:t,operationKey:e};throw new Error(`Mailbox operation ${t} conflicts with an existing retained record.`)}function Rr(r){if(r.mailboxVersion!==Q||r.id!==Ee(r.operationKey)||!r.clientId.trim()||!Number.isFinite(r.enqueuedAtMs)||!Number.isFinite(r.deadlineAtMs)||r.deadlineAtMs<r.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function Le(r,e){return D(r).filter(t=>t.endsWith(".json")).map(t=>{let i=A(t),n=R(t,".json"),o=P(t)??{id:n};return{path:t,originalFile:R(t),header:o,byteLength:i.size,orderAtMs:o.enqueuedAtMs??i.mtimeMs,legacy:e}})}function ie(r){if(!F(r))return[];let e=[];for(let t of k(r,{withFileTypes:!0})){if(!t.isDirectory())continue;let i=Se(t.name);if(i===null)continue;let n=y(r,t.name);for(let o of k(n,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let c=Se(s[1]),a=Number(s[2]);if(c===null||R(c)!==c||!c.endsWith(".json")||!Number.isSafeInteger(a))continue;let d=y(n,o.name),l=P(d)??{id:R(c,".json")},m;try{m=A(d)}catch(f){if(f.code==="ENOENT")continue;throw f}e.push({requestId:l.id,ownerId:i,path:d,originalFile:c,claimedAtMs:m.mtimeMs,claimExpiresAtMs:a,byteLength:m.size,...l.operationKey?{operationKey:l.operationKey}:{},...l.clientId?{clientId:l.clientId}:{},...l.enqueuedAtMs===void 0?{}:{enqueuedAtMs:l.enqueuedAtMs},...l.deadlineAtMs===void 0?{}:{deadlineAtMs:l.deadlineAtMs},legacy:l.operationKey===void 0})}}return e.sort((t,i)=>t.claimedAtMs-i.claimedAtMs||t.path.localeCompare(i.path))}function P(r){try{let e=JSON.parse(h(r,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Re(r,e,t,i,n){for(let o of D(r)){if(e<=0)break;let s;try{s=A(o)}catch(c){if(c.code==="ENOENT")continue;throw c}t(o,s.mtimeMs)>i||(g(o,{force:!0}),n(),e--)}return e}function D(r){return F(r)?k(r,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(r,e.name)).sort():[]}function Ae(r){try{return k(r).some(e=>e.endsWith(".json"))}catch{return!1}}function Oe(r){if(!F(r))return[];let e=[];for(let t of k(r,{withFileTypes:!0})){let i=y(r,t.name);t.isFile()?e.push(i):t.isDirectory()&&e.push(...Oe(i))}return e.sort()}function Ar(r){if(F(r))for(let e of k(r,{withFileTypes:!0})){if(!e.isDirectory())continue;let t=y(r,e.name);k(t).some(i=>i.endsWith(".claim"))||g(t,{recursive:!0,force:!0})}}function Sr(r){try{return A(r).size}catch{return 0}}function C(r){return Buffer.from(r,"utf8").toString("base64url")}function Se(r){try{let e=Buffer.from(r,"base64url").toString("utf8");return C(e)===r?e:null}catch{return null}}function vr(r){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(r)?r:`invalid-${V("sha256").update(r).digest("hex")}`}export{me as a,O as b,$r as c,L as d,Ve as e,ir as f,Fe as g,H as h,De as i,rt as j,Q as k,mt as l,T as m,yt as n,Ee as o,ft as p,bt as q,pt as r,Mr as s,gt as t,xt as u,$ as v};
|
|
9
|
+
//# sourceMappingURL=chunk-G6OGPXJW.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as S,f as d}from"./chunk-VWLIOEEF.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".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"],L=[".vue"],f=[".tsx",".jsx"],g=[".vue"],b=[...f,...g],U=new Set(f),F=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),_=[...p].sort().join(","),E=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 X(e,t={}){let i=t.includeIndexed??!0,r=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):_,s=`${i?"1":"0"}|${r?"1":"0"}|${u}`;return I.get(e,s,()=>{let c=new Set;if(i)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(r)for(let a of C(e.config.projectRoot,o))e.isIgnored(a)||i&&c.has(a)||c.add(a);return[...c].sort()})}var I=S("source-files",{clearGroups:[]});function C(e,t){return O(e,t)??w(e,t)}function O(e,t){try{let i=x("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 n of i.split(`
|
|
2
|
+
`)){let o=n.trim();o&&(R(o)||t.has(l(o).toLowerCase())&&r.add(o))}return r}catch{return null}}function R(e){return e.split("/").some(t=>E.has(t))}function w(e,t){let i=new Set,r=n=>{let o=n?y(e,n):e,u;try{u=m(o,{withFileTypes:!0})}catch{return}for(let s of u)if(!E.has(s.name)){if(s.isDirectory()){r(n?`${n}/${s.name}`:s.name);continue}t.has(l(s.name).toLowerCase())&&i.add(n?`${n}/${s.name}`:s.name)}};return r(""),i}export{L as a,E as b,X as c};
|
|
3
|
+
//# sourceMappingURL=chunk-GFLTPNWV.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as I}from"./chunk-OIRWZIYL.js";import{A,u as T,w as R,z as b}from"./chunk-SF7X6QNW.js";import{a as k,i as N,k as G}from"./chunk-SDPA5DKN.js";import{d as H}from"./chunk-DOPCR5BY.js";import{c as z,f as O}from"./chunk-VWLIOEEF.js";import{e as M}from"./chunk-HGFDYOVB.js";import{l as C,n as B}from"./chunk-4DCKBY6T.js";function x(e){let t=v(e.projectFiles),n=new Set(t),a=new Map(e.snapshot.files.map(c=>[c.path,c])),s=e.snapshot.files.filter(c=>{let l=C(c.path,["typescript"]);return l==="config"||l==="ambient"}).map(c=>c.path),r=v([...t,...s]),i=r.find(c=>!a.has(c)),p=new Set(e.snapshot.files.map(c=>c.path)).size!==e.snapshot.files.length,m=!i&&r.some(c=>_(a.get(c))),f=k(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:v(e.snapshot.typescriptProjects),membership:t})),y=new Map;return{identityFor(c,l){if(!n.has(c))return g("target-outside-project");if(p)return g("duplicate-input-path");if(i)return g("missing-input-fingerprint");if(m)return g("unreadable-input");let u=[],o,d;if(e.graph===null)u.push("dependency-graph-unavailable"),d="whole-project",o=r;else{let F=U(c,e.graph,y);if(F.find(w=>!a.has(w)))return g("missing-input-fingerprint");if(o=v([...F,...s]),o.some(w=>_(a.get(w))))return g("unreadable-input");d="dependency-closure"}let h=o.map(F=>V(a.get(F)));return{version:1,key:k(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:l,projectIdentity:f,inputs:h})),mode:d,inputFiles:o,reasons:u}}}}function J(e,t){let n=new Set,a=[e];for(let s=0;s<a.length;s+=1){let r=a[s];if(!(r===void 0||n.has(r))){n.add(r);for(let i of[...t.get(r)??[]].sort())n.has(i)||a.push(i)}}return[...n].sort()}function U(e,t,n){let a=n.get(e);if(a)return a;let s=J(e,t);return n.set(e,s),s}function V(e){return{path:e.path,size:e.size,hash:e.hash}}function _(e){return e.size<0||e.hash==="unreadable"}function g(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function v(e){return[...new Set(e)].sort()}var W=z("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function D(e,t,n){let a=W.get(e,()=>q(e));if(!a)return null;let s=`${n}\0${t}`,r=a.identities.get(s);if(r)return r;let i=a.builder.identityFor(t,n);return a.identities.set(s,i),i}function S(e){return O(e,{includeIgnored:!1}).filter(T).sort()}function q(e){try{if(!e.generation.metadataRaw)return null;let t=H(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=B(t.metadata.fingerprint);return n?{builder:x({projectFiles:S(e),snapshot:n,graph:I(e),engineIdentity:R()}),identities:new Map}:null}catch{return null}}var E="typescript-reference-fragment-v2",P=N({kind:"typescript-reference-fragments",invalidation:G("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:Y});function he(e,t,n,a=e){let s=S(e),r=x({projectFiles:s,snapshot:t,graph:I(e),engineIdentity:R()}),i=[...n].map(([p,m])=>({relativePath:p,contentHash:r.identityFor(p,E).key,value:[...m]}));if(i.some(p=>p.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return P.writeBatch(a,i.map(p=>({...p,contentHash:p.contentHash}))),i.length}function Fe(e,t,n,a){let s=t.filter(i=>T(i.relativePath));if(s.length===0)return j("no TypeScript definitions");let r=j("shadow did not run");return M("typescript.reference-fragments.shadow",()=>{try{let i=a(s[0].relativePath);if(!i.availability().available||!i.referenceFragmentsForFiles)return r=j("TypeScript reference fragment provider is unavailable"),r;let p=S(e),m=new Set(p),f=i.referenceFragmentsForFiles(p),y=b(s,f),c=A(s,L(n,m),y);if(!c.passed)return r={state:"failing",files:p.length,keyedFiles:0,writtenFiles:0,...c},r;let l=[];for(let u of p){let o=D(e,u,E);o?.key&&l.push({relativePath:u,contentHash:o.key,value:f.get(u)??[]})}return P.writeBatch(e,l),r={state:"passing",files:p.length,keyedFiles:l.length,writtenFiles:l.length,...c},r}catch(i){return r=j(i instanceof Error?i.message:String(i)),r}},()=>({...r}))}function L(e,t){return new Map([...e].map(([n,a])=>[n,a.filter(s=>t.has(s.file))]))}function Ie(e,t,n){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let a="fallback",s=0,r=0,i=0,p=0;return M("typescript.reference-fragments.materialize",()=>{try{let m=S(e);s=m.length;let f=new Map,y=new Map,c=[];for(let o of m){let d=D(e,o,E);if(!d?.key)return null;f.set(o,d.key);let h=P.read(e,o,d.key);h===null?(i+=1,c.push(o)):(r+=1,y.set(o,h))}if(i===0)return a="hit",{references:b(t,y),files:s,cacheHits:r,cacheMisses:i,computedFiles:p};let l=n(t[0].relativePath);if(!l.availability().available||!l.referenceFragmentsForFiles)return null;let u=l.referenceFragmentsForFiles(c);if(c.some(o=>!u.has(o)))return null;p=u.size,P.writeBatch(e,c.map(o=>({relativePath:o,contentHash:f.get(o),value:u.get(o)??[]})));for(let[o,d]of u)y.set(o,d);return a="computed",{references:b(t,y),files:s,cacheHits:r,cacheMisses:i,computedFiles:p}}catch{return null}},()=>({state:a,files:s,cacheHits:r,cacheMisses:i,computedFiles:p}))}function j(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function Y(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every($)?null:t}catch{return null}}function $(e){if(!e||typeof e!="object")return!1;let t=e,n=t.location;return typeof t.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}export{x as a,D as b,he as c,Fe as d,Ie as e};
|
|
2
|
+
//# sourceMappingURL=chunk-GTDP2SKQ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-SKUMCCC5.js";import{a as t}from"./chunk-OIRWZIYL.js";function a(e,o){let r=i(e,o);return r?t(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=i(e,o);return r?t(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-H46QMB7E.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function i(n){return typeof n=="string"&&Number.isFinite(Date.parse(n))}function o(n){return e(n)&&Object.values(n).every(t=>typeof t=="string"||t===null)}function s(n){return typeof n=="string"&&n.length>0}function u(n){return typeof n=="number"&&Number.isSafeInteger(n)&&n>=0}function g(n){return typeof n=="number"&&Number.isSafeInteger(n)&&n>0}var r=/^[a-f0-9]{64}$/u;function f(n){return typeof n=="string"&&r.test(n)}function p(n){return typeof n=="string"&&n.length>0&&n.length<=256&&!/[\0\r\n]/u.test(n)}function c(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0}export{e as a,i as b,o as c,s as d,u as e,g as f,f as g,p as h,c as i};
|
|
2
|
+
//# sourceMappingURL=chunk-H5EXS3HM.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as p}from"./chunk-35IW3P4H.js";import{a as T}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-7COHFNJK.js";import{a as A,e as h,t as D}from"./chunk-5IZTXSOL.js";import{v as O}from"./chunk-I3U2FN2T.js";import{a as S}from"./chunk-AA7K3XLM.js";import{d as u,z as j}from"./chunk-DMQ7ZKJG.js";import{h as m,i as w,j as _}from"./chunk-7HU2IJ2T.js";import{c as l}from"./chunk-MO226P4Q.js";import{existsSync as b,readdirSync as M}from"fs";import{join as d}from"path";var it={files:new Set,pathPrefixes:[]},at={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,ot=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],ct=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ut=4,ft=u("package-surface",{clearGroups:["whole-project"]}),lt=u("package-operational-surface",{clearGroups:["whole-project"]});function $(t){return ft.get(t,()=>pt(t.config.projectRoot))}function x(t,e){let n=$(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function I(t,e){return $(t).files.has(e)}function gt(t){return lt.get(t,()=>dt(t.config.projectRoot))}function ce(t,e){return gt(t).reasonsByFile.get(e)??[]}function pt(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of St(r))U(t,s,i,e,n);return e.size===0&&n.length===0?it:{files:e,pathPrefixes:n}}function dt(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=mt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of ht(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?at:{reasonsByFile:e}}function L(t){let e=[],n=X(t,"");return n&&e.push({manifest:n,packageRoot:""}),V(t,"",e,0),e}function V(t,e,n,r){if(r>=ut)return;let s=d(t,e);if(b(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||ct.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=X(t,a);o&&n.push({manifest:o,packageRoot:a}),V(t,a,n,r+1)}}function X(t,e){let n;try{n=m(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!w(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function St(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function mt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function ht(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;U(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function U(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(ot,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of C)bt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function bt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||b(d(t,s)))return;let i=C.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);yt(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function yt(t,e,n,r,s){let i=f(n,`${r}/index${s}`);b(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!b(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as Pt}from"fs";import{dirname as xt,join as k}from"path";var Et={rootFiles:new Set,sourcePrefixes:[]},kt=new Set([".git",".scipquery","node_modules","target"]),Rt=6,Tt=u("rust-library-surface",{clearGroups:["whole-project"]});function W(t,e,n){if(!n.endsWith(".rs")||!jt(wt(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Ot(j(t,n)[r.startLine]??""):!1}function wt(t){return Tt.get(t,()=>_t(t.config.projectRoot))}function _t(t){let e=new Set,n=new Set;for(let r of Nt(t)){let s=m(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=At(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!Dt(s)&&_(t,a)?a:null;if(!o)continue;e.add(o);let c=xt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?Et:{rootFiles:e,sourcePrefixes:[...n].sort()}}function jt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:vt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Ot(t){return/^\s*pub\s+(?!\()/.test(t)}function Nt(t){if(!E(t))return[];let e=[];return H(t,"",e,0),e}function H(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let i of Pt(s,{withFileTypes:!0})){if(!i.isDirectory()||kt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;H(t,a,n,r+1)}}function At(t){let e=!1;for(let n of t.split(`
|
|
2
|
+
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Dt(t){let e=!1;for(let n of t.split(`
|
|
3
|
+
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function vt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Ft(t){return p(t)==="barrel"}function q(t){return Mt.get(t,()=>{let n=S(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=N(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Mt=u("live-barrels",{clearGroups:["whole-project"]});function Ct(t,e){return q(t).has(l(e))}function Ne(t){let e=q(t);return S(t,{includeIgnored:!1}).filter(n=>Ft(n)&&!e.has(n)&&!$t(t,n))}function $t(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
+
FROM defn_enclosing_ranges der
|
|
5
|
+
JOIN documents d ON d.id = der.document_id
|
|
6
|
+
WHERE d.relative_path = ?
|
|
7
|
+
AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function Ae(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||ee(n)||Ct(t,n)}function It(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Xt(t,e,r)&&s.push("transitive-package-surface"),W(t,e,r)&&s.push("rust-public-library"),te(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>re(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return T(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function De(t,e,n){return It(t,e,n).length>0}var Lt=u("package-surface-reachability",{clearGroups:["whole-project"]}),Vt=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Xt(t,e,n){let r=Bt(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function ve(t,e,n){let r=Ut(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function Bt(t){return Lt.get(t,()=>Y(t,e=>x(t,e)))}function Ut(t){return Vt.get(t,()=>Y(t,e=>I(t,e)))}function Y(t,e){let n=new Map,r=[];for(let s of S(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of O(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Gt(i,a);o!==void 0&&Wt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Gt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Wt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Z=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Ht=new Set(["default","generateMetadata","generateStaticParams"]),Kt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),qt=new Set(["default","middleware","config"]),Yt=new Set(["register","onRequestError"]),Zt=new Set(["onRouterTransitionStart"]),Jt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Qt=new Set(["load","actions","entries",...Z]),zt=new Set(["default"]);function te(t,e){let n=h(t);return n===""?!1:J(e)?Z.has(n):Q(e)?Ht.has(n):z(e)?Kt.has(n):tt(e)?qt.has(n):et(e)?Yt.has(n):nt(e)?Zt.has(n):rt(e)?Jt.has(n):st(e)?Qt.has(n):ne(e)?zt.has(n):!1}function ee(t){return J(t)||Q(t)||z(t)||tt(t)||et(t)||nt(t)||rt(t)||st(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function z(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return R(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function et(t){return R(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function nt(t){return R(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function R(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function rt(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ne(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function re(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(K(r)+"/")&&t.includes(K(s)+".")}function K(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ce as b,Ft as c,Ct as d,Ne as e,Ae as f,It as g,De as h,ve as i,ee as j};
|
|
8
|
+
//# sourceMappingURL=chunk-HEOMG7IM.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as D}from"./chunk-35NLDRZC.js";import{b as C}from"./chunk-7COHFNJK.js";function v(t,n={}){let{limit:o=10,scope:s,minDepth:h=3,edgeBasis:c="symbol-references"}=n,u=C(t,s,c==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:p,componentOf:y}=D(u),m=new Map;for(let e=0;e<p.length;e++)m.set(e,new Set);for(let[e,a]of u){let i=y.get(e);for(let l of a){let r=y.get(l);r!==i&&m.get(i).add(r)}}let f=new Array(p.length),b=new Array(p.length);for(let e=0;e<p.length;e++){let a=[],i=0;for(let l of[...m.get(e)].sort((r,d)=>r-d)){let r=b[l];(r>i||r===i&&I(f[l],a,p)<0)&&(i=r,a=f[l])}f[e]=[e,...a],b[e]=1+i}function R(e){return f[e]}let w=p.map(e=>[...e].sort()),S=new Set,g=[];for(let e=0;e<p.length;e++){let i=R(e).map(d=>w[d]),l=i.map(d=>d[0]);if(i.length<h)continue;let r=l.join(" ");S.has(r)||(S.add(r),g.push(j(l,i,c)))}return g.sort((e,a)=>a.depth-e.depth||e.chain.join("\0").localeCompare(a.chain.join("\0"))),B(g).slice(0,o)}function K(t,n={}){return v(t,n)}function I(t,n,o){if(n.length===0)return-1;let s=t.map(c=>[...o[c]].sort()[0]??"").join("\0"),h=n.map(c=>[...o[c]].sort()[0]??"").join("\0");return s.localeCompare(h)}function j(t,n,o){let s=n.reduce((c,u)=>c+u.length,0),h=n.filter(c=>c.length>1).length;return{chain:t,components:n,depth:n.length,fileCount:s,edgeBasis:o,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${n.length} condensed dependency component(s) form the representative transitive path`,`${s} file(s) are represented; ${h} component(s) contain a dependency cycle`,`edge basis: ${o==="imports"?"resolved file imports":"cross-file symbol references plus resolved source imports"}`,"cycles count once toward depth and retain their full membership separately"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function B(t){let n=[];for(let o of t)n.some(s=>E(o.chain,s.chain))||n.push(o);return n}function E(t,n){if(t.length>=n.length)return!1;let o=n.length-t.length;for(let s=0;s<t.length;s++)if(t[s]!==n[o+s])return!1;return!0}export{v as a,K as b};
|
|
2
|
+
//# sourceMappingURL=chunk-HG5YI7PV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-QBANU5BQ.js";import{c as m}from"./chunk-JVZNWJBH.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-5IZTXSOL.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HGKEAP7F.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u}from"./chunk-LPGDO2XA.js";import{b as i}from"./chunk-AA7K3XLM.js";import{existsSync as h}from"fs";import{isAbsolute as p,join as g}from"path";function D(e,n){let t=l(e,n,{allowMultiple:!1})[0]?.relativePath;return t||d(e,n)}function P(e,n){return l(e,n,{allowMultiple:!0}).map(t=>t.relativePath)}function S(e,n){let t=l(e,n,{allowMultiple:!0});return t.length===1?t[0].relativePath:null}function I(e,n){let t=i(e,n,{allowMultiple:!0,requirePathMatch:!0});return t.length===1?t[0].relativePath:null}function d(e,n){if(!n)return null;let t=n.replace(/\\/g,"/").replace(/^\.\//,""),r=p(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,o=g(e.config.projectRoot,r);return h(o)?r:null}function l(e,n,t){let r=d(e,n);if(r)return i(e,r,t).filter(a=>a.relativePath===r);let o=n.replace(/\\/g,"/").replace(/^\.\//,""),s=p(o)||o.includes("/"),c=i(e,n,{...t,requirePathMatch:s});if(c.length===0){if(s)return[];let a=u(e,n);return!a||e.isIgnored(a.relativePath)?[]:[{relativePath:a.relativePath,score:700}]}return c}export{D as a,P as b,S as c,I as d};
|
|
2
|
+
//# sourceMappingURL=chunk-HUZNZ3H2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as u}from"./chunk-BOJ5SVE2.js";import{a as t}from"./chunk-6BJ7SOY7.js";import{a as p,b as h}from"./chunk-ICUQONOG.js";import{a as m}from"./chunk-LPGDO2XA.js";import{d as c,h as d}from"./chunk-5IZTXSOL.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-HWLCBKFE.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{A as Y,B as Ge,C as D,D as Q,E as Ye,F as be,G as Qe,H as oe,J as Ze,e as Be,f as Ue,g as P,h as qe,i as Ve,j as ze,k as q,l as We,m as H,n as He,o as Je,p as Ke,q as F,r as J,s as L,t as ge,u as Se,v as S,w as he,x as Xe,y as xe,z as G}from"./chunk-AA7K3XLM.js";import{a as $e,c as U,f as se,h as W,n as ye,u as K,w as X,x as A}from"./chunk-DMQ7ZKJG.js";import{c as ne}from"./chunk-MO226P4Q.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function es(e){return et(e,{maskStrings:!1})}function ts(e){return et(e,{maskStrings:!0})}function et(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
|
|
2
|
+
`,n),a=i===-1?s:i;t+=Ne(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=Ne(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
|
|
3
|
+
`)break;a+=1}t+=r.maskStrings?Ne(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function Ne(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
|
|
4
|
+
`?`
|
|
5
|
+
`:" ";return n}function k(e){return e.replace(/[^\r\n]/g," ")}var rs=se("stripped-lines",{clearGroups:["whole-project","source-file"]});$e({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{ie=null,Z=""},clearFile:()=>{ie=null,Z=""}});var ie=null,Z="";function Dt(e){return ie===e||(ie=e,Z=jt(e)),Z}function w(e,r,t){let n=Dt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function V(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Ie(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}function Ce(e,r){r(e);for(let t of e.namedChildren)Ce(t,r)}function Ot(e,r,t){let n=null;return Ce(e,s=>{!/(?:function|method|lambda)/u.test(s.type)&&s.type!=="arrow_function"||s.startPosition.row>r||s.endPosition.row<t||(!n||s.endIndex-s.startIndex<n.endIndex-n.startIndex)&&(n=s)}),n}function tt(e,r,t){if(e.startPosition.row>r||e.endPosition.row<t)return null;for(let n of e.namedChildren){let s=tt(n,r,t);if(s)return s}return e}function vt(e){let r=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(r.type)&&r.namedChildren.length>0;)r=r.namedChildren[0];return r}function _e(e){if(e.type==="identifier")return e.text;let r=e.childForFieldName("name")??e.childForFieldName("pattern");return r?_e(r):e.namedChildren.find(t=>t.type==="identifier")?.text??null}function Mt(e){return(e.childForFieldName("parameters")??e.namedChildren.find(t=>/parameters/u.test(t.type)))?.namedChildren.map(_e)??[]}var $t=new Set(["identifier","type_identifier","field_identifier"]),Bt=new Set(["identifier"]),Ut=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),qt=new Set(["rust","python"]),Vt=/\{([^{}]*)\}/g,zt=/\b([A-Za-z_][\w]*)\b/g;function rt(e,r){return Wt(r).has(e.type)}function nt(e,r){return qt.has(r)&&e.type==="string_content"}function Pe(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function Wt(e){return e==="rust"?$t:e==="python"?Bt:Ut}function st(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(Vt)){let s=n[1]??"";for(let o of s.matchAll(zt))o[1]&&r(o[1],t)}}var Ht=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Jt=/^#!?\[\s*serde\s*\(/,Kt=/^#!?\[\s*schemars\s*\(/,Xt=/^#!?\[\s*validate\s*\(/,Gt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function ot(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=be(n);if(!s||!Gt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function it(e,r){let t=Jt.test(e),n=Kt.test(e),s=Xt.test(e);if(!(!t&&!n&&!s))for(let o of Ht){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function at(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(p=>p.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&o(c,a);let l=i.namedChildren.find(p=>p.type==="block");if(l)for(let p of l.descendantsOfType("type"))for(let u of p.descendantsOfType("identifier"))u.text!==a&&n(u.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var Yt=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Te=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function ct(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
6
|
+
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ce(e,a);continue}if(l==='"'){let h=te(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Qt(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Re(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ee(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let f={text:m,line:p};Zt(o[o.length-1],f),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:sr(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Qt(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=Yt.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(er(e,r),!n||Te.has(t.text)||Te.has(n)||n.startsWith(":"))return;let o=nr(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function Zt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function er(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ae(e))ee(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of ae(e))ee(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ae(e))ee(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of ae(e)){n&&ee(r,n,"extension",s,"extension-method");let o=rr(e,s.startLine);o&&o!==n&&ee(r,o,"extension",s,"extension-method")}}}function ae(e){return e.children.filter(tr)}function tr(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!Te.has(r)&&!r.startsWith(":"))}function ee(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function rr(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function nr(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ce(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
7
|
+
`;)t+=1;return t}function te(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
8
|
+
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Re(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ee(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function sr(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var lt=6,or=se("source-facts",{clearGroups:["whole-project","source-file"]}),Fe=K({kind:"source-facts",invalidation:X("source-facts"),serialize:lr,deserialize:pr});function R(e,r){return ir(e,r).facts}function ir(e,r){let t=A(e,r);if(!t)return{facts:null};let n=ar(e,r,t);return n?or.get(e,r,t,()=>cr(e,r,n,t)):{facts:null}}function ar(e,r,t){return Y(r)?Ge(e,r,t)?.language??null:G(r)}function cr(e,r,t,n){let s=W(e,r,n),o=Fe.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=ct(n);return Fe.write(e,r,s,c),{facts:c}}let i=D(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=dr(i,t);return Fe.write(e,r,s,a),{facts:a}}function lr(e){let r={version:lt,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function pr(e){try{let r=JSON.parse(e);if(r.version!==lt||r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:Pe(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function ur(e,r,t,n){let s=R(e,r);return s?fr(s,t,n)?.isLiteralPassthrough??!0:!0}function mr(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:R(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function fr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function dr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=oe(l,r);p&&t.push(p);let u=Ye(l,r);u&&n.push(u),ot(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&it(l.text,s),rt(l,r)&&a(l.text,l.startPosition.row),nt(l,r)&&st(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:at(e,r),identifierLineMap:i,identifiersByLine:Pe(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var pt=new Set(["rust","typescript","tsx","javascript","python","clojure"]),gr=new Set(["rust","typescript","tsx","javascript","python"]);function Sr(e,r){let t=R(e,r);return!t||!pt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function hr(e,r){if(!gr.has(r))return null;let t=[];for(let n of e.descendantsOfType([...Qe(r)])){let s=oe(n,r);s&&t.push({name:s.name,startLine:s.startLine,endLine:s.endLine})}return t}function xr(e,r){let t=R(e,r);return!t||!pt.has(t.language)?null:t.callSites}function yr(e,r){return R(e,r)?.typeContainerMap??new Map}function br(e,r,t={}){let n=R(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as ut}from"path";var Nr=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&Nr.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function T(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Ke(r)),kind:"named",used:x(t,o),usedMembers:[]}}function d(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function E(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function v(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function M(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=w(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n,s){let o=Q(e,r,s)?.tree??null;if(o){let i=t(o);if(i)return i}return n()}function le(e,r,t,n,s){let o=Q(e,r,s)?.tree??null,i=G(r),a=i?t[i]:void 0;return o&&a?a(o):n()}function mt(e,r,t){return C(e,r,n=>Cr(e,r,n),()=>Ir(e,r,t),t)}function Ir(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=ut(o).replace(/\.[^.]+$/,"");return[E(o,i,Se(e,r,o),x(s,i))]})}function Cr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=ut(i).replace(/\.[^.]+$/,"");s.push(d(i,a,Se(e,r,i),n))}return s}var _r=new Set([":require",":require-macros",":use"]),ke=String.raw`A-Za-z0-9_$*+!?.<>=-`;function dt(e,r,t){let n=Dr(t);if(!n)return[];let s=jr(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=_(i.children[0]);if(a){if(_r.has(a)){for(let c of Rr(i.children.slice(1)))o.push(...Tr(e,c,s));continue}if(a===":import")for(let c of Fr(i.children.slice(1)))o.push(c)}}return o}function Pr(e){return e.type==="list"&&_(e.children[0])==="ns"}function Tr(e,r,t){let n=Xe(e,r.namespace),s=r.alias??r.namespace,o=Ar(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||kr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:wr(t,a),usedMembers:[]});return i}function Rr(e){return e.flatMap(r=>pe(r,null))}function pe(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Ae(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&_(e.children[0])===null?e.children.flatMap(t=>pe(t,r)):Er(e,r);if(e.type==="list"&&e.children.length>0){let t=_(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>pe(n,Ae(r,t))):e.children.flatMap(n=>pe(n,r))}return[]}function Er(e,r){let t=_(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:Ae(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=_(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=_(i),s+=1;continue}o===":refer"&&i&&(_(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(_).filter(Lr)),s+=1)}return[n]}function Fr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(E(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=_(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=_(s);o&&r.push(E(`${n}.${o}`,o,null,!0))}}return r}function Ae(e,r){return e?`${e}.${r}`:r}function _(e){return e?.type==="atom"?e.text:null}function Lr(e){return!!(e&&!e.startsWith(":"))}function Ar(e,r){let t=new Set,n=new RegExp(`${we()}${O(r)}\\s*/\\s*([${ke}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function kr(e,r){return new RegExp(`${we()}${O(r)}\\s*/`,"m").test(e)}function wr(e,r){return new RegExp(`${we()}${O(r)}(?![${ke}])`,"m").test(e)}function we(){return`(?<![${ke}])`}function jr(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
9
|
+
`?`
|
|
10
|
+
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ce(e,s);n+=ft(e.slice(s,i)),s=i;continue}if(o==='"'){let i=te(e,s,0).index;n+=ft(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Dr(e){let r=0;for(;r<e.length&&(r=je(e,r),!(r>=e.length));){let t=ue(e,r);if(!t){r+=1;continue}if(Pr(t.form))return t.form;r=t.index}return null}function ue(e,r){let t=je(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Or(e,t);if(e.startsWith("#_",t)){let s=ue(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Re(e[t]);)t+=1;let n=e[t];return n?n==="("?Le(e,t,"list",")"):n==="["?Le(e,t,"vector","]"):n==="{"?Le(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:te(e,t,0).index},index:te(e,t,0).index}:Mr(e,t):null}function Or(e,r){let t=e.startsWith("#?@",r)?3:2,n=ue(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?vr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function vr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=_(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Le(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=je(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=ue(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Mr(e,r){let t=r;for(;t<e.length&&!Ee(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function je(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ce(e,t);continue}break}return t}function ft(e){return e.replace(/[^\r\n]/g," ")}function gt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=w(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:he(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?V(c,i):[]})}return n}function St(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:he(e,r,o)})}return n}function ht(e,r,t){return le(e,r,{csharp:n=>Br(e,r,n),vb:n=>$r(e,r,n)},()=>{let n=Je(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[T(e,r,o,p,u,m,S(e,p,q))]})},t)}function $r(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,q),n,c?"namespace":"named"))}return s}function Br(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,q),n,a?"namespace":"named"))}return s}var Ur=U("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function xt(e,r){return Ur.get(e,r,()=>{let t=new Set,n=A(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function De(e,r,t){return C(e,r,n=>Vr(e,r,n),()=>qr(e,r,t),t)}function qr(e,r,t){return en(t).flatMap(n=>tn(e,r,n.clause,n.specifier,n.start,n.end,t))}function Vr(e,r,t){let n=zr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Wr(e,r,t,o,n));return s}function zr(e,r,t){let n=g(t,new Set(["import_statement"]));if(Y(r))for(let s of xt(e,r))n.add(s);return n}function Wr(e,r,t,n,s){let o=Gr(n);if(!o)return[];let i=F(e,r,o),a=b(n,"import_clause");return a?Hr(t,a,i,s,Yr(n.text)):[v("*",i)]}function Hr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Jr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=Kr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Xr(i,t,n,s));return o}function Jr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function Kr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=Zr(e,i);return M("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Xr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||Qr(o.text)}))}return s}function Gr(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Yr(e){return/^\s*import\s+type\b/.test(e)}function Qr(e){return/^\s*type\b/.test(e.trim())}function Zr(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function en(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function tn(e,r,t,n,s,o,i){let a=F(e,r,n),c=w(i,s,o);return t?rn(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=V(c,p.localName);return M(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?v(p.importedName,p.sourcePath):E(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[v("*",a)]}function rn(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=nn(n),i=[];return s&&i.push(...yt(s,t)),o&&i.push(...yt(o,t)),i}function yt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function nn(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Oe(e,r,t){let n=D(e,r);return n?pn(e,r,n):sn(e,r,t)}function sn(e,r,t){return[...on(e,r,t),...an(e,r,t),...cn(e,r,t)]}function on(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>ln(u.trim())).filter(u=>!!u),l=z(t,o.index),p=z(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:F(e,r,a),names:c,startLine:l,endLine:p})}return n}function an(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:F(e,r,i),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return n}function cn(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:F(e,r,i),names:[],startLine:a,endLine:c})}return n}function ln(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function z(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function pn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=un(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=mn(s,o,i,a);n.push(c)}return n}function un(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return F(e,r,s.text)}function mn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}let o=b(e,"namespace_export");if(o){let i=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:r,names:i?[i]:[],startLine:t,endLine:n}}return{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function bt(e,r,t){return le(e,r,{java:n=>fn(e,r,n),kotlin:n=>dn(e,r,n),scala:n=>gn(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?Sn(e,r,o,s):[]}),t)}function fn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(M("*",S(e,l,P)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,P),n))}return s}function dn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(M("*",S(e,i.text,P)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,P),n))}return s}function gn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(M("*",S(e,c,P)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,P),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,P),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,P),n))}return s}function Sn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[T(e,r,n,m,p,u)]})}return[T(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function It(e,r,t){return C(e,r,n=>hn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[T(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}),t)}function hn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=Nt(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=Nt(c,"");l&&o(u,l,p)}}return s}function Nt(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function _t(e,r,t){return C(e,r,n=>xn(e,r,n),()=>bn(t).flatMap(n=>In(e,r,n,t)),t)}function xn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Ct(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=yn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=Ct(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function Ct(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function yn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function bn(e){let r=e.split(`
|
|
11
|
+
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=Ie(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
12
|
+
${m}`,l+=1+m.length,p+=Ie(m),n+=m.length+1}let u=Nn(c);u&&t.push({...u,start:a,end:l})}return t}function Nn(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function In(e,r,t,n){let s=w(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=V(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as Cn}from"path";function Pt(e,r,t){return C(e,r,n=>Pn(e,r,n),()=>_n(e,r,t),t)}function _n(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?ge(e,r,i):null;if(a){let c=Tt(i);return[E(c,c,a,x(s,c))]}return[v(i,a)]})}function Pn(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?ge(e,r,u):null;if(m){let f=Tt(u);s.push(d(f,f,m,n))}else s.push(v(u,m))}return s}function Tt(e){return Ze(Cn(e).replace(/\.[^.]+$/,""),/_/)}function Rt(e,r,t){return C(e,r,n=>Tn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?Rn(e,r,o,s):[]}),t)}function Tn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of re(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=L(e,r,a.qualifiedName)??L(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function re(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:me(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:me(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=me(r,t.text),o=[];for(let i of n.namedChildren)o.push(...re(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...re(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=re(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:me(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function me(e,r){return e?r?`${e}::${r}`:e:r}function Rn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let de=p.split("::").filter(Boolean).pop();return de?[T(e,r,n,p,de,de)]:[]}let[h,$]=f.split(/\s+as\s+/),B=h?.trim();if(!B)return[];let kt=($??B.split("::").pop()??B).trim(),wt=`${p}::${B}`.replace(/::::/g,"::");return[T(e,r,n,wt,B.split("::").pop()??B,kt,L(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=L(e,r,a)??L(e,r,a.split("::").slice(0,-1).join("::"));return[T(e,r,n,a,a.split("::").pop()??a,c,l)]}function Et(e,r,t){let n=D(e,r);if(n)return En(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Ln(e,r,i))}return s}function En(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!Fn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of re(o,""))i.importedName&&n.push(ve(e,r,i.qualifiedName))}return n}function Fn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Ln(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[ve(e,r,l)]})}return[ve(e,r,n)]}function ve(e,r,t){return{specifier:t,sourcePath:L(e,r,t)??L(e,r,t.split("::").slice(0,-1).join("::"))}}function j({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function Ft(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var An={language:"javascript",extensions:Be,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:De,parseReExports:Oe},kn=j({language:"python",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:_t}),wn=j({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:bt}),jn={language:"rust",extensions:qe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Rt,parseExports:Et},Dn=j({language:"ruby",extensions:Ve,imports:"ast-with-regex-fallback",parseImports:Pt}),On=j({language:"c/cpp",extensions:ze,imports:"ast-with-regex-fallback",parseImports:mt}),vn=j({language:"dotnet",extensions:q,imports:"ast-dispatch-with-regex-fallback",parseImports:ht}),Mn={language:"dart",extensions:We,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:gt,parseExports:St},$n=j({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:It}),Bn=j({language:"clojure",extensions:He,imports:"regex-only",parseImports:dt}),Un=[An,kn,wn,jn,Dn,On,vn,Mn,$n,Bn];function fe(e){return Ft(Un,e)}var Me={clearGroups:["whole-project","source-file"]},qn=U("source-imports",Me),Vn=U("source-exports",Me),zn=U("source-reexports",Me),Lt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:Hn,deserialize:Jn}),At=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:Kn,deserialize:Xn});function pi(e,r){let t=ne(r);return zn.get(e,t,()=>{let n=fe(t);if(!n?.parseReExports)return[];let s=A(e,t);if(!s)return[];let o=W(e,t,s),i=xe(e),a=At.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return At.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Wn(e,r){let t=ne(r);return qn.get(e,t,()=>{let n=fe(t);if(!n)return[];let s=A(e,t);if(!s)return[];let o=W(e,t,s),i=xe(e),a=Lt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Lt.write(e,t,o,{parserVersion:2,resolutionFingerprint:i,imports:c}),c})}function ui(e,r,t){let n=Wn(e,r).filter(s=>s.kind==="named"&&s.isTypeOnly!==!0&&s.localName===t&&s.sourcePath!==null);return n.length===1?n[0]:null}function mi(e,r){let t=ne(r);return Vn.get(e,t,()=>{let n=fe(t);if(!n?.parseExports)return[];let s=A(e,t);return s?n.parseExports(e,t,s):[]})}function Hn(e){return JSON.stringify(e)}function Jn(e){try{let r=JSON.parse(e);return!ye(r)||r.parserVersion!==2||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{parserVersion:2,resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function Kn(e){return JSON.stringify(e)}function Xn(e){try{let r=JSON.parse(e);return!ye(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,jt as b,es as c,ts as d,Ie as e,Ce as f,Ot as g,tt as h,vt as i,_e as j,Mt as k,R as l,ir as m,ur as n,mr as o,Sr as p,hr as q,xr as r,yr as s,br as t,me as u,pi as v,Wn as w,ui as x,mi as y};
|
|
13
|
+
//# sourceMappingURL=chunk-I3U2FN2T.js.map
|