codebaseiq 0.3.1 → 0.4.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 +65 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-7GAK2F3H.js → chunk-23AD24QZ.js} +12 -12
- package/dist/chunk-24TEZJST.js +2 -0
- package/dist/{chunk-356EZBIP.js → chunk-26EDDGAX.js} +2 -2
- package/dist/{chunk-O2M3VNDY.js → chunk-26EZWQ24.js} +2 -2
- package/dist/{chunk-U33PMPNW.js → chunk-2L3NCI52.js} +2 -2
- package/dist/{chunk-MSI3K7PJ.js → chunk-2QJAVISG.js} +2 -2
- package/dist/{chunk-4LK5OIPW.js → chunk-2ZBZRYX4.js} +2 -2
- package/dist/{chunk-JYRJYXUV.js → chunk-33AXWMO2.js} +2 -2
- package/dist/{chunk-EQNMD62X.js → chunk-37K55EG3.js} +2 -2
- package/dist/{chunk-LCW3PSGL.js → chunk-3EFZ5KQ4.js} +2 -2
- package/dist/{chunk-D7DOB27N.js → chunk-3F23W57G.js} +2 -2
- package/dist/{chunk-BGGB5N53.js → chunk-3GKKCVKK.js} +2 -2
- package/dist/{chunk-MQW6SJ4P.js → chunk-3SYRGMCL.js} +2 -2
- package/dist/{chunk-DWBAESVW.js → chunk-3VDL7GTY.js} +2 -2
- package/dist/{chunk-BFANZRQ5.js → chunk-3XBZ5PKL.js} +2 -2
- package/dist/{chunk-K6FNTQQW.js → chunk-42PXSE74.js} +2 -2
- package/dist/{chunk-ALOEHWJS.js → chunk-4GIERC2P.js} +2 -2
- package/dist/{chunk-W7YLRXZE.js → chunk-4UXDBRIF.js} +2 -2
- package/dist/chunk-4XMZYLW5.js +2 -0
- package/dist/{chunk-JSB43EX6.js → chunk-55NUXP2V.js} +2 -2
- package/dist/chunk-5AJQCOZZ.js +21 -0
- package/dist/{chunk-L37EQYAX.js → chunk-5NUPFZFA.js} +2 -2
- package/dist/{chunk-PIFYOWS4.js → chunk-65QIFIF6.js} +2 -2
- package/dist/{chunk-SUE7SHZL.js → chunk-66Q5VLH6.js} +2 -2
- package/dist/{chunk-KFTHI2R6.js → chunk-6CQPIIS7.js} +2 -2
- package/dist/{chunk-GV2CEZCW.js → chunk-6CTSFS7R.js} +2 -2
- package/dist/{chunk-SB53KPWA.js → chunk-6EBUAKJT.js} +2 -2
- package/dist/chunk-6I55VYFG.js +4 -0
- package/dist/chunk-6NUURWPF.js +3 -0
- package/dist/{chunk-TEMM2FEL.js → chunk-6P5QMOM7.js} +2 -2
- package/dist/{chunk-3LQJRS4I.js → chunk-6S5FE4ZF.js} +2 -2
- package/dist/chunk-74LRKLNC.js +22 -0
- package/dist/{chunk-NNG6M6XD.js → chunk-75A23IID.js} +2 -2
- package/dist/chunk-75VNTSO6.js +7 -0
- package/dist/chunk-7HBBVZJ6.js +3 -0
- package/dist/{chunk-AGGR2BKS.js → chunk-7PPBMBH6.js} +2 -2
- package/dist/{chunk-DECN422G.js → chunk-7WG57A5X.js} +2 -2
- package/dist/{chunk-ILGTMRMZ.js → chunk-7XHZX6FX.js} +2 -2
- package/dist/{chunk-OKAF4OQS.js → chunk-A5HJ3CJW.js} +2 -2
- package/dist/{chunk-JNXI6NQ7.js → chunk-AJ5HVC5Z.js} +2 -2
- package/dist/{chunk-SZ4P7MF7.js → chunk-AYRHOFLV.js} +2 -2
- package/dist/chunk-AZDY3EKD.js +93 -0
- package/dist/{chunk-SA7G6GJX.js → chunk-AZZNG5Z2.js} +2 -2
- package/dist/chunk-BEKCTUPY.js +3 -0
- package/dist/{chunk-PTR3EOXC.js → chunk-BKKX2OU5.js} +2 -2
- package/dist/{chunk-5LL4KEHO.js → chunk-BQKRYKDD.js} +2 -2
- package/dist/{chunk-UIAUPFBJ.js → chunk-BVDQU2XJ.js} +2 -2
- package/dist/chunk-C3PPB2T5.js +5 -0
- package/dist/chunk-CABIZQXQ.js +21 -0
- package/dist/{chunk-M2Y6PCFE.js → chunk-CAH322MC.js} +2 -2
- package/dist/{chunk-EIBGSU2R.js → chunk-CBOOHUK4.js} +2 -2
- package/dist/chunk-CFIICAOM.js +2 -0
- package/dist/{chunk-UMEPSVKT.js → chunk-CPWYEPWQ.js} +2 -2
- package/dist/{chunk-LQHYYIOB.js → chunk-CRT7I7RJ.js} +2 -2
- package/dist/{chunk-IZDPGOZR.js → chunk-CZVSQQDU.js} +2 -2
- package/dist/{chunk-TNJGTQWO.js → chunk-D3KE26FS.js} +2 -2
- package/dist/{chunk-CB5AVJMM.js → chunk-DNRHRVKS.js} +2 -2
- package/dist/{chunk-SGMNWYTH.js → chunk-DOQLO74K.js} +2 -2
- package/dist/{chunk-DDRA3QKN.js → chunk-DP3EJ6XL.js} +2 -2
- package/dist/{chunk-OWJWOEDU.js → chunk-DQZF7MP6.js} +2 -2
- package/dist/{chunk-VSGOIZMQ.js → chunk-DTM4EHD2.js} +2 -2
- package/dist/{chunk-YRKP7PM7.js → chunk-DUM7GR6B.js} +2 -2
- package/dist/{chunk-HNXRVGMY.js → chunk-DZ4QOIRY.js} +2 -2
- package/dist/{chunk-CSPDQLLU.js → chunk-E3R6TJ5T.js} +2 -2
- package/dist/chunk-E4DP45YU.js +3 -0
- package/dist/{chunk-PUVNH4PO.js → chunk-E5U6N5WI.js} +2 -2
- package/dist/chunk-E7T22WET.js +21 -0
- package/dist/{chunk-QEOWONKY.js → chunk-ED7ZAZ5V.js} +2 -2
- package/dist/{chunk-RCIGX23V.js → chunk-EDMG5CSO.js} +2 -2
- package/dist/{chunk-IHSLIIL3.js → chunk-EOSUV7H5.js} +2 -2
- package/dist/{chunk-EHPOTEQX.js → chunk-ESWVTSHU.js} +2 -2
- package/dist/{chunk-57OPIQFM.js → chunk-ETZBIG6K.js} +2 -2
- package/dist/chunk-EYSJHKX6.js +3 -0
- package/dist/{chunk-MC46AL7B.js → chunk-F4AGM7ZE.js} +37 -37
- package/dist/{chunk-EOKVZXNF.js → chunk-FPUJRBHL.js} +55 -55
- package/dist/{chunk-CCIYWXX6.js → chunk-G2UU6PQP.js} +2 -2
- package/dist/{chunk-C6WKPKCF.js → chunk-G3KRXNNT.js} +2 -2
- package/dist/{chunk-TEANKHUU.js → chunk-G3ZBP72R.js} +2 -2
- package/dist/{chunk-ELYMY5S2.js → chunk-GC4I33OD.js} +2 -2
- package/dist/{chunk-NDKOVQFG.js → chunk-GLXEWYQY.js} +2 -2
- package/dist/{chunk-CYJS33YX.js → chunk-GRHNPFHT.js} +2 -2
- package/dist/{chunk-QY7QB7I6.js → chunk-GWESWURK.js} +2 -2
- package/dist/{chunk-R4OJGTMP.js → chunk-GXOFPAIR.js} +2 -2
- package/dist/{chunk-OBC7HSSO.js → chunk-H4FGIFEU.js} +2 -2
- package/dist/{chunk-LKUTSP4G.js → chunk-HOGS6JFP.js} +2 -2
- package/dist/{chunk-RIO3JXHM.js → chunk-HSJLK5MC.js} +2 -2
- package/dist/{chunk-BWL3PMPT.js → chunk-HTPEUJ42.js} +2 -2
- package/dist/{chunk-DJKOXMNG.js → chunk-IBPXUGJV.js} +2 -2
- package/dist/{chunk-2XBJRZEM.js → chunk-ITA3N7G6.js} +2 -2
- package/dist/chunk-JG5OWAEB.js +22 -0
- package/dist/{chunk-LSZYMN2A.js → chunk-JGJKRTTB.js} +2 -2
- package/dist/{chunk-TJWVT4DO.js → chunk-JGXLB7PR.js} +2 -2
- package/dist/{chunk-5TZNHP4T.js → chunk-JKUF2UG6.js} +2 -2
- package/dist/{chunk-CIYA2KZN.js → chunk-JOYASZRF.js} +2 -2
- package/dist/{chunk-U7NUXDQO.js → chunk-K3PFL5QQ.js} +2 -2
- package/dist/{chunk-WK2IQJPK.js → chunk-KAXBWTSX.js} +2 -2
- package/dist/{chunk-5ZI2PPI7.js → chunk-KHHAGHAW.js} +2 -2
- package/dist/{chunk-UW6KD57C.js → chunk-KJLUQVBG.js} +2 -2
- package/dist/{chunk-WWCV4E6J.js → chunk-KOVUXHIZ.js} +2 -2
- package/dist/chunk-KPMMOAV5.js +4 -0
- package/dist/{chunk-2Z7K66D7.js → chunk-LKJZNGMA.js} +2 -2
- package/dist/{chunk-3VJ3OCRE.js → chunk-LMPOC372.js} +2 -2
- package/dist/{chunk-F3QSL4W2.js → chunk-LTPNP6D5.js} +2 -2
- package/dist/{chunk-O2KWU34K.js → chunk-M3IBH6C3.js} +9 -9
- package/dist/{chunk-UJIXCI3L.js → chunk-MAGBSB6E.js} +2 -2
- package/dist/{chunk-QMOZZ2VX.js → chunk-MFMHD36E.js} +2 -2
- package/dist/{chunk-LMTSB3TB.js → chunk-MJX2J5QE.js} +2 -2
- package/dist/{chunk-WO6OFKUC.js → chunk-N26LGGSF.js} +2 -2
- package/dist/{chunk-J7AMBVWF.js → chunk-NB2DAVPP.js} +2 -2
- package/dist/{chunk-MDFT325O.js → chunk-NJDXNYLG.js} +2 -2
- package/dist/{chunk-BRQL7AFJ.js → chunk-NMKQOIYZ.js} +2 -2
- package/dist/{chunk-ICUL7XRT.js → chunk-NRNVMB2R.js} +2 -2
- package/dist/{chunk-JAFDMV5I.js → chunk-O5BWFNIH.js} +2 -2
- package/dist/{chunk-3H2H5ODK.js → chunk-O7PCDZ5B.js} +2 -2
- package/dist/{chunk-KPZGTB2O.js → chunk-OAJYNPRU.js} +2 -2
- package/dist/{chunk-KUKWHP4R.js → chunk-OFUC6R46.js} +2 -2
- package/dist/chunk-OSZ7PW5K.js +5 -0
- package/dist/{chunk-B3UYV66Z.js → chunk-OZ2M2X7A.js} +2 -2
- package/dist/{chunk-6O3KXIDL.js → chunk-OZI44VCR.js} +2 -2
- package/dist/{chunk-XN3EKMLI.js → chunk-PCKIKOUA.js} +2 -2
- package/dist/{chunk-I3OK27P7.js → chunk-PFMQRHC6.js} +2 -2
- package/dist/{chunk-K4S2VH42.js → chunk-PVKSZBX5.js} +2 -2
- package/dist/{chunk-NEWHKGVD.js → chunk-QANCT4MO.js} +2 -2
- package/dist/{chunk-ZNH33XIB.js → chunk-QEWN7BLP.js} +2 -2
- package/dist/{chunk-OQUCBKOI.js → chunk-QFJ46F6F.js} +2 -2
- package/dist/{chunk-2E6OUPCF.js → chunk-QPQWR6CW.js} +2 -2
- package/dist/{chunk-YTJHCGYB.js → chunk-QX4HDF2I.js} +2 -2
- package/dist/{chunk-KLX6NSWT.js → chunk-R2F2CTBA.js} +2 -2
- package/dist/{chunk-2OMXFE64.js → chunk-R7PXHYMY.js} +2 -2
- package/dist/{chunk-F74LZWCE.js → chunk-RGBZDOUO.js} +2 -2
- package/dist/{chunk-362QOSFD.js → chunk-RNPG5P4P.js} +2 -2
- package/dist/{chunk-D62CTZX6.js → chunk-RS6UYNEP.js} +2 -2
- package/dist/{chunk-VGWZ4MOY.js → chunk-RVBRPBLQ.js} +2 -2
- package/dist/{chunk-BGYRF5YX.js → chunk-RWAZCEJD.js} +2 -2
- package/dist/{chunk-Z66XYVLZ.js → chunk-RWDIONS7.js} +2 -2
- package/dist/{chunk-CJTKGAGH.js → chunk-S3CJYDXP.js} +2 -2
- package/dist/{chunk-53ELMZRF.js → chunk-S6UTKCBT.js} +2 -2
- package/dist/chunk-SLLFJXTW.js +27 -0
- package/dist/{chunk-TOTWJZIX.js → chunk-T3KTMLQT.js} +2 -2
- package/dist/{chunk-HJTM3C4Y.js → chunk-TB575ZGO.js} +2 -2
- package/dist/{chunk-YHPG3S2U.js → chunk-TG4GMU73.js} +2 -2
- package/dist/{chunk-N2XDMNVI.js → chunk-THKM7OXM.js} +2 -2
- package/dist/{chunk-GVAF222T.js → chunk-TNLOX4TN.js} +2 -2
- package/dist/{chunk-BPKNP3KZ.js → chunk-UHFZDQZJ.js} +2 -2
- package/dist/{chunk-YT4DVWUV.js → chunk-UUMAM5LM.js} +2 -2
- package/dist/{chunk-TLTSESB4.js → chunk-UUT5P3V7.js} +2 -2
- package/dist/{chunk-W7QDASTN.js → chunk-VEPK6M5C.js} +2 -2
- package/dist/{chunk-XJBK3QDV.js → chunk-VPCHKZ3I.js} +2 -2
- package/dist/{chunk-3ON3A2QV.js → chunk-VZY3XOBU.js} +2 -2
- package/dist/{chunk-XQAVQVIL.js → chunk-W6E6ME7G.js} +2 -2
- package/dist/{chunk-KEJ2HLRW.js → chunk-WGYZBS5S.js} +2 -2
- package/dist/{chunk-5MPBSFZH.js → chunk-WUP24Q4U.js} +2 -2
- package/dist/chunk-WXUHXSLN.js +2 -0
- package/dist/{chunk-F5CJO5JN.js → chunk-X4YZD2MP.js} +2 -2
- package/dist/chunk-XARPGCTL.js +2 -0
- package/dist/{chunk-5FWR5HLG.js → chunk-XDQ6QJF5.js} +20 -20
- package/dist/{chunk-JCMFBF4Z.js → chunk-XRH7R5SX.js} +2 -2
- package/dist/{chunk-T2M5HWBQ.js → chunk-XVJ2E7W7.js} +2 -2
- package/dist/{chunk-AXQCHG77.js → chunk-Y7GFAU5N.js} +2 -2
- package/dist/{chunk-T6MQNNAC.js → chunk-YBDLHFZZ.js} +2 -2
- package/dist/{chunk-ZB4C5TTR.js → chunk-YI3CJPOY.js} +2 -2
- package/dist/chunk-YMAGXBLT.js +3 -0
- package/dist/{chunk-MZNMASFM.js → chunk-YRAGNEBZ.js} +2 -2
- package/dist/chunk-YXZAAQHZ.js +3 -0
- package/dist/chunk-Z2L5H2HF.js +3 -0
- package/dist/{chunk-5CR4U5X2.js → chunk-ZHK7TVAJ.js} +2 -2
- package/dist/chunk-ZJNV27DZ.js +4 -0
- package/dist/{chunk-GQLDYCWS.js → chunk-ZQ6GAIUV.js} +2 -2
- package/dist/{chunk-4GWN76B2.js → chunk-ZQE2QYAC.js} +2 -2
- package/dist/chunk-ZUQ2MDFT.js +2 -0
- package/dist/cli-context-4R2LREXQ.js +3 -0
- package/dist/cli-context-6X7JYARX.js +2 -0
- package/dist/cli-failure-RECEHOM2.js +3 -0
- package/dist/cli-program-MXA3WTAO.js +7 -0
- package/dist/cli.js +1 -1
- package/dist/{code-viewer-AMRXV444.js → code-viewer-C6HE4DFC.js} +2 -2
- package/dist/{code-viewer-EXI5SFFR.js → code-viewer-XHSSAMBX.js} +2 -2
- package/dist/{command-descriptors-ROIOTCCW.js → command-descriptors-NWW34Z54.js} +171 -171
- package/dist/{command-descriptors-H6A4UY72.js → command-descriptors-XHK3PK2I.js} +116 -116
- package/dist/{command-panels-SZONPMLJ.js → command-panels-OXMCJ2QZ.js} +2 -2
- package/dist/direct-navigation-236VXYBZ.js +3 -0
- package/dist/direct-navigation-36YSILY6.js +2 -0
- package/dist/index.js +1 -1
- package/dist/invocation-command-descriptors-35JULLNR.js +3 -0
- package/dist/invocation-command-descriptors-FEWSFUO2.js +2 -0
- package/dist/output-continuation-command-MJBVH3A5.js +2 -0
- package/dist/output-continuation-command-TBXIOPHQ.js +3 -0
- package/dist/project-reindex-5TCGOVSK.js +2 -0
- package/dist/project-reindex-BUNTSYKM.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +30 -30
- package/dist/runtime.js +1 -1
- 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/sentinel-ensure-command-3MZCLPQY.js +2 -0
- package/dist/sentinel-ensure-command-LEWHIRLL.js +3 -0
- package/dist/sentinel-worker.js +1 -1
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +6 -6
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/SECURITY_MODEL.md +3 -0
- package/package.json +1 -1
- package/skills/codebaseiq/SKILL.md +15 -3
- package/dist/chunk-2I2UHZET.js +0 -2
- package/dist/chunk-5T44HG5Y.js +0 -88
- package/dist/chunk-5YBDBY5L.js +0 -2
- package/dist/chunk-6EYESTJM.js +0 -3
- package/dist/chunk-6FXXYYQM.js +0 -22
- package/dist/chunk-7UCDGXRW.js +0 -8
- package/dist/chunk-BIADXGC3.js +0 -22
- package/dist/chunk-CLPCFGRT.js +0 -3
- package/dist/chunk-DUKHVPU5.js +0 -4
- package/dist/chunk-G7GVV2TV.js +0 -27
- package/dist/chunk-KUKKLWJD.js +0 -3
- package/dist/chunk-KWRQVLPX.js +0 -3
- package/dist/chunk-MEUHIDI3.js +0 -7
- package/dist/chunk-OP6BUIV6.js +0 -2
- package/dist/chunk-OQ3DK7FW.js +0 -2
- package/dist/chunk-OT5ISJSR.js +0 -2
- package/dist/chunk-SX72EVMY.js +0 -3
- package/dist/chunk-T75DS2E6.js +0 -21
- package/dist/chunk-UC2FD2PS.js +0 -4
- package/dist/chunk-UQYQBLJX.js +0 -5
- package/dist/chunk-V4NGDIEA.js +0 -21
- package/dist/chunk-XUPFA6GH.js +0 -2
- package/dist/chunk-YPBKBYPS.js +0 -21
- package/dist/chunk-ZMA5HWXY.js +0 -3
- package/dist/cli-context-FJL2JHOE.js +0 -3
- package/dist/cli-context-PQNWHMCQ.js +0 -2
- package/dist/cli-program-SCHOHOQE.js +0 -7
- package/dist/direct-navigation-3JOYP2MO.js +0 -3
- package/dist/direct-navigation-SJMJLBY7.js +0 -2
- package/dist/invocation-command-descriptors-GMZX3UAD.js +0 -2
- package/dist/invocation-command-descriptors-HNMKDEF6.js +0 -3
- package/dist/output-continuation-command-5NWVDQT7.js +0 -2
- package/dist/output-continuation-command-RNEHNYPU.js +0 -3
- package/dist/project-reindex-MIW5CYEG.js +0 -3
- package/dist/project-reindex-VQ23LWDA.js +0 -2
- package/dist/sentinel-ensure-command-H66AZ3VE.js +0 -2
- package/dist/sentinel-ensure-command-R4YAUCJB.js +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as pe,c as ne}from"./chunk-ILGTMRMZ.js";import{f as ee}from"./chunk-BGGB5N53.js";import{c as me}from"./chunk-BPKNP3KZ.js";import{d as ue,f as fe}from"./chunk-J7AMBVWF.js";import{t as U}from"./chunk-GVAF222T.js";import{f as Z}from"./chunk-F74LZWCE.js";import{x as q}from"./chunk-7GAK2F3H.js";var Le=6;function ge(e,i,l){return`${e}\0${i}\0${l??i}`}function qe(e,i,l,a={}){let s=a.limit??Le;if(!Number.isSafeInteger(s)||s<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${s}`);let m=a.sourceAllowed??(()=>!0),u=new Map(i.nodes.map(t=>[t.id,t])),C=new Set(l.steps.map(t=>t.nodeId)),S=new Set(l.steps.flatMap(t=>{let g=le(u.get(t.nodeId));return g?[g]:[]})),A=new Set;for(let t of l.steps)for(let g of t.behavior?.supportingDeclarations??[])S.add(g.symbol),A.add(ge(g.file,g.line,g.endLine));let y=t=>t.symbol!==null&&S.has(t.symbol)||A.has(ge(t.file,t.line,t.endLine)),I=new Map(l.steps.flatMap(t=>{if(!t.location)return[];let g=le(u.get(t.nodeId));if(!g)return[];let x=U(e,t.location.file).find(_=>_.symbol===g);return x?[[t.id,x]]:[]})),M=new me(e).calleeMap([...I.values()],{additive:!1,semantic:!0}),o=[],f=new Set,V=new Set,T=0,D=0,j=0,$=0,G=0,B=0,r=0,N=0;for(let t of l.steps){if(!t.location||!t.behavior)continue;let g=i.edges.filter(n=>["call","runtime-boundary"].includes(n.kind)&&(n.fromNodeId===t.nodeId||n.toNodeId===t.nodeId)&&n.disposition!=="excluded"&&n.disposition!=="unsupported");for(let n of g){let d=n.toNodeId===t.nodeId,p=d?n.fromNodeId:n.toNodeId;if(C.has(p))continue;let b=u.get(p);if(!b?.location||!m(b.location.file))continue;let L=n.kind==="call"?oe(e,b):ae(b);if(!L||y(L))continue;let h=re(n,b.location.file)??b.location,w=q(e,h.file)[h.line]?.trim(),v=d?"upstream":"downstream",k=n.kind==="runtime-boundary"?d?"runtime-producer":"runtime-consumer":d?"caller":"callee",P=["call"],O=te(n.evidence),Ne=z(b);o.push({anchor:{id:R(t.id,h.line,b.id),status:O,source:"graph-relation",direction:v,causalRole:k,relationKind:n.kind,fromStepId:t.id,fromLabel:t.label,callsite:{file:h.file,line:h.line,endLine:h.endLine??h.line,text:w||`${b.label} \u2192 ${t.label}`,signals:P,calleeLeaf:Ne},alternatives:[L],alternativeCount:1,evidence:n.evidence}}),d&&(B+=1),n.kind==="runtime-boundary"&&(N+=1)}let x=i.edges.filter(n=>n.kind==="reference"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"&&!C.has(n.toNodeId));for(let n of x){let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=oe(e,d);if(!p||y(p))continue;let b=z(d),L=re(n,t.location.file)?.line,h=t.behavior.lines.find(P=>(L===void 0||L>=P.line&&L<=P.endLine)&&P.text.includes(b));if(!h)continue;let w=ye(h.signals),v=w==="result-callback",k=te(n.evidence);o.push({anchor:{id:R(t.id,h.line,d.id),status:k,source:"graph-relation",direction:"downstream",causalRole:w,relationKind:"reference",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:b},alternatives:[p],alternativeCount:1,evidence:n.evidence}}),v&&(r+=1)}let _=ne(e,t.location.file,t.location.line,t.location.endLine??t.location.line),F=q(e,t.location.file),W=ee(e,t.location.file,t.location.line,t.location.endLine??t.location.line);for(let n of _.targets){if(!m(n.definition.relativePath))continue;let d=K(t.location.file,n.sourceLine,n.calleeLeaf);if(f.has(d))continue;f.add(d);let p=ie(W.get(n.sourceLine)),b={symbol:n.definition.symbol,label:n.definition.leaf,file:n.definition.relativePath,line:n.definition.startLine,endLine:n.definition.endLine};y(b)||o.push({anchor:{id:R(t.id,n.sourceLine,n.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:n.sourceLine,endLine:n.sourceLine,text:F[n.sourceLine]?.trim()||`${n.calleeLeaf}()`,signals:p,calleeLeaf:n.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:n.definition.symbol,location:{file:t.location.file,line:n.sourceLine}}]}})}let c=t.behavior.lines.filter(n=>n.signals.includes("call"));if(c.length===0)continue;T+=1;let E=(Z(e,t.location.file)?.callSites??[]).filter(n=>c.some(d=>n.line>=d.line&&n.line<=d.endLine));D+=E.length;let se=i.edges.filter(n=>n.kind==="call"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"),Y=new Map;for(let n of se){let d=u.get(n.toNodeId);if(!d)continue;let p=z(d);Y.set(p,(Y.get(p)??0)+1)}let ce=I.get(t.id),de=Ie(e,ce?M.get(ce.symbolId)??[]:[]),Ae=Ee(de);for(let n of de){if(!m(n.alternative.file)||y(n.alternative))continue;let d=X(n.alternative.label),p=be(E,c,d,n.row.callsiteLine,Ae.get(d)===1);if(!p)continue;let b=H(c,p.line,d);if(!b)continue;let L=K(t.location.file,p.line,d);if(f.has(L))continue;f.add(L);let h=Se(n.row.source);o.push({anchor:{id:R(t.id,p.line,n.alternative.symbol??n.alternative.file),status:h,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:b.line,endLine:b.endLine,text:b.text,signals:b.signals,calleeLeaf:d},alternatives:[n.alternative],alternativeCount:1,evidence:[{method:n.row.source,strength:h,identity:n.row.symbol,location:{file:t.location.file,line:p.line}}]}})}for(let n of se){if(C.has(n.toNodeId))continue;let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=z(d),b=n.evidence.find(P=>{let O=P.location;return O!==null&&O.file===t.location?.file&&O.line>=0})?.location?.line,L=be(E,c,p,b,Y.get(p)===1);if(!L)continue;let h=H(c,L.line,p);if(!h)continue;let w=K(t.location.file,L.line,p);if(f.has(w))continue;f.add(w);let v=ae(d);if(!v||y(v))continue;let k=te(n.evidence);o.push({anchor:{id:R(t.id,L.line,d.id),status:k,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:p},alternatives:[v],alternativeCount:1,evidence:n.evidence}})}for(let n of E){let d=K(t.location.file,n.line,n.calleeLeaf);if(f.has(d))continue;let p=H(c,n.line,n.calleeLeaf);if(!p)continue;let b=ue(t.location.file,fe(e).get(n.calleeLeaf)??[]).flatMap(v=>U(e,v.file).filter(k=>k.symbol===v.symbol&&k.isFunctionLike)).filter(v=>m(v.relativePath)&&!y({symbol:v.symbol,label:v.leaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})),L=Q(b.map(v=>({symbol:v.symbol,label:v.leaf??n.calleeLeaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})));if(L.length===0){G+=1;continue}let h=`${t.id}\0${n.line}\0${n.calleeLeaf}`;if(V.has(h))continue;V.add(h);let w=L.length>1;w?$+=1:j+=1,o.push({anchor:{id:R(t.id,n.line,n.calleeLeaf),status:w?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:p.line,endLine:p.endLine,text:p.text,signals:p.signals,calleeLeaf:n.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}}return Ce(e,o,l.steps,s,{scannedBehaviorSteps:T,visibleCallsites:D,graphEvidencedCallsites:f.size,identityCandidateCallsites:j,ambiguousCallsites:$,unresolvedCallsites:G,upstreamCandidates:B,resultCandidates:r,runtimeCandidates:N},a.selectionTerms)}function Ue(e,i,l){let a=new Map(i.nodes.map(s=>[s.id,s]));for(let s of l.steps)if(!(!s.behavior||!s.location))for(let m of i.edges){if(m.kind!=="reference"||m.fromNodeId!==s.nodeId||m.disposition==="excluded"||m.disposition==="unsupported")continue;let u=a.get(m.toNodeId);if(!u?.location||!oe(e,u))continue;let C=z(u),S=re(m,s.location.file)?.line,A=s.behavior.lines.find(y=>(S===void 0||S>=y.line&&S<=y.endLine)&&y.text.includes(C));!A||ye(A.signals)!=="result-callback"||m.semantics?.some(({family:y,subtype:I})=>y==="control"&&I==="result-callback")||(m.semantics=[...m.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function ye(e){return e.includes("call")&&e.some(i=>["return","mutation","shape","spread","binding"].includes(i))?"result-callback":"callable-reference"}function ze(e,i,l={}){let a=l.limit??Le;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let s=l.sourceAllowed??(()=>!0),m=[],u=i.map((o,f)=>({id:o.id,nodeId:o.id,order:f,role:"anchor",kind:"source-construct",label:o.label,location:{file:o.file,line:o.startLine,endLine:o.endLine},behavior:null})),C=i.map(o=>({file:o.file,startLine:o.startLine,endLine:o.endLine})),S=0,A=0,y=0,I=0,M=0;for(let o of i){let f=q(e,o.file),T=(Z(e,o.file)?.callSites??[]).filter(r=>r.line>=o.startLine&&r.line<=o.endLine);S+=T.length;let D=ee(e,o.file,o.startLine,o.endLine),j=ne(e,o.file,o.startLine,o.endLine),$=new Set;for(let r of j.targets){if(!s(r.definition.relativePath)||C.some(x=>x.file===r.definition.relativePath&&x.startLine<=r.definition.startLine&&x.endLine>=r.definition.endLine))continue;let N=K(o.file,r.sourceLine,r.calleeLeaf);$.add(N);let t=ie(D.get(r.sourceLine)),g={symbol:r.definition.symbol,label:r.definition.leaf,file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine};m.push({anchor:{id:R(o.id,r.sourceLine,r.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:r.sourceLine,endLine:r.sourceLine,text:f[r.sourceLine]?.trim()||`${r.calleeLeaf}()`,signals:t,calleeLeaf:r.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:r.definition.symbol,location:{file:o.file,line:r.sourceLine}}]}})}A+=j.resolvedCallsites;let G=pe(e,o.file,{ranges:[{startLine:o.startLine,endLine:o.endLine}]}),B=new Map;for(let r of G.targets){let N=T.find(x=>x.line===r.line)?.calleeLeaf??r.calleeLeaf,t=K(o.file,r.line,N),g=B.get(t)??[];g.push(r),B.set(t,g)}for(let[r,N]of B){if($.has(r))continue;$.add(r);let t=N.filter(c=>s(c.targetFile)&&!C.some(E=>E.file===c.targetFile&&E.startLine<=c.targetStartLine&&E.endLine>=c.targetEndLine));if(t.length===0)continue;let g=t[0],x=T.find(c=>c.line===g.line)?.calleeLeaf??g.calleeLeaf,_=ie(D.get(g.line)),F=Q(t.map(c=>({symbol:c.targetSymbol??null,label:c.calleeLeaf,file:c.targetFile,line:c.targetStartLine,endLine:c.targetEndLine}))),W=t.some(c=>(c.resolutionAlternativeCount??0)>1)?"candidate":t.every(c=>c.strength==="exact")?"exact":"derived";m.push({anchor:{id:R(o.id,g.line,F.map(c=>`${c.file}:${c.line}`).join("|")),status:F.length>1?"ambiguous":W,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:g.line,endLine:g.line,text:f[g.line]?.trim()||`${g.calleeLeaf}()`,signals:_,calleeLeaf:x},alternatives:F.slice(0,3),alternativeCount:F.length,evidence:t.map(c=>({method:c.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":c.resolution==="factory-callback-member"?"ast-factory-callback-callsite":c.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:W,identity:c.targetSymbol??`${c.targetFile}:${c.targetStartLine}-${c.targetEndLine}`,location:{file:o.file,line:g.line}}))}})}A+=B.size;for(let r of T){let N=K(o.file,r.line,r.calleeLeaf);$.has(N)||(M+=1)}}return Ce(e,m,u,a,{scannedBehaviorSteps:i.length,visibleCallsites:S,graphEvidencedCallsites:A,identityCandidateCallsites:y,ambiguousCallsites:I,unresolvedCallsites:M,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function Ce(e,i,l,a,s,m=[]){let u=ke(i).sort(xe),C=u.filter(f=>we(e,f)).slice(0,a),S=new Set(C.map(f=>f.anchor.id)),A=u.filter(f=>!S.has(f.anchor.id)),y=C.map(f=>f.anchor),I=A.map(f=>f.anchor),M=Q(y.flatMap(f=>f.alternativeCount===1?f.alternatives:[])),o=Q(I.flatMap(f=>f.alternativeCount===1?f.alternatives:[]));return{anchors:y,withheldAnchors:I,candidateAnchors:u.length,omittedAnchors:Math.max(0,u.length-y.length),...s,inspectCommand:M.length===0?null:`codebaseiq inspect ${M.map(ve).join(" ")} --view behavior`,remainingInspectCommands:Me(o,8).map(f=>`codebaseiq inspect ${f.map(ve).join(" ")} --view behavior`)}}function xe(e,i){let l=e.anchor.alternatives[0],a=i.anchor.alternatives[0];return J(e.anchor.status)-J(i.anchor.status)||(e.anchor.direction??"").localeCompare(i.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(i.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(i.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(i.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(i.anchor.callsite.file)||e.anchor.callsite.line-i.anchor.callsite.line||(l?.file??"").localeCompare(a?.file??"")||(l?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(i.anchor.id)}function we(e,i){if(i.anchor.alternativeCount!==1)return!0;let l=i.anchor.alternatives[0],a=l.endLine??l.line;return q(e,l.file).slice(l.line,a+1).join(`
|
|
1
|
+
import{b as pe,c as ne}from"./chunk-7XHZX6FX.js";import{f as ee}from"./chunk-3GKKCVKK.js";import{c as me}from"./chunk-UHFZDQZJ.js";import{d as ue,f as fe}from"./chunk-NB2DAVPP.js";import{t as U}from"./chunk-TNLOX4TN.js";import{f as Z}from"./chunk-RGBZDOUO.js";import{x as q}from"./chunk-23AD24QZ.js";var Le=6;function ge(e,i,l){return`${e}\0${i}\0${l??i}`}function qe(e,i,l,a={}){let s=a.limit??Le;if(!Number.isSafeInteger(s)||s<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${s}`);let m=a.sourceAllowed??(()=>!0),u=new Map(i.nodes.map(t=>[t.id,t])),C=new Set(l.steps.map(t=>t.nodeId)),S=new Set(l.steps.flatMap(t=>{let g=le(u.get(t.nodeId));return g?[g]:[]})),A=new Set;for(let t of l.steps)for(let g of t.behavior?.supportingDeclarations??[])S.add(g.symbol),A.add(ge(g.file,g.line,g.endLine));let y=t=>t.symbol!==null&&S.has(t.symbol)||A.has(ge(t.file,t.line,t.endLine)),I=new Map(l.steps.flatMap(t=>{if(!t.location)return[];let g=le(u.get(t.nodeId));if(!g)return[];let x=U(e,t.location.file).find(_=>_.symbol===g);return x?[[t.id,x]]:[]})),M=new me(e).calleeMap([...I.values()],{additive:!1,semantic:!0}),o=[],f=new Set,V=new Set,T=0,D=0,j=0,$=0,G=0,B=0,r=0,N=0;for(let t of l.steps){if(!t.location||!t.behavior)continue;let g=i.edges.filter(n=>["call","runtime-boundary"].includes(n.kind)&&(n.fromNodeId===t.nodeId||n.toNodeId===t.nodeId)&&n.disposition!=="excluded"&&n.disposition!=="unsupported");for(let n of g){let d=n.toNodeId===t.nodeId,p=d?n.fromNodeId:n.toNodeId;if(C.has(p))continue;let b=u.get(p);if(!b?.location||!m(b.location.file))continue;let L=n.kind==="call"?oe(e,b):ae(b);if(!L||y(L))continue;let h=re(n,b.location.file)??b.location,w=q(e,h.file)[h.line]?.trim(),v=d?"upstream":"downstream",k=n.kind==="runtime-boundary"?d?"runtime-producer":"runtime-consumer":d?"caller":"callee",P=["call"],O=te(n.evidence),Ne=z(b);o.push({anchor:{id:R(t.id,h.line,b.id),status:O,source:"graph-relation",direction:v,causalRole:k,relationKind:n.kind,fromStepId:t.id,fromLabel:t.label,callsite:{file:h.file,line:h.line,endLine:h.endLine??h.line,text:w||`${b.label} \u2192 ${t.label}`,signals:P,calleeLeaf:Ne},alternatives:[L],alternativeCount:1,evidence:n.evidence}}),d&&(B+=1),n.kind==="runtime-boundary"&&(N+=1)}let x=i.edges.filter(n=>n.kind==="reference"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"&&!C.has(n.toNodeId));for(let n of x){let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=oe(e,d);if(!p||y(p))continue;let b=z(d),L=re(n,t.location.file)?.line,h=t.behavior.lines.find(P=>(L===void 0||L>=P.line&&L<=P.endLine)&&P.text.includes(b));if(!h)continue;let w=ye(h.signals),v=w==="result-callback",k=te(n.evidence);o.push({anchor:{id:R(t.id,h.line,d.id),status:k,source:"graph-relation",direction:"downstream",causalRole:w,relationKind:"reference",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:b},alternatives:[p],alternativeCount:1,evidence:n.evidence}}),v&&(r+=1)}let _=ne(e,t.location.file,t.location.line,t.location.endLine??t.location.line),F=q(e,t.location.file),W=ee(e,t.location.file,t.location.line,t.location.endLine??t.location.line);for(let n of _.targets){if(!m(n.definition.relativePath))continue;let d=K(t.location.file,n.sourceLine,n.calleeLeaf);if(f.has(d))continue;f.add(d);let p=ie(W.get(n.sourceLine)),b={symbol:n.definition.symbol,label:n.definition.leaf,file:n.definition.relativePath,line:n.definition.startLine,endLine:n.definition.endLine};y(b)||o.push({anchor:{id:R(t.id,n.sourceLine,n.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:n.sourceLine,endLine:n.sourceLine,text:F[n.sourceLine]?.trim()||`${n.calleeLeaf}()`,signals:p,calleeLeaf:n.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:n.definition.symbol,location:{file:t.location.file,line:n.sourceLine}}]}})}let c=t.behavior.lines.filter(n=>n.signals.includes("call"));if(c.length===0)continue;T+=1;let E=(Z(e,t.location.file)?.callSites??[]).filter(n=>c.some(d=>n.line>=d.line&&n.line<=d.endLine));D+=E.length;let se=i.edges.filter(n=>n.kind==="call"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"),Y=new Map;for(let n of se){let d=u.get(n.toNodeId);if(!d)continue;let p=z(d);Y.set(p,(Y.get(p)??0)+1)}let ce=I.get(t.id),de=Ie(e,ce?M.get(ce.symbolId)??[]:[]),Ae=Ee(de);for(let n of de){if(!m(n.alternative.file)||y(n.alternative))continue;let d=X(n.alternative.label),p=be(E,c,d,n.row.callsiteLine,Ae.get(d)===1);if(!p)continue;let b=H(c,p.line,d);if(!b)continue;let L=K(t.location.file,p.line,d);if(f.has(L))continue;f.add(L);let h=Se(n.row.source);o.push({anchor:{id:R(t.id,p.line,n.alternative.symbol??n.alternative.file),status:h,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:b.line,endLine:b.endLine,text:b.text,signals:b.signals,calleeLeaf:d},alternatives:[n.alternative],alternativeCount:1,evidence:[{method:n.row.source,strength:h,identity:n.row.symbol,location:{file:t.location.file,line:p.line}}]}})}for(let n of se){if(C.has(n.toNodeId))continue;let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=z(d),b=n.evidence.find(P=>{let O=P.location;return O!==null&&O.file===t.location?.file&&O.line>=0})?.location?.line,L=be(E,c,p,b,Y.get(p)===1);if(!L)continue;let h=H(c,L.line,p);if(!h)continue;let w=K(t.location.file,L.line,p);if(f.has(w))continue;f.add(w);let v=ae(d);if(!v||y(v))continue;let k=te(n.evidence);o.push({anchor:{id:R(t.id,L.line,d.id),status:k,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:p},alternatives:[v],alternativeCount:1,evidence:n.evidence}})}for(let n of E){let d=K(t.location.file,n.line,n.calleeLeaf);if(f.has(d))continue;let p=H(c,n.line,n.calleeLeaf);if(!p)continue;let b=ue(t.location.file,fe(e).get(n.calleeLeaf)??[]).flatMap(v=>U(e,v.file).filter(k=>k.symbol===v.symbol&&k.isFunctionLike)).filter(v=>m(v.relativePath)&&!y({symbol:v.symbol,label:v.leaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})),L=Q(b.map(v=>({symbol:v.symbol,label:v.leaf??n.calleeLeaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})));if(L.length===0){G+=1;continue}let h=`${t.id}\0${n.line}\0${n.calleeLeaf}`;if(V.has(h))continue;V.add(h);let w=L.length>1;w?$+=1:j+=1,o.push({anchor:{id:R(t.id,n.line,n.calleeLeaf),status:w?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:p.line,endLine:p.endLine,text:p.text,signals:p.signals,calleeLeaf:n.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}}return Ce(e,o,l.steps,s,{scannedBehaviorSteps:T,visibleCallsites:D,graphEvidencedCallsites:f.size,identityCandidateCallsites:j,ambiguousCallsites:$,unresolvedCallsites:G,upstreamCandidates:B,resultCandidates:r,runtimeCandidates:N},a.selectionTerms)}function Ue(e,i,l){let a=new Map(i.nodes.map(s=>[s.id,s]));for(let s of l.steps)if(!(!s.behavior||!s.location))for(let m of i.edges){if(m.kind!=="reference"||m.fromNodeId!==s.nodeId||m.disposition==="excluded"||m.disposition==="unsupported")continue;let u=a.get(m.toNodeId);if(!u?.location||!oe(e,u))continue;let C=z(u),S=re(m,s.location.file)?.line,A=s.behavior.lines.find(y=>(S===void 0||S>=y.line&&S<=y.endLine)&&y.text.includes(C));!A||ye(A.signals)!=="result-callback"||m.semantics?.some(({family:y,subtype:I})=>y==="control"&&I==="result-callback")||(m.semantics=[...m.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function ye(e){return e.includes("call")&&e.some(i=>["return","mutation","shape","spread","binding"].includes(i))?"result-callback":"callable-reference"}function ze(e,i,l={}){let a=l.limit??Le;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let s=l.sourceAllowed??(()=>!0),m=[],u=i.map((o,f)=>({id:o.id,nodeId:o.id,order:f,role:"anchor",kind:"source-construct",label:o.label,location:{file:o.file,line:o.startLine,endLine:o.endLine},behavior:null})),C=i.map(o=>({file:o.file,startLine:o.startLine,endLine:o.endLine})),S=0,A=0,y=0,I=0,M=0;for(let o of i){let f=q(e,o.file),T=(Z(e,o.file)?.callSites??[]).filter(r=>r.line>=o.startLine&&r.line<=o.endLine);S+=T.length;let D=ee(e,o.file,o.startLine,o.endLine),j=ne(e,o.file,o.startLine,o.endLine),$=new Set;for(let r of j.targets){if(!s(r.definition.relativePath)||C.some(x=>x.file===r.definition.relativePath&&x.startLine<=r.definition.startLine&&x.endLine>=r.definition.endLine))continue;let N=K(o.file,r.sourceLine,r.calleeLeaf);$.add(N);let t=ie(D.get(r.sourceLine)),g={symbol:r.definition.symbol,label:r.definition.leaf,file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine};m.push({anchor:{id:R(o.id,r.sourceLine,r.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:r.sourceLine,endLine:r.sourceLine,text:f[r.sourceLine]?.trim()||`${r.calleeLeaf}()`,signals:t,calleeLeaf:r.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:r.definition.symbol,location:{file:o.file,line:r.sourceLine}}]}})}A+=j.resolvedCallsites;let G=pe(e,o.file,{ranges:[{startLine:o.startLine,endLine:o.endLine}]}),B=new Map;for(let r of G.targets){let N=T.find(x=>x.line===r.line)?.calleeLeaf??r.calleeLeaf,t=K(o.file,r.line,N),g=B.get(t)??[];g.push(r),B.set(t,g)}for(let[r,N]of B){if($.has(r))continue;$.add(r);let t=N.filter(c=>s(c.targetFile)&&!C.some(E=>E.file===c.targetFile&&E.startLine<=c.targetStartLine&&E.endLine>=c.targetEndLine));if(t.length===0)continue;let g=t[0],x=T.find(c=>c.line===g.line)?.calleeLeaf??g.calleeLeaf,_=ie(D.get(g.line)),F=Q(t.map(c=>({symbol:c.targetSymbol??null,label:c.calleeLeaf,file:c.targetFile,line:c.targetStartLine,endLine:c.targetEndLine}))),W=t.some(c=>(c.resolutionAlternativeCount??0)>1)?"candidate":t.every(c=>c.strength==="exact")?"exact":"derived";m.push({anchor:{id:R(o.id,g.line,F.map(c=>`${c.file}:${c.line}`).join("|")),status:F.length>1?"ambiguous":W,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:g.line,endLine:g.line,text:f[g.line]?.trim()||`${g.calleeLeaf}()`,signals:_,calleeLeaf:x},alternatives:F.slice(0,3),alternativeCount:F.length,evidence:t.map(c=>({method:c.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":c.resolution==="factory-callback-member"?"ast-factory-callback-callsite":c.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:W,identity:c.targetSymbol??`${c.targetFile}:${c.targetStartLine}-${c.targetEndLine}`,location:{file:o.file,line:g.line}}))}})}A+=B.size;for(let r of T){let N=K(o.file,r.line,r.calleeLeaf);$.has(N)||(M+=1)}}return Ce(e,m,u,a,{scannedBehaviorSteps:i.length,visibleCallsites:S,graphEvidencedCallsites:A,identityCandidateCallsites:y,ambiguousCallsites:I,unresolvedCallsites:M,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function Ce(e,i,l,a,s,m=[]){let u=ke(i).sort(xe),C=u.filter(f=>we(e,f)).slice(0,a),S=new Set(C.map(f=>f.anchor.id)),A=u.filter(f=>!S.has(f.anchor.id)),y=C.map(f=>f.anchor),I=A.map(f=>f.anchor),M=Q(y.flatMap(f=>f.alternativeCount===1?f.alternatives:[])),o=Q(I.flatMap(f=>f.alternativeCount===1?f.alternatives:[]));return{anchors:y,withheldAnchors:I,candidateAnchors:u.length,omittedAnchors:Math.max(0,u.length-y.length),...s,inspectCommand:M.length===0?null:`codebaseiq inspect ${M.map(ve).join(" ")} --view behavior`,remainingInspectCommands:Me(o,8).map(f=>`codebaseiq inspect ${f.map(ve).join(" ")} --view behavior`)}}function xe(e,i){let l=e.anchor.alternatives[0],a=i.anchor.alternatives[0];return J(e.anchor.status)-J(i.anchor.status)||(e.anchor.direction??"").localeCompare(i.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(i.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(i.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(i.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(i.anchor.callsite.file)||e.anchor.callsite.line-i.anchor.callsite.line||(l?.file??"").localeCompare(a?.file??"")||(l?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(i.anchor.id)}function we(e,i){if(i.anchor.alternativeCount!==1)return!0;let l=i.anchor.alternatives[0],a=l.endLine??l.line;return q(e,l.file).slice(l.line,a+1).join(`
|
|
2
2
|
`).length<=2e4}function ie(e){return e?.includes("call")?[...e]:["call",...e??[]]}function Ie(e,i){let l=new Map;for(let a of i){let s=U(e,a.file).find(C=>C.symbol===a.symbol&&C.isFunctionLike);if(!s)continue;let m={symbol:s.symbol,label:s.leaf,file:s.relativePath,line:s.startLine,endLine:s.endLine},u=l.get(s.symbol);!u||he(a.source)>he(u.row.source)?l.set(s.symbol,{row:{...a,...a.callsiteLine===void 0&&u?.row.callsiteLine!==void 0?{callsiteLine:u.row.callsiteLine}:{}},alternative:m}):u.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&l.set(s.symbol,{...u,row:{...u.row,callsiteLine:a.callsiteLine}})}return[...l.values()]}function Ee(e){let i=new Map;for(let l of e){let a=X(l.alternative.label);i.set(a,(i.get(a)??0)+1)}return i}function Se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function he(e){return Se(e)==="exact"?2:1}function H(e,i,l){return e.find(a=>i>=a.line&&i<=a.endLine&&a.text.includes(l))??e.find(a=>i>=a.line&&i<=a.endLine)??null}function be(e,i,l,a,s){if(a!==void 0)return e.find(u=>u.line===a&&u.calleeLeaf===l&&H(i,u.line,l)!==null)??null;let m=e.filter(u=>u.calleeLeaf===l&&H(i,u.line,u.calleeLeaf)!==null);return s&&m.length===1?m[0]:null}function z(e){let i=e.attributes.leaf;if(typeof i=="string"&&i.length>0)return X(i);let l=e.label.slice(e.label.lastIndexOf(":")+1);return X(l)}function X(e){return e.replace(/\(\)$/u,"").replace(/^#/u,"")}function le(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function ae(e){return e.location?{symbol:le(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function oe(e,i){let l=ae(i);return l?.symbol&&U(e,l.file).some(s=>s.symbol===l.symbol&&s.isFunctionLike)?l:null}function re(e,i){return e.evidence.find(l=>l.location?.file===i)?.location??e.evidence.find(l=>l.location!==null)?.location??null}function te(e){let i={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((l,a)=>i[a.strength]>i[l]?a.strength:l,"unknown")}function ke(e){let i=new Map;for(let l of e){let s=l.anchor.alternatives[0]?.symbol??`${l.anchor.callsite.file}:${l.anchor.callsite.line}:${l.anchor.callsite.calleeLeaf}`,m=i.get(s);(!m||Re(l,m)<0)&&i.set(s,l)}return[...i.values()]}function Re(e,i){return J(e.anchor.status)-J(i.anchor.status)||e.anchor.alternativeCount-i.anchor.alternativeCount||xe(e,i)}function J(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function Q(e){let i=new Map;for(let l of e)i.set(l.symbol??`${l.file}:${l.line}`,l);return[...i.values()].sort((l,a)=>l.file.localeCompare(a.file)||l.line-a.line||l.label.localeCompare(a.label))}function ve(e){return`--at ${Te(`${e.file}:${e.line+1}`)}`}function Me(e,i){let l=[];for(let a=0;a<e.length;a+=i)l.push(e.slice(a,a+i));return l}function Te(e){return`'${e.replaceAll("'","'\\''")}'`}function K(e,i,l){return`${e}\0${i}\0${l}`}function R(e,i,l){return["next-anchor",e,String(i),l].map(encodeURIComponent).join(":")}export{qe as a,Ue as b,ze as c};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-RWAZCEJD.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S}from"./chunk-
|
|
1
|
+
import{c as S}from"./chunk-CRT7I7RJ.js";import{c as m}from"./chunk-UHFZDQZJ.js";import{h as y}from"./chunk-R2F2CTBA.js";import{a as h}from"./chunk-NMKQOIYZ.js";import{p}from"./chunk-RGBZDOUO.js";import{a as g}from"./chunk-NRNVMB2R.js";import f from"path";function W(e,t){let{scope:i,minDeviation:r=5,limit:n=50}=t??{},a=t?.semantic!==!1,u=t?.includePatternDeviations===!0,o=new m(e).fileDependencyGraph(i),l=S(e,{scope:i}),c=x([...D(e,o,{scope:i,semantic:a}),...R(l.forbiddenEdges),...u?E(o,r):[]]);return t?.includeArchitecture===!0&&(c.architecture=l),n<=0||c.results.length<=n?c:{...c,results:c.results.slice(0,n),totalResults:c.results.length}}function D(e,t,i){let r=_(e,i.scope),n=[],a=new Set;for(let[s,o]of t){if(d(s))continue;let l=r.get(s)??new Set;for(let c of o)d(c)||l.has(c)||v(e,s,c,i)||(n.push({file:s,dep:c}),a.add(s))}a.size>0&&w(e,r,{paths:[...a]});let u=[];for(let{file:s,dep:o}of n)(r.get(s)??new Set).has(o)||u.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${s} to ${o}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return u}function v(e,t,i,r){return C(e,t,i)||M(e,t,i)||O(i)||P(e,t,i)||N(i)?!0:r.semantic&&A(e,t,i)}function R(e){return e.flatMap(t=>{let i=t.examples[0];return i?[{file:i.fromFile,kind:"architecture-violation",description:`${t.from} depends on forbidden boundary ${t.to} through ${t.fileEdgeCount} file edge(s)`,dep:i.toFile,detail:`${t.from} may not depend on ${t.to}`,actionTier:"direct",policyBasis:"explicit",architecture:{fromBoundary:t.from,toBoundary:t.to,fileEdgeCount:t.fileEdgeCount,importerCount:t.importerCount,importedFileCount:t.importedFileCount,examples:t.examples},evidenceReasons:[`configured dependency row for ${t.from} does not allow ${t.to}`,`${t.fileEdgeCount} file edge(s) connect ${t.importerCount} importer(s) to ${t.importedFileCount} imported file(s)`,...t.examples.map(r=>`${r.fromFile} imports ${r.toFile}`)],recommendation:"Move the dependency behind an allowed boundary, reverse the dependency through an owned interface, or deliberately update the project architecture rule."}]:[]})}function E(e,t){let i=[];for(let[r,n]of k(e)){let a=n.filter(s=>!d(s));if(a.length<t)continue;let u=I(e,a);for(let s of a)for(let o of e.get(s)??[])d(o)||(u.get(o)??0)===1&&f.dirname(o)!==r&&f.dirname(o)!==f.dirname(r)&&i.push({file:s,kind:"pattern-deviation",description:`Only file in ${r}/ that depends on ${o}`,dep:o,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${r}/ were compared`,`${s} is the only non-skipped sibling depending on ${o}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."})}return i}function x(e){let t=e.filter(i=>i.kind==="architecture-violation").length;return{results:e,unusedImports:e.filter(i=>i.kind==="unused-import").length,architectureViolations:t,layerViolations:t,patternDeviations:e.filter(i=>i.kind==="pattern-deviation").length}}function k(e){let t=new Map;for(let i of e.keys()){let r=f.dirname(i),n=t.get(r);n||(n=[],t.set(r,n)),n.push(i)}return t}function I(e,t){let i=new Map;for(let r of t)for(let n of e.get(r)??[])d(n)||i.set(n,(i.get(n)??0)+1);return i}function _(e,t){let i=new Map;return $(e,i,t),i}function $(e,t,i){for(let r of F(e,i))b(e,t,r.from_file,r.to_file)}function F(e,t){let i=t?"AND d1.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -15,4 +15,4 @@ import{c as S}from"./chunk-LQHYYIOB.js";import{c as m}from"./chunk-BPKNP3KZ.js";
|
|
|
15
15
|
AND m.role != 1
|
|
16
16
|
${e.pathExclusionsFor("d1","d2")}
|
|
17
17
|
${i}`,...r)}function w(e,t,i={}){new m(e).scanSourceReferences({paths:i.paths??g(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},n=>{n.target.relativePath!==n.sourceFile&&(e.isIgnored(n.target.relativePath)||b(e,t,n.sourceFile,n.target.relativePath))})}function b(e,t,i,r){if(e.isIgnored(i)||e.isIgnored(r))return;let n=t.get(i);n||(n=new Set,t.set(i,n)),n.add(r)}function O(e){return e.includes("types")||e.endsWith(".d.ts")}function A(e,t,i){let r=y(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.isUsed)}function C(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.used)}function M(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.every(n=>n.isTypeOnly===!0)}function N(e){return e.endsWith(".vue")}function P(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length===0?!1:r.every(n=>n.kind==="side-effect"||n.kind==="namespace"&&n.usedMembers.length===0&&!n.used)}function d(e){let t=h(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||T(f.basename(e)))}function T(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{W as a};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-RWDIONS7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-MJX2J5QE.js";import{h as p}from"./chunk-R2F2CTBA.js";import{a as f}from"./chunk-DOQLO74K.js";import{d as u,e as _,i as N}from"./chunk-TNLOX4TN.js";import{p as d}from"./chunk-RGBZDOUO.js";import{a as I,z as l}from"./chunk-NRNVMB2R.js";import{w as b}from"./chunk-23AD24QZ.js";import{c}from"./chunk-6I55VYFG.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d ON c.document_id = d.id
|
|
@@ -32,4 +32,4 @@ import{a as g}from"./chunk-LMTSB3TB.js";import{h as p}from"./chunk-KLX6NSWT.js";
|
|
|
32
32
|
WHERE imp_d.relative_path = ?
|
|
33
33
|
AND m.role = 2
|
|
34
34
|
ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-S3CJYDXP.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as D,c as L,i as H,k as O}from"./chunk-
|
|
1
|
+
import{a as D,c as L,i as H,k as O}from"./chunk-ESWVTSHU.js";import{j as T,o as B}from"./chunk-66Q5VLH6.js";import{d as A}from"./chunk-NMTSZXCL.js";import{c as _}from"./chunk-UHFZDQZJ.js";import{d as u,e as F}from"./chunk-TNLOX4TN.js";import{a as E}from"./chunk-RGBZDOUO.js";var J=5;function le(e,n={}){let{base:o="HEAD",minContainment:a=.7,minCallees:l=3,minSiteCoverage:t=.4,maxHelpers:p=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:g}=n,h=n.semantic!==!1,s=n.diffPlan??L(e,{base:o}),r={available:s.note!==D,base:o,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[],...s.note?{note:s.note}:{}};if(!r.available||s.changedFiles.length===0)return r;let k=new _(e),P=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let z=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):H({projectRoot:e.config.projectRoot,base:o,preloadPaths:O(s)}),f=Z(k,P,$,z);if(f.unavailable)return r.available=!1,r.note=`Base content unavailable: ${f.unavailable.reason}`,r;if(f.definitions.length===0)return r;let I=f.definitions.slice(0,p);f.definitions.length>p&&(r.note=`helper scoring capped at ${p} of ${f.definitions.length} new symbols`);let d=k.calleeEvidenceMap(I,{semantic:h}),q=I.filter(i=>!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)).map(i=>({def:i,callees:B((d.rows.get(i.symbolId)??[]).map(m=>m.symbol))}));for(let i of I)!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)||r.skipped.push({helperShortName:u(i.symbol),helperFile:i.relativePath,reason:"compiler-resolved callee evidence is incomplete or unavailable \u2014 unsafe to score"});let V=T(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,l),scanLimit:g,semantic:h}),M);for(let{def:i,callees:m}of q){let b=u(i.symbol);if(m.size<l){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:`fewer than ${l} meaningful callees \u2014 too small to score`});continue}let w=G(),N=Y(m,w);if(N===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let y=ee(e,i.symbolId);if(y.length===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}r.helpersChecked+=1;let v=K({candidateIndex:w,changed:P,helperCallees:m,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:a,minSiteCoverage:t,migratedFiles:y});v.length!==0&&(v.sort((C,S)=>j(S.migrationScope)-j(C.migrationScope)||S.containment-C.containment||S.siteCoverage-C.siteCoverage||C.file.localeCompare(S.file)),r.findings.push({helperSymbol:i.symbol,helperShortName:b,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:m.size,specificHelperCalleeCount:N,migratedFiles:y.sort(),leftovers:v.slice(0,J)}))}return r.findings.sort((i,m)=>(m.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(m.helperFile)),r.findings=r.findings.slice(0,c),r}function K(e){let n=[],o=U(e.helperSymbol,e.helperFile,e.migratedFiles),a=new Set;for(let l of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(l)??[])a.add(t);for(let l of a){let t=e.candidateIndex.corpus[l];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let p=A(e.helperCallees,t.callees);if(p<e.minContainment)continue;let c=[...e.helperCallees].filter(s=>t.callees.has(s)),g=t.callees.size===0?0:c.length/t.callees.size;if(g<e.minSiteCoverage||!c.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let h=W(o,t.symbol,t.file);n.push({symbol:t.symbol,shortName:u(t.symbol),file:t.file,...h,containment:p,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(u).sort()})}return n}function j(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,o){let a=new Set([...R(n),...x(F(e))]);for(let l of o)for(let t of R(l))a.add(t);return a}function W(e,n,o){let a=new Set([...R(o),...x(F(n))]);if(e.size===0||a.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let l=[...a].filter(t=>e.has(t)).sort();return l.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${l.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function R(e){return x(e.replace(/\.[^.]+$/,""))}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let o=0;for(let a of e)(n.docFreq.get(a)??0)<=n.ubiquityThreshold&&(o+=1);return o}function Z(e,n,o,a){let l=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let p=o.get(t.relativePath)??t.relativePath,c=a(p);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${E(t.leaf)}\\b`).test(c.content))&&l.push(t)}return{definitions:l}}function Q(e){return n=>{let o=e(n);return o===null?{state:"absent"}:{state:"present",content:o}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
5
|
WHERE m.symbol_id = ?
|
|
6
6
|
AND m.role != 1
|
|
7
7
|
${e.pathExclusionsFor("ref_d")}`,n).map(a=>a.relative_path)}export{le as a};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-S6UTKCBT.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{a as w,b as G,c as Te,d as Fe,e as $,f as Le,k as ie,l as oe}from"./chunk-75A23IID.js";import{a as W}from"./chunk-6CTSFS7R.js";import{a as Ne}from"./chunk-NRNVMB2R.js";import{h as De,k as se,t as qe,v as Oe}from"./chunk-23AD24QZ.js";import{d as Ce,e as je}from"./chunk-YMAGXBLT.js";import{d as ae}from"./chunk-3LCDIREB.js";import{E as Ae,H as S,L as Ee,P as ke,Q as F,R as re,S as Be,i as Ie,k as Re,o as we,q as l,s as Me,t as Pe,v as _,x as ve}from"./chunk-6I55VYFG.js";function Lt(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function Tr(t,e){if(t?.aborted)throw Lt(t,e)}import{join as kt}from"path";var Bt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function Dr(t,e={}){return z(kt(t,"gc.lock"),e)}function z(t,e={}){let n=e.waitMs??0,r=e.pollMs??10,i=e.now??$,o=i()+n;do{let s=Dt(t);if(s)return Nt(s);let a=o-i();if(a<=0)return null;qt(Math.min(r,a))}while(i()<=o);return null}function Dt(t){let e=Le(t,{kind:"generic",parseLegacy:Bt});return e.kind==="acquired"?e.lock:null}function Nt(t){return{release:()=>{t.release()}}}function qt(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}function _e(t,e,n={}){ie(t,Ge(e,n),{durability:"visibility",runtime:n.runtime})}function Or(t,e,n={}){return ie(t,Ge(e,n),{durability:"durable",runtime:n.runtime})}function Ge(t,e){let n=JSON.stringify(t,null,e.spacing);return e.trailingNewline?`${n}
|
|
2
|
+
`:n}import{execFileSync as Je,spawnSync as Jr}from"child_process";import{platform as Jt}from"os";import{resolve as Ht}from"path";import{createHash as Ot}from"crypto";import{existsSync as $e,renameSync as Ct,rmSync as jt,writeFileSync as _t}from"fs";import{tmpdir as Gt}from"os";import{join as $t}from"path";var We=`'use strict';
|
|
3
|
+
const NativeRegExp = globalThis.RegExp;
|
|
4
|
+
const escapeLoneSeparator = (args) =>
|
|
5
|
+
typeof args[0] === 'string' && args[0] === '\\\\' ? ['\\\\\\\\', ...args.slice(1)] : args;
|
|
6
|
+
globalThis.RegExp = new Proxy(NativeRegExp, {
|
|
7
|
+
construct(target, args) {
|
|
8
|
+
return Reflect.construct(target, escapeLoneSeparator(args));
|
|
9
|
+
},
|
|
10
|
+
apply(target, thisArg, args) {
|
|
11
|
+
return Reflect.apply(target, thisArg, escapeLoneSeparator(args));
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
`,Wt=/scip-python/i;function ze(t,e=process.platform){return e!=="win32"||!Wt.test(t)?[]:["--require",zt()]}function zt(t=Gt()){let e=Ot("sha256").update(We).digest("hex").slice(0,16),n=$t(t,`codebaseiq-indexer-compat-${e}.cjs`);if($e(n))return n;let r=`${n}.${process.pid}.tmp`;_t(r,We);try{Ct(r,n)}catch{if(jt(r,{force:!0}),!$e(n))throw new Error(`could not materialize indexer compatibility preload at ${n}`)}return n}var He=Jt()==="win32";function Ue(t){let e=He?"where":"which";try{return Je(e,[t],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var Ut=/\.(?:c|m)?js$/i,Vt=/\.(?:exe|com)$/i;function Qr(t,e){return Ut.test(t)?{binary:process.execPath,args:[...ze(t),t,...e]}:{binary:t,args:[...e]}}function Qt(t,e){return Je(t,e,{stdio:["ignore","pipe","ignore"],windowsHide:!0,encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function Ve(t,e={}){let n=e.isWindows??He,r=e.lookup??Qt,i;try{i=r(n?"where":"which",[t])}catch{return null}let o=i.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(!n){let s=o[0];return s?Ht(s):null}return o.find(s=>Vt.test(s))??null}import{execFileSync as Ke}from"child_process";import{createHash as Kt}from"crypto";import{existsSync as J,statSync as Xt}from"fs";import{createRequire as Yt}from"module";import{platform as Zt}from"os";import{dirname as Qe,join as L}from"path";var en=Yt(import.meta.url),si={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function ce(t){return[t.indexerBinary,...t.binaryAliases??[]]}function tn(t){let e=ce(t);return e.length===1?e[0]:e.join(" or ")}function de(t){for(let e of ce(t)){let n=Ve(e);if(n)return n}return rn(t)}function ai(t){return de(t)!==null||nn(t)}function nn(t){return Xe(t)!==null}function rn(t){let e=Xe(t);if(!e)return null;let r=JSON.parse(S(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return L(Qe(e),r);for(let i of ce(t)){let o=r[i];if(o)return L(Qe(e),o)}return null}function Xe(t){if(!t.bundledNpmPackage)return null;try{return en.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function on(t,e){for(let n of t.projectLocalBinaries??[]){let r=L(e,n);if(J(r))return r}return null}function sn(t,e){for(let n of t.projectLocalBinaries??[]){let r=L(e,n);if(J(r))return Ye(e,n,r)}return null}function ci(t,e){let n=an(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function an(t,e){try{return Ye(t,e.relativePath,e.configuredPath)}catch{return null}}function Ye(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=Ce(t,e,r),o=je(t,e,r),s=Xt(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:Kt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function cn(t,e,n={}){return(n.trustProjectTools?sn(t,e)?.canonicalPath:null)??de(t)}function di(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||le(n,e))return e;let r=Ze(n,e);return r?{...e,DOTNET_ROOT:r}:e}function li(t,e,n={}){let r=tn(t),i=e?cn(t,e,n):de(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&on(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=dn(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function dn(t){if(le(t,process.env))return{runnable:!0};let e=Ze(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=et(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ze(t,e){for(let n of et(e))if(le(t,{...e,DOTNET_ROOT:n}))return n;return null}function et(t){let e=[],n=t.DOTNET_ROOT;if(n&&J(n)&&e.push(n),Zt()==="darwin"&&Ue("brew"))try{let r=Ke("brew",["--prefix","dotnet@9"],{stdio:"pipe",windowsHide:!0,env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=L(r,"libexec");J(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function le(t,e){try{return Ke(t,["--version"],{stdio:"pipe",windowsHide:!0,env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var ln=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function H(t){let e=t.toLowerCase();return ln.some(n=>e.endsWith(n))}function V(t){let e=U(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(d=>[d.path,d])),i=t.snapshot.files.filter(d=>{let m=Ie(d.path,["typescript"]);return m==="config"||m==="ambient"}).map(d=>d.path),o=U([...e,...i]),s=o.find(d=>!r.has(d)),a=new Set(t.snapshot.files.map(d=>d.path)).size!==t.snapshot.files.length,c=!s&&o.some(d=>tt(r.get(d))),p=se(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:U(t.snapshot.typescriptProjects),membership:e})),u=new Map;return{identityFor(d,m){if(!n.has(d))return M("target-outside-project");if(a)return M("duplicate-input-path");if(s)return M("missing-input-fingerprint");if(c)return M("unreadable-input");let g=[],f,I;if(t.graph===null)g.push("dependency-graph-unavailable"),I="whole-project",f=o;else{let j=pn(d,t.graph,u);if(j.find(ne=>!r.has(ne)))return M("missing-input-fingerprint");if(f=U([...j,...i]),f.some(ne=>tt(r.get(ne))))return M("unreadable-input");I="dependency-closure"}let C=f.map(j=>fn(r.get(j)));return{version:1,key:se(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:p,inputs:C})),mode:I,inputFiles:f,reasons:g}}}}function un(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function pn(t,e,n){let r=n.get(t);if(r)return r;let i=un(t,e);return n.set(t,i),i}function fn(t){return{path:t.path,size:t.size,hash:t.hash}}function tt(t){return t.size<0||t.hash==="unreadable"}function M(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function U(t){return[...new Set(t)].sort()}import{createRequire as mn}from"module";var nt=mn(import.meta.url),k,Q;function yn(){if(k!==void 0)return k;try{k=nt("ts-morph")}catch{k=null}return k}function K(){if(Q)return Q;let t=yn();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=nt("ts-morph/package.json").version??"unknown"}catch{}return Q=`ts-morph:${e}:typescript:${t.ts.version}`,Q}function bi(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function hi(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var gn=De("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function ue(t,e,n){let r=gn.get(t,()=>bn(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function B(t){return Ne(t,{includeIgnored:!1}).filter(H).sort()}function bn(t){try{if(!t.generation.metadataRaw)return null;let e=_(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=Re(e.metadata.fingerprint);return n?{builder:V({projectFiles:B(t),snapshot:n,graph:W(t),engineIdentity:K()}),identities:new Map}:null}catch{return null}}function X(t,e){let n=new Map(t.map(i=>[i.symbol,i])),r=new Map(t.map(i=>[i.symbolId,[]]));for(let i of e.values())for(let o of i){let s=n.get(o.targetSymbol);s&&r.get(s.symbolId).push(o.location)}for(let[i,o]of r)r.set(i,hn(o));return r}function ot(t,e,n){let r=it(t,e),i=it(t,n),o=[...r].filter(d=>!i.has(d)).sort(),s=[...i].filter(d=>!r.has(d)).sort(),a=rt(t,e),c=rt(t,n),p=[...a].filter(d=>!c.has(d)).sort(),u=[...c].filter(d=>!a.has(d)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:p.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:p,extra:u}}}function rt(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function Ti(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,Sn(s));return i}function it(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function hn(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(st)}function Sn(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||st(n.location,r.location))}function st(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var pe="typescript-reference-fragment-v3-incomplete-scan",Y=qe({kind:"typescript-reference-fragments",invalidation:Oe("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:In});function ji(t,e,n,r=t){let i=B(t),o=V({projectFiles:i,snapshot:e,graph:W(t),engineIdentity:K()}),s=[...n].map(([a,c])=>({relativePath:a,contentHash:o.identityFor(a,pe).key,value:[...c]}));if(s.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return Y.writeBatch(r,s.map(a=>({...a,contentHash:a.contentHash}))),s.length}function _i(t,e,n,r){let i=e.filter(s=>H(s.relativePath));if(i.length===0)return D("no TypeScript definitions");let o=D("shadow did not run");return ae("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=D("TypeScript reference fragment provider is unavailable"),o;let a=B(t),c=new Set(a),p=s.referenceFragmentsForFiles(a),u=a.filter(f=>!p.has(f));if(u.length>0)return o=D(`TypeScript reference lookup was incomplete for ${u.length} file(s)`),o;let d=X(i,p),m=ot(i,xn(n,c),d);if(!m.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...m},o;let g=[];for(let f of a){let I=ue(t,f,pe);I?.key&&g.push({relativePath:f,contentHash:I.key,value:p.get(f)??[]})}return Y.writeBatch(t,g),o={state:"passing",files:a.length,keyedFiles:g.length,writtenFiles:g.length,...m},o}catch(s){return o=D(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function xn(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function Gi(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return ae("typescript.reference-fragments.materialize",()=>{try{let c=B(t);i=c.length;let p=new Map,u=new Map,d=[];for(let f of c){let I=ue(t,f,pe);if(!I?.key)return null;p.set(f,I.key);let C=Y.read(t,f,I.key);C===null?(s+=1,d.push(f)):(o+=1,u.set(f,C))}if(s===0)return r="hit",{references:X(e,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a};let m=n(e[0].relativePath);if(!m.availability().available||!m.referenceFragmentsForFiles)return null;let g=m.referenceFragmentsForFiles(d);if(d.some(f=>!g.has(f)))return null;a=g.size,Y.writeBatch(t,d.map(f=>({relativePath:f,contentHash:p.get(f),value:g.get(f)??[]})));for(let[f,I]of g)u.set(f,I);return r="computed",{references:X(e,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function D(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function In(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Rn)?null:e}catch{return null}}function Rn(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as wn,randomUUID as Mn}from"crypto";import{existsSync as P,mkdirSync as Pn,readdirSync as vn,rmSync as dt,statSync as lt}from"fs";import{basename as An,dirname as Z,join as x}from"path";var En=1,Tn=1,Fn=".codebaseiq-generations",Ln="manifest.json",ut="readers",kn="gc.lock",Bn=128,N=new Map,pt={pid:process.pid,now:()=>new Date,randomToken:()=>Mn(),isProcessAlive:Fe,readProcessIdentity:Te,resolveImmutableGeneration:yt};function v(t){return x(Z(t),Fn)}function ft(t){return x(v(t),kn)}function eo(t,e=pt){if(Be())return{generation:at(t),release(){}};let n=z(ft(t.dbPath),{waitMs:5e3});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");let r;try{let o=ge(t.dbPath);if(!o||!mt(t.dbPath,o.currentGeneration))return{generation:at(t),release(){}};let s=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(s))throw new Error("SQLite generation reader token is unsafe.");let a=x(v(t.dbPath),ut);Pn(a,{recursive:!0});let c=x(a,`${e.pid}-${s}.json`),p=e.readProcessIdentity(e.pid);_e(c,{version:1,token:s,generationIdentity:o.currentGeneration,pid:e.pid,...p?{processIdentity:p}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let u=!1;r={identity:o.currentGeneration,required:o.artifactSet==="immutable-v1",release(){u||(u=!0,dt(c,{force:!0}))}}}finally{n.release()}let i;try{i=e.resolveImmutableGeneration(t,r.identity)}catch(o){throw r.release(),o}if(i?.source==="immutable"&&i.identity===r.identity)return{generation:i,release:r.release};if(r.release(),r.required)throw new Error(`Published SQLite generation ${r.identity} is missing or invalid.`);return Dn(t,r.identity)}function Dn(t,e){let n=z(ft(t.dbPath),{waitMs:5e3});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");try{let r=ge(t.dbPath);if(r?.currentGeneration!==e)throw new Error("SQLite index publication changed while opening a legacy generation.");if(P(x(Z(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return{generation:gt(t,r.currentGeneration),release(){}}}finally{n.release()}}function to(t,e,n=pt,r={}){let i=x(v(t),ut);if(!P(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,c=0;for(let p of vn(i,{withFileTypes:!0})){if(!p.isFile()||!p.name.endsWith(".json"))continue;let u=x(i,p.name),d;try{d=Nn(JSON.parse(S(u,"SQLite generation reader lease")))}catch{d=null}if(!d){c+=1;for(let m of e)o.add(m);continue}if(!qn(d,n)){r.removeStale!==!1&&(dt(u,{force:!0}),a+=1);continue}s+=1,o.add(d.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:c}}function Nn(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=e.processIdentity===void 0?null:w(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...n?{processIdentity:n}:{},acquiredAt:e.acquiredAt}}function qn(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let n=e.readProcessIdentity(t.pid);return n===null||G(t.processIdentity,n)}function ge(t){try{let e=JSON.parse(S(x(v(t),"state.json"),"SQLite generation state"));return Gn(e)?e:null}catch{return null}}function mt(t,e){return On(v(t),e)}function On(t,e){try{let n=JSON.parse(S(x(t,e,Ln),"SQLite generation manifest"));return _n(n,e)?n:null}catch{return null}}function at(t){let e=ge(t.dbPath);if(e){let n=yt(t,e.currentGeneration);if(n)return n;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(P(x(Z(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return gt(t,e?.currentGeneration)}function Cn(t){return ve(_(t))??t}function yt(t,e){try{let n=x(v(t.dbPath),e),r=mt(t.dbPath,e);if(!r)return null;let i=fe(n,r.database),o=r.index?fe(n,r.index):void 0,s=r.metadata?fe(n,r.metadata):void 0;return!me(i,r.database)||r.index&&(!o||!me(o,r.index))||r.metadata&&(!s||!me(s,r.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:S(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function gt(t,e){let n=bt(t.dbPath),r=x(Z(t.dbPath),"meta.json"),i=P(r)?S(r,"reindex metadata"):void 0,o=P(t.indexPath)?t.indexPath:void 0;return{identity:e??jn(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:r,metadataRaw:i},source:"legacy",databaseFileIdentity:n}}function jn(t,e){let n=wn("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&n.update(Cn(e)),n.update(`\0${bt(t)}`),n.digest("hex")}function bt(t){let e=lt(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function fe(t,e){if(An(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return x(t,e.file)}function me(t,e){if(!P(t))return!1;let n=ct(t);if(!n||n.size!==e.size)return!1;let r=`${t}\0${e.sha256}\0${n.identity}`;if(N.has(r))return!0;let i=Ee(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=ct(t);if(!o||o.identity!==n.identity||i!==e.sha256)return!1;for(N.set(r,!0);N.size>Bn;){let s=N.keys().next().value;if(s===void 0)break;N.delete(s)}return!0}function ct(t){let e=lt(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function _n(t,e){return t.version===Tn&&t.identity===e&&ye(t.database)&&(t.index===void 0||ye(t.index))&&(t.metadata===void 0||ye(t.metadata))}function ye(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function Gn(t){return t.version===En&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&$n(t.stableMirrors)&&Wn(t.previousGeneration)&&zn(t.publication)}function $n(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function Wn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function zn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,n=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(r=>r!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&n.every(r=>typeof r=="number"&&Number.isFinite(r)&&r>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}function ro(t){return t.startsWith("local ")}import{zstdCompressSync as Hn,zstdDecompressSync as Un}from"zlib";function ao(t){return Hn(Buffer.from(JSON.stringify(t.map(e=>[e.symbol,e.roles,e.range,e.enclosingRange]))))}function St(t){let e;try{e=JSON.parse(Un(t).toString("utf8"))}catch{return null}return Array.isArray(e)?e.map(([n,r,i,o])=>({symbol:n,roles:r,range:i,enclosingRange:o})):null}function Vn(t){return t.length===1&&t[0]===0}function co(t,e){let n=t.all(`SELECT c.occurrences
|
|
15
|
+
FROM chunks c
|
|
16
|
+
JOIN documents d ON d.id = c.document_id
|
|
17
|
+
WHERE d.relative_path = ?
|
|
18
|
+
ORDER BY c.chunk_index, c.id`,e),r=[];for(let i of n){if(Vn(i.occurrences))continue;let o=St(i.occurrences);if(!o)return null;r.push(...o)}return r}function lo(t,e){let n=new Map(e.map(i=>[i,[]])),r=new Map;for(let i of ht([...n.keys()])){let o=t.all(`SELECT DISTINCT m.chunk_id, gs.symbol
|
|
19
|
+
FROM mentions m
|
|
20
|
+
JOIN global_symbols gs ON gs.id = m.symbol_id
|
|
21
|
+
WHERE gs.symbol IN (${i.map(()=>"?").join(",")})`,...i);for(let s of o){let a=r.get(s.chunk_id)??[];a.push(s.symbol),r.set(s.chunk_id,a)}}for(let i of ht([...r.keys()])){let o=t.all(`SELECT c.id, d.relative_path, c.occurrences
|
|
22
|
+
FROM chunks c
|
|
23
|
+
JOIN documents d ON d.id = c.document_id
|
|
24
|
+
WHERE c.id IN (${i.map(()=>"?").join(",")})`,...i);for(let s of o){let a=St(s.occurrences);if(!a){for(let c of r.get(s.id)??[])n.set(c,null);continue}for(let c of a)(c.roles&1)===0&&n.get(c.symbol)?.push({relativePath:s.relative_path,occurrence:c})}}return n}function ht(t){let e=[];for(let n=0;n<t.length;n+=750)e.push(t.slice(n,n+750));return e}import{createHash as Qn,randomUUID as Mt}from"crypto";import{existsSync as T,lstatSync as O,readdirSync as E,renameSync as Pt,rmSync as R}from"fs";import{basename as be,dirname as Kn,join as y}from"path";function ee(t){return Array.isArray(t)?`[${t.map(ee).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${JSON.stringify(e)}:${ee(n)}`).join(",")}}`:JSON.stringify(t)}var Xn=1,Yn=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}),A=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Zn=".owner.json",er={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function Ro(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function tr(t={}){let e={...Yn,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function vt(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ke(n));return re(...e)}function wo(t,e){return Qn("sha256").update(ee({namespace:t,payload:e})).digest("hex")}function nr(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function Mo(t,e,n={}){let r=tr(n.limits),i=n.nowMs??Date.now(),o=vt(t);return lr(e),ir(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??$,()=>{rr(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),c=xt(t,e.id);if(c){let m=It(c,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:m.deadlineAtMs??e.deadlineAtMs}}let p=`${JSON.stringify(e)}
|
|
25
|
+
`,u=Buffer.byteLength(p),d=At(t);if(u>r.maxItemBytes)throw new A("item-too-large",d,r,u);if(d.totalItems+1>r.maxItems)throw new A("item-capacity",d,r,u);if(d.totalBytes+u>r.maxBytes)throw new A("byte-capacity",d,r,u);n.onBeforePublish?.();try{let m=oe(s,p,{durability:"durable"}),g=re(o,m.directorySync);return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:g==="synced"?"directory-durable":"file-flushed",directorySync:g}}catch(m){if(m.code!=="EEXIST")throw m;let g=xt(t,e.id);if(!g)throw m;let f=It(g,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:f.deadlineAtMs??e.deadlineAtMs}}})}function rr(t,e,n,r=er){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of Se(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(T(a)){R(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||cr(t,s.ownerId,r)!=="dead")continue;let c=y(t.pendingDir,s.originalFile);try{Pt(s.path,c),i.reclaimed++}catch(p){if(p.code!=="EEXIST")throw p;R(s.path,{force:!0})}F(Kn(s.path)),F(t.pendingDir),o--}o=Rt(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Rt(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of Et(s)){if(o<=0)break;be(a).includes(".tmp-")&&(O(a).mtimeMs+n.temporaryRetentionMs>e||(R(a,{force:!0}),i.temporaryFilesRemoved++,o--))}}return ur(t.inflightDir),i}function At(t){vt(t);let e=[...q(t.pendingDir).map(c=>({path:c,pending:!0})),...q(t.legacyRequestDir).map(c=>({path:c,pending:!0}))],n=Se(t.inflightDir).map(c=>({path:c.path,pending:!1})),r=q(t.responseDir).map(c=>({path:c,pending:!1})),i=q(t.deadLetterDir).map(c=>({path:c,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let c of e){let p=xe(c.path);if(!p){s++;continue}let u=p.enqueuedAtMs??O(c.path).mtimeMs;a=a===void 0?u:Math.min(a,u)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((c,p)=>c+pr(p.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function ir(t,e,n,r,i){let o=y(t.rootDir,".admission.lock"),s=`${process.pid}-${Mt()}`,a=r()+Math.max(0,n);for(;!or(t.rootDir,o,s);){if(sr(o),r()>=a)throw new A("admission-busy",At(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return i()}finally{try{he(o).ownerToken===s&&(R(o,{recursive:!0,force:!0}),F(t.rootDir))}catch{}}}function or(t,e,n){let r=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
26
|
+
`;try{return oe(e,r,{durability:"durable"}),!0}catch(i){if(i.code==="EEXIST")return!1;try{he(e).ownerToken===n&&(R(e,{force:!0}),F(t))}catch{}throw i}}function sr(t){let e=null;try{let r=he(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||ar(e))return;let n=`${t}.stale-${Mt()}`;try{Pt(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}R(n,{recursive:!0,force:!0})}function he(t){try{return JSON.parse(S(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof Ae&&e.reason==="not-regular"))throw e;return JSON.parse(S(y(t,"owner.json"),"mailbox lock owner record"))}}function ar(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function cr(t,e,n){let r=dr(y(t.inflightDir,Tt(e),Zn));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?G(r.processIdentity,i)?"live":"dead":"unknown"}function dr(t){try{let e=JSON.parse(S(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:w(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function xt(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(T(n))return n;for(let n of Se(t.inflightDir))if(n.requestId===e)return n.path;return null}function It(t,e,n){let r=xe(t);if(!r||r.operationKey!==e)throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`);return r}function lr(t){if(t.mailboxVersion!==Xn||t.id!==nr(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function Se(t){if(!T(t))return[];let e=[];for(let n of E(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=wt(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of E(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=wt(s[1]),c=Number(s[2]);if(a===null||be(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(c))continue;let p=y(i,o.name),u=xe(p)??{id:be(a,".json")},d=O(p);e.push({requestId:u.id,ownerId:r,path:p,originalFile:a,claimedAtMs:d.mtimeMs,claimExpiresAtMs:c,byteLength:d.size,...u.operationKey?{operationKey:u.operationKey}:{},...u.clientId?{clientId:u.clientId}:{},...u.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.enqueuedAtMs},...u.deadlineAtMs===void 0?{}:{deadlineAtMs:u.deadlineAtMs},legacy:u.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function xe(t){try{let e=JSON.parse(S(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Rt(t,e,n,r,i){for(let o of q(t)){if(e<=0)break;let s=O(o);n(o,s.mtimeMs)>r||(R(o,{force:!0}),i(),e--)}return e}function q(t){return T(t)?E(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function Et(t){if(!T(t))return[];let e=[];for(let n of E(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...Et(r))}return e.sort()}function ur(t){if(T(t))for(let e of E(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);E(n).some(r=>r.endsWith(".claim"))||R(n,{recursive:!0,force:!0})}}function pr(t){try{return O(t).size}catch{return 0}}function Tt(t){return Buffer.from(t,"utf8").toString("base64url")}function wt(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return Tt(e)===t?e:null}catch{return null}}import{join as te}from"path";var fr="watch.lock",mr="watch-state.json",yr="watch-activity.json",gr="watch-refresh-requests";function Lo(t){return{lockPath:te(t,fr),statePath:te(t,mr),activityPath:te(t,yr),refreshRequestsPath:te(t,gr)}}function ko(t){try{return br(JSON.parse(S(t,"watch service state")))}catch{return null}}function br(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!b(e.startedAt)||!b(e.heartbeatAt)||!b(e.lastActivityAt)||!hr(e.watcher)||e.idleDeadlineAt!==void 0&&!b(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=w(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!Sr(e.lastError)||e.lastRefresh!==void 0&&!xr(e.lastRefresh)||e.reindexActivity!==void 0&&!Ir(e.reindexActivity)||e.refreshRequests!==void 0&&!wr(e.refreshRequests)||e.typescriptSemantic!==void 0&&!Mr(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Pr(e.typescriptIndex)||e.queryLane!==void 0&&!vr(e.queryLane)?null:e}function b(t){return we(t)}function hr(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return h(e.changedFiles)&&h(e.reindexAt);case"indexing":return h(e.startedAt);case"cooldown":return h(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return h(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&l(e.rebuilt)&&l(e.estimatedWriteBytes);case"draining":return h(e.startedAt)&&typeof e.reason=="string";default:return!1}}function Sr(t){if(!t||typeof t!="object")return!1;let e=t;return b(e.at)&&typeof e.message=="string"}function xr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&b(e.startedAt)&&b(e.completedAt)&&h(e.durationMs)}function Ir(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!l(e.recordsRead)||e.invalidRecords!==void 0&&!l(e.invalidRecords)||e.skippedRecords!==void 0&&!l(e.skippedRecords)||e.readErrors!==void 0&&!l(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!l(e.ignoredPartialTailBytes)||!b(e.windowStartedAt)||!b(e.windowEndedAt)||!l(e.runs)||!l(e.rebuilt)||!l(e.reused)||!l(e.failed)||!l(e.suppressed)||!h(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!l(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!l(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!l(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!b(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!b(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!l(e.attributedRuns)||e.unattributedRuns!==void 0&&!l(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!l(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!Rr(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||l(n))}function Rr(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!Pe.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!l(r.runs)||!l(r.rebuilt)||!l(r.reused)||!l(r.producedOutputBytes)||!Me(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function wr(t){if(!t||typeof t!="object")return!1;let e=t;return l(e.pending)&&l(e.claimed)&&l(e.completed)&&l(e.expired)&&l(e.invalid)&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function Mr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&h(e.requests)&&h(e.sessionsCreated)&&h(e.sessionsReused)&&h(e.sessionsRefreshed)&&h(e.sessionsReplaced)&&h(e.projectsCreated)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||Ft(e.mailbox))}function Pr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&l(e.requests)&&l(e.sessionsCreated)&&l(e.sessionsReplaced)&&l(e.initializations)&&l(e.programUpdates)&&l(e.documentsEmitted)&&l(e.documentsRemoved)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastDurationMs===void 0||h(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||Ft(e.mailbox))}function vr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&typeof e.socketPath=="string"&&e.socketPath.length>0&&l(e.requests)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")}function Ft(t){if(!t||typeof t!="object")return!1;let e=t;return l(e.pending)&&l(e.inflight)&&l(e.responses)&&l(e.deadLetters)&&l(e.invalid)&&l(e.totalItems)&&h(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function h(t){return typeof t=="number"&&Number.isFinite(t)}export{Lt as a,Tr as b,Dr as c,z as d,_e as e,Or as f,En as g,Tn as h,Fn as i,Ln as j,v as k,ft as l,eo as m,to as n,ge as o,mt as p,On as q,at as r,Cn as s,bt as t,Ue as u,Qr as v,si as w,tn as x,de as y,ai as z,on as A,sn as B,ci as C,di as D,li as E,ee as F,Xn as G,Ro as H,wo as I,nr as J,Mo as K,ro as L,ao as M,co as N,lo as O,Lo as P,ko as Q,ln as R,H as S,yn as T,bi as U,hi as V,Ti as W,V as X,ue as Y,ji as Z,_i as _,Gi as $};
|
|
27
|
+
//# sourceMappingURL=chunk-SLLFJXTW.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-G2UU6PQP.js";import{a as G}from"./chunk-QDCCHMVZ.js";import{l as F,r as O,s as L,t as z,v as $,w as T}from"./chunk-23AD24QZ.js";import{d as X,f as U,h as S}from"./chunk-YMAGXBLT.js";import{a as H,d as K}from"./chunk-3LCDIREB.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(B(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(B(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return B(t)===null}function B(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
|
|
2
2
|
`).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function A(t,n){return n.filter(e=>t.includes(e))}var ct=/<!--\s*codebaseiq:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=T(t,n);return i.length>0&&ct.test(i)}var J={classifyCitation:lt,citationContexts:dt,citationKindLabel:ft,citationRemediation:gt,referenceTargets:ht,hasLineAnchoredCitation:at};function at(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function lt(t){let n=t.join(`
|
|
3
3
|
`).toLowerCase(),e=[],i=A(n,[".codebaseiq","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=A(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=A(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function dt(t,n,e){let i=T(t,n);if(!i&&!S(t.config.projectRoot,n))return[];let r=i.split(/\r?\n/),o=e.flatMap(ut),s=[];for(let c=0;c<r.length;c+=1){let a=r[c]??"";o.some(d=>a.includes(d))&&s.push(I(r,c))}return s}function ut(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function ft(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function gt(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function ht(t,n,e){let i=q(e),r=new Set;for(let o of n)mt(t,o,i.get(o)??[])&&r.add(o);return r}function mt(t,n,e){if(!pt.test(n)||!S(t.config.projectRoot,n))return!0;if(e.length===0)return!1;let i=U(t.config.projectRoot,n,{inputKind:"changed source file"}).split(/\r?\n/),r=yt(i);for(let o of e)for(let s=o.startLine;s<=o.endLine;s+=1)if((i[s]??"").trim()!==""&&!r.has(s))return!0;return!1}var pt=/\.(?:[cm]?[jt]sx?)$/i;function yt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Ct(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Ct(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=z({kind:"doc-path-evidence",invalidation:$("doc-path-evidence"),serialize:jt,deserialize:Lt}),v=/\.(?:md|mdx|rst|txt)$/i;function bt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Dt=3,St=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function en(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Dt,includeSnapshotExcluded:o=!1}=n,s=At(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!Y(t,a)||e!==void 0&&!S(t.config.projectRoot,a))continue;let d=Z(t,a);if(d&&!o)continue;let{value:p,estimated:y}=xt(t,a,s.changeTimes.get(a)),g=Rt(t,a),u=new Map,{resolved:l,broken:h,citations:D}=wt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),x=new Map(D.map(f=>[f.file,f]));for(let f of l){if(f===a||v.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(b=>b>p).length;if(C===0)continue;let m=x.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...P("reference",g,m?.contexts),citationContexts:m?.contexts,citedLines:m?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let m=(s.changeTimes.get(f)??[]).filter(M=>M>p).length;if(m===0)continue;let b=u.get(f);b?(b.evidence="both",b.coChanges=C,Object.assign(b,P("both",g,b.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:m,...P("co-change",g)})}if(u.size===0&&h.length===0)continue;let R=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:p,staleness:R.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+h.length*10,subjects:R.slice(0,8),brokenReferences:h,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function xt(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(X(t.config.projectRoot,n).mtimeMs/1e3),estimated:!0}}catch(i){if(S(t.config.projectRoot,n))throw i;return{value:0,estimated:!1}}}function Rt(t,n){let e=T(t,n).slice(0,6e3);if(!e)return{docIntent:"unknown",reasons:["doc text unavailable"]};let i=`${n}
|
|
4
4
|
${e}`.toLowerCase(),r=A(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=A(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function P(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:Tt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function Tt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function At(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],p=d.filter(g=>v.test(g)),y=d.filter(g=>!v.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of p){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>v.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:tt(r)}}function rn(t,n){if(n.size===0)return[];let e=H(),i=0,r=0,o=0,s=0,c=0,a=0;return K("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let p=tt(d),y=Mt(n,p),g=[];for(let u of d){if(!Y(t,u))continue;e&&(r+=1);let l=T(t,u);if(!l&&!S(t.config.projectRoot,u)){e&&(o+=1);continue}if(!It(l,y)){e&&(s+=1);continue}let h=nt(t,u,l);if(!h)continue;e&&(c+=1);let D=vt(h.candidates,n,y,d,p);if(D.size===0)continue;let x=[...new Set([...D.values()].flatMap(m=>[...m]))],R=Et(h.contextsByCandidate,x),f=[...D].map(([m,b])=>({file:m,contexts:k([...b].flatMap(M=>R.get(M)??[])).slice(0,3),lineReferences:j([...b].flatMap(M=>h.lineReferencesByCandidate.get(M)??[]))})).filter(m=>m.contexts.length>0),C=[...D.keys()];if(C.length>0){e&&(a+=1);let m=C.sort();g.push({doc:u,cited:m,citations:f,citedClaims:k(f.flatMap(b=>b.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function Y(t,n){return v.test(n)&&!bt(n)&&S(t.config.projectRoot,n)}function tt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function vt(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function wt(t,n,e,i,r){let o=new Set,s=new Set,c=nt(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,p=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,h)=>{let D=d.get(h);if(D&&D.length>0){let R=y.get(l)??[];R.push(...D),y.set(l,k(R).slice(0,3))}let x=p.get(h);x&&x.length>0&&g.set(l,j([...g.get(l)??[],...x]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let h=i.get(l);if(h&&h.length===1){o.add(h[0]),u(h[0],l);continue}h&&h.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,h])=>({file:l,contexts:h,lineReferences:g.get(l)}))}}function Et(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function nt(t,n,e){let i=e;if(i===void 0&&(i=T(t,n),!i&&!S(t.config.projectRoot,n)))return null;let r=F(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=kt(i);return Q.write(t,n,r,s),s}function It(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function kt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(St)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,j([...r.get(a)??[],d]));let p=I(n,o);if(p.length===0)continue;let y=i.get(a)??[];y.push(p),i.set(a,k(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function jt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Lt(t){try{let n=JSON.parse(t);if(!O(n))return null;let e=L(n.candidates),i=Nt(n.contextsByCandidate),r=_t(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function _t(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],j(i)])}return n}function Nt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function k(t){let n=[];for(let e of new Set(t))n.some(i=>Bt(i,e))||n.push(e);return n}function j(t){return[...new Set(t)].sort((n,e)=>n-e)}function Bt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{bt as a,en as b,rn as c};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-T3KTMLQT.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as M}from"./chunk-R7PXHYMY.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{o as I}from"./chunk-R2F2CTBA.js";import{d as D}from"./chunk-SGX43S2L.js";import{d as b,j as h,p as x,q as y,u as L}from"./chunk-TNLOX4TN.js";import{a as g,e as S}from"./chunk-RGBZDOUO.js";import{w as d}from"./chunk-23AD24QZ.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TB575ZGO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{C as s}from"./chunk-NRNVMB2R.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TG4GMU73.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{m as o}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{m as o}from"./chunk-74LRKLNC.js";import{l as n}from"./chunk-AZDY3EKD.js";async function i(t){if(typeof t!="string"||t.length===0)throw new Error("Output continuation requires a cursor.");await o(t,n)}var u={id:"continue",command:"continue <cursor>",hidden:!0,description:"Continue an immutable output snapshot",renderShape:"custom",handler:i};export{u as a};
|
|
3
|
+
//# sourceMappingURL=chunk-THKM7OXM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _,g as C,j as T,o as $,p as w}from"./chunk-
|
|
1
|
+
import{a as _,g as C,j as T,o as $,p as w}from"./chunk-RGBZDOUO.js";import{C as O,a as x}from"./chunk-NRNVMB2R.js";import{g as y,h as R,l as S,m as h,r as D,t as E,v as M,w as k,x as N}from"./chunk-23AD24QZ.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||A(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!A(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function A(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
4
|
JOIN documents d ON der.document_id = d.id
|
|
@@ -114,4 +114,4 @@ import{a as _,g as C,j as T,o as $,p as w}from"./chunk-F74LZWCE.js";import{C as
|
|
|
114
114
|
${e.symbolNoiseFor("gs")}
|
|
115
115
|
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
116
|
ORDER BY d.relative_path, start_line, end_line`,...s)}function De(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function q(e,n){return n==="callable"?De(e):_e(e)}function _e(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function G(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Sn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>F(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(z(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Ie(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function hn(e,n){let t=U.get(e);return t||(t=Ie(e),U.set(e,t)),t.get(n)??null}function xn(e,n){let t=F(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function V(e,n,t){let i=g(e).forFile(n,{text:!0}).text,r=T(e,n);return r?ke(t,r,i):i?Le(t,i):t}function Le(e,n){let t=n.split(/\r?\n/),i=Fe(e,t),r=Re(e,i),s=Ee(r,t);return Me(e,s)}function Fe(e,n){let t=e.some(r=>b(r.symbol))?Ae(n):null,i=new Map;for(let r of e)i.set(r.symbolId,we(n,t,r));return i}function Re(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ee(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ve(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function ke(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!$e(r)||!r.leaf)return K(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return K(r,t);let o=t?Ne(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ne(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${_(i)}\\b`);for(let o of n){let a=Ce(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ce(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return Te(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function Te(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function $e(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function K(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=_(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function we(e,n,t){if(!b(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function Ae(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function ve(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Pe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Pe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function b(e){return e.includes("().")}function Dn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{g as a,u as b,m as c,v as d,P as e,p as f,Qe as g,Q as h,je as i,Be as j,Je as k,We as l,ze as m,Ue as n,Ge as o,W as p,z as q,I as r,pn as s,F as t,gn as u,Se as v,bn as w,yn as x,Sn as y,Ie as z,hn as A,xn as B,Dn as C};
|
|
117
|
-
//# sourceMappingURL=chunk-
|
|
117
|
+
//# sourceMappingURL=chunk-TNLOX4TN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as F}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as F}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-ETZBIG6K.js";import{h as le}from"./chunk-2QJAVISG.js";import{b as $,d as ne,e as te,f as ie,g as oe,h as re,j as N,k as ae,l as se}from"./chunk-NB2DAVPP.js";import{d as ee}from"./chunk-ELNRLMC5.js";import{f as X,h as Z}from"./chunk-GLXEWYQY.js";import{a as C}from"./chunk-NMKQOIYZ.js";import{a as H}from"./chunk-6CTSFS7R.js";import{a as O,e as z,g as E,h as P,j as Q,k as W,t as D,u as Y,v as J,w as U,x as A}from"./chunk-TNLOX4TN.js";import{k as G,m as S}from"./chunk-RGBZDOUO.js";import{A as V,K as B,a as v,z as y}from"./chunk-NRNVMB2R.js";import{w as _,z as M}from"./chunk-23AD24QZ.js";import{d as j}from"./chunk-3LCDIREB.js";function ce(n,e,t={}){let i=new Map;if(e&&e.length===0)return i;let r=v(n,{includeIgnored:!1}),a=ie(n),o=e??Y(n),f=new Set(o.map(u=>u.symbolId)),c=ve(o);return pe(n,i,r,a,f,c),ye(n,i,o,f),Re(n,i,r,a,f,c),t.semantic!==!1&&t.semanticEvidence&&De(i,t.semanticEvidence.callerMap(n,Me(o))),i}function pe(n,e,t,i,r,a){for(let o of t){if(!y(o))continue;let f=G(n,o);if(f)for(let c of f){if(a&&!a.has(c.calleeLeaf))continue;let u=ne(o,i.get(c.calleeLeaf)??[]);if(!u||u.length===0)continue;let s=te(n,o,u,c.memberAccess,c.calleeQualifier);s&&r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function ye(n,e,t,i){let r=ge(t);for(let a of Se(n,i))n.isIgnored(a.relative_path)||he(a,r.get(a.symbol_id))||T(e,a.symbol_id,a.relative_path)}function Se(n,e){return ee(n,e?[...e]:void 0)}function ge(n){let e=new Map;for(let t of n)e.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return e}function he(n,e){return!!e&&e.docId===n.document_id&&n.chunk_start>=e.startLine&&n.chunk_end<=e.endLine}function Re(n,e,t,i,r,a){for(let o of t){if(y(o)!=="rust")continue;let f=S(n,o,{includeRustAttributeNames:!0});if(f.length!==0)for(let{name:c}of f){if(a&&!a.has(c))continue;let u=i.get(c);if(u)for(let s of u)r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function T(n,e,t){let i=n.get(e);i||(i=new Set,n.set(e,i)),i.add(t)}function ve(n){let e=new Set;for(let t of n){let i="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?z(t.symbol):"";i&&e.add(i)}return e.size>0?e:null}function Me(n){return n.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function De(n,e){for(let[t,i]of e){let r=n.get(t);r||(r=new Set,n.set(t,r));for(let a of i)r.add(a)}}function q(n,e,t={}){return ce(n,e,t)}function K(n,e,t={}){return se(n,e,t)}function fe(n,e,t={}){let i=q(n,e,{semantic:t.semantic,semanticEvidence:t.semanticEvidence});return t.sourceFallback===!1?i:Ce(i,K(n,e))}function Ce(n,e){let t=new Map;for(let[i,r]of n)t.set(i,new Set(r));for(let[i,r]of e){let a=t.get(i)??new Set;for(let o of r)a.add(o);t.set(i,a)}return t}function ue(n,e,t){let i=e.identifierResolution==="strict"?N:ae,r=e.candidateNames?oe(e.candidateNames):null,a=0,o=0,f=0,c=0,u="";for(let s of e.paths)if(a+=1,u=s,!(!y(s)&&!(e.includeVueSfc&&V(s)))&&!n.isIgnored(s)&&!e.skipPath?.(s))try{if(r&&!re(_(n,s),r))continue;o+=1;let h=(d,b,x,g)=>{if(e.candidateNames&&!e.candidateNames.has(d))return;f+=1;let R=e.resolveTargets?e.resolveTargets({sourceFile:s,name:d,kind:b,defaultTargets:g}):g();for(let w of R)c+=1,t({sourceFile:s,name:d,target:w,occurrences:x,kind:b})},k=$(n,s);for(let[d,b]of k)h(d,"identifier",b.length,()=>i(n,s,d));for(let d of S(n,s,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let b=d.kind==="cross-language-dispatch"?()=>N(n,s,d.name):()=>i(n,s,d.name);h(d.name,d.kind,d.occurrences,b)}}finally{e.afterPath?.(s),a%10===0&&j("source-reference-scan.progress",()=>{},()=>({scannedPaths:a,currentPath:u,candidateMatchedPaths:o,visitedNames:f,visitedHits:c}))}}function de(n,e={}){let{scope:t,files:i,minLoc:r=1,maxLoc:a=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:f=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:u=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:L=!1,excludeRustTraitImplMembers:h=!1,includeSuppressed:k=!1,sortByLocDesc:d=!1}=e,b=[],x=Ie(n,{scope:t,files:i,requireFunctionLikeSymbol:s,requireCallableSymbol:L}),g=new Map,R=new Map,w=l=>{let m=g.get(l);if(m!==void 0)return m;let p=X(n,l);return g.set(l,p),p},be=l=>{let m=R.get(l);if(m!==void 0)return m;let p=C(l);return R.set(l,p),p};for(let l of x){let m=l.relativePath;if(n.isIgnored(m)||f&&w(m)||!Fe(l,{requireFunctionLikeSymbol:s,requireCallableSymbol:L})||o!==void 0&&l.symbol===o)continue;let p=F(l);p<r||p>a||c&&Le(m)||u&&Z(n,l.symbol,m)||h&&Q(l.symbol)||be(m)!=="test"&&(W(l.symbol)||!k&&M(n,m,l.startLine)||b.push(l))}return d?b.sort((l,m)=>F(m)-F(l)):b}function Ie(n,e){return e.files!==void 0?[...new Set(e.files.map(i=>i.replace(/\\/g,"/")))].sort().filter(i=>!e.scope||i.includes(e.scope)).flatMap(i=>D(n,i)):e.requireCallableSymbol?A(n,{scope:e.scope,symbolMatches:E,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?A(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"function-like"}):U(n,e.scope)}function Fe(n,e){return e.requireCallableSymbol?E(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function Le(n){return(n.split("/").pop()??"").includes("types")}var me=class{constructor(e){this.db=e}db;scopedDefinitions(e){return J(this.db,e)}definitionsForFile(e){return D(this.db,e)}productionCallableDefinitions(e={}){return de(this.db,e)}calleeMap(e,t={}){return this.calleeEvidenceMap(e,t).rows}calleeEvidenceMap(e,t={}){return le(this.db,e,{...t,semanticEvidence:I})}crossFileCallerMap(e,t={}){return q(this.db,e,{...t,semanticEvidence:I})}sourceFallbackCallerFiles(e,t={}){return K(this.db,e,t)}callerFileMap(e,t={}){return fe(this.db,e,{...t,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let t=new Map;for(let r of e){if(!r.leaf)continue;let a=t.get(r.leaf)??[];a.push(r.symbolId),t.set(r.leaf,a)}let i=new Set;for(let r of v(this.db,{includeIgnored:!1}))if(y(r)==="rust")for(let{name:a}of S(this.db,r,{includeRustAttributeNames:!0}))for(let o of t.get(a)??[])i.add(o);return i}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let i=new Map(e.map(o=>[o.symbolId,o.symbol])),r=this.calleeEvidenceMap(e,t),a=new Set([...r.rows.entries()].filter(([o,f])=>{let c=i.get(o);return f.some(u=>u.symbol!==c)}).map(([o])=>o));for(let o of r.incompleteSymbolIds)a.add(o);for(let o of r.unavailableSymbolIds)a.add(o);return a}fileDependencyGraph(e){return H(this.db,e)}fileKind(e){return C(e)}hasSuppressionComment(e){return M(this.db,e.relativePath,e.startLine)}sourceFiles(){return B(this.db)}scanSourceReferences(e,t){ue(this.db,e,t)}callableSignature(e){let t=O(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{K as a,Ce as b,me as c};
|
|
2
|
+
//# sourceMappingURL=chunk-UHFZDQZJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
1
|
+
import{c as p}from"./chunk-EDMG5CSO.js";import{basename as D}from"path";function h(){let t=new WeakMap;return{cache:t,ensure(r){let a=t.get(r);return a||(a=new Map,t.set(r,a)),a}}}function g(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s){let n=o(e);if(n.has(c))return n.get(c);let l=s();return n.set(c,l),l},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}function S(t,r){let a=new WeakMap,o={get(i,e){let c=a.get(i);if(c)return c.value;let s=e();return a.set(i,{value:s}),s},invalidate(i){a.delete(i)},has(i){return a.has(i)}};return p({name:t,groups:r.clearGroups,clearAll:i=>o.invalidate(i)}),o}var m={clearGroups:["whole-project","source-file"]};function E(t){return v(t,m)}function v(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s,n){let l=o(e),u=l.get(c);if(u&&u.source===s)return u.value;let d=n();return l.set(c,{source:s,value:d}),d},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}var C=g("indexed-document-paths",{clearGroups:["whole-project"]});function x(t,r={}){let a=V(r);return[...C.get(t,a,()=>{let i=r.scope?"AND relative_path LIKE ?":"",e=r.like?"AND relative_path LIKE ?":"",c=[...r.scope?[`%${r.scope}%`]:[],...r.like?[r.like]:[]],s=t.all(`SELECT relative_path
|
|
2
2
|
FROM documents
|
|
3
3
|
WHERE 1 = 1
|
|
4
4
|
${t.pathExclusionsFor("documents")}
|
|
@@ -8,4 +8,4 @@ import{c as p}from"./chunk-RCIGX23V.js";import{basename as D}from"path";function
|
|
|
8
8
|
FROM documents
|
|
9
9
|
WHERE relative_path = ?
|
|
10
10
|
${t.pathExclusionsFor("documents")}`,o).filter(n=>!t.isIgnored(n.relative_path)).map(n=>({relativePath:n.relative_path,score:b(n.relative_path,o)}));if(i.length>0)return i;let e=x(t,{includeIgnored:!1}).map(n=>({relativePath:n,score:b(n,o)})).filter(n=>n.score>0).sort((n,l)=>l.score-n.score||n.relativePath.localeCompare(l.relativePath)),c=e.filter(n=>n.score>=1100);if(c.length>0)return a.allowMultiple?c:[c[0]];let s=e.filter(n=>n.score>=800);return s.length>0?a.allowMultiple?s:[s[0]]:a.allowMultiple?e:e.slice(0,1)}function b(t,r){let a=f(t),o=D(a),i=D(r),e=0;return a===r&&(e+=1200),a.endsWith(`/${r}`)&&(e+=1100),o===i&&(e+=900),a.startsWith(`${r}/`)&&(e+=850),a.includes(r)&&(e+=250),e}function f(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{g as a,S as b,E as c,v as d,x as e,K as f,f as g};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-UUMAM5LM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-DGXRDLV5.js";import{c as M}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-DGXRDLV5.js";import{c as M}from"./chunk-CPWYEPWQ.js";import{c as w}from"./chunk-UHFZDQZJ.js";import{a as I}from"./chunk-ETZBIG6K.js";import{f as E}from"./chunk-R2F2CTBA.js";import{f as x}from"./chunk-2QJAVISG.js";import{d as f}from"./chunk-SGX43S2L.js";import{d as C}from"./chunk-TNLOX4TN.js";import{f as h}from"./chunk-RGBZDOUO.js";var H=new Set(f());function U(e,t){return P(e,t).rows}function P(e,t){let{scope:l,minLoc:o=10,limit:s=30,scanLimit:a}=t??{},c=new w(e),r=t?.semantic!==!1,u=B(r,new Set,new Set);return{rows:L({candidates:()=>c.productionCallableDefinitions({scope:l,minLoc:o,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,filterCandidate:R,profile:{name:"complexity-hotspots"},prepare:n=>{let i=z(e,n);(r?E(e):null)?.materializeReferences(n,{prefetchCallees:!0});let m=x(e,n,{semantic:r,semanticEvidence:I}),y=c.calleeEvidenceMap(n,{semantic:r}),g=new Set([...m.incompleteSymbolIds,...y.incompleteSymbolIds]),v=new Set([...m.unavailableSymbolIds,...y.unavailableSymbolIds]);u=B(r,g,v);let D=new Map(n.map(p=>[p.symbolId,p]));return{callerMap:new Map([...m.rows].map(([p,F])=>[p,new Set(F.filter(d=>d.file!==D.get(p)?.relativePath).map(d=>d.file))])),calleeMap:y.rows,incompleteSymbolIds:g,unavailableSymbolIds:v,languageByFile:i,clojureCallableIds:k(e,n,i),branchEstimates:M(e,n)}},evaluate:(n,i)=>i.incompleteSymbolIds.has(n.symbolId)||i.unavailableSymbolIds.has(n.symbolId)?null:j(n,i,o),orderResults:(n,i)=>i.score-n.score||i.loc-n.loc,limit:s}),coverage:u}}function B(e,t,l){let o=new Set([...t,...l]).size,s=e?t.size>0&&l.size>0?"incomplete-and-unavailable":t.size>0?"incomplete":l.size>0?"unavailable":"complete":"disabled";return{semanticEvidence:{enabled:e,status:s,incompleteSymbolCount:t.size,unavailableSymbolCount:l.size,excludedSymbolCount:o}}}function R(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&H.has(e.kind):!0}function j(e,t,l){if(t.languageByFile.get(e.relativePath)==="clojure"&&!t.clojureCallableIds.has(e.symbolId))return null;let o=e.endLine-e.startLine+1;if(o<l)return null;let s=t.callerMap.get(e.symbolId)?.size??0,a=t.calleeMap.get(e.symbolId)??[],c=new Set,r=new Set;for(let b of a){let m=`${b.symbol}|${b.file}`;c.add(m),b.file!==e.relativePath&&r.add(m)}let u=r.size,S=c.size,n=t.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},i=n.branches+1;return{symbol:e.symbol,shortName:C(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:s,fanOut:u,calleeCount:S,branches:n.branches,estimateBasis:n.estimateBasis,score:Math.round(o/50*(s/5)*Math.max(u/5,1)*Math.max(i/5,1)*100)/100}}function z(e,t){let l=[...new Set(t.map(a=>a.relativePath))];if(l.length===0)return new Map;let o=l.map(()=>"?").join(", "),s=e.all(`SELECT relative_path, language
|
|
2
2
|
FROM documents
|
|
3
3
|
WHERE relative_path IN (${o})`,...l);return new Map(s.map(a=>[a.relative_path,a.language?.toLowerCase()??null]))}function k(e,t,l){let o=new Set,s=new Map;for(let a of t){if(l.get(a.relativePath)!=="clojure")continue;let c=s.get(a.relativePath);c||(c=new Set((h(e,a.relativePath)?.callables??[]).map(r=>`${r.name}:${r.startLine}`)),s.set(a.relativePath,c)),c.has(`${a.leaf}:${a.startLine}`)&&o.add(a.symbolId)}return o}export{U as a,P as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-UUT5P3V7.js.map
|