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
package/dist/chunk-UQYQBLJX.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln","*.slnx"],vb:["*.vbproj","*.sln","*.slnx"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
|
|
2
|
-
`;try{let u=rr(s,c,r),l=W(i,u);return{kind:"published",cacheDir:o,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}catch(u){if(ir(u))return ue(n,o),{kind:"existing",cacheDir:o};throw u}}function ue(e,t){let r=x(e),n=x(t);return Qt(n,r,n)}function Yn(e,t){return k(y(t,A))?(ue(e,t),et(t),!0):!1}function Yt(e,t){let r;try{r=C(t)}catch(s){throw s instanceof m?$(t,s.reason):s}let n=J(e,...r.split("/"));if(n===e||!S(e,n))throw $(t,"outside-project");let i=Vt(n),o=x(i);if(!S(e,o)&&o!==e)throw $(t,"symlink-escape");return n}function Vt(e){let t=e;for(;!k(t);){let r=U(t);if(r===t)throw $(e,"no-existing-ancestor");t=r}return t}function Qt(e,t,r){let n=y(e,A);if(!k(n)||H(n).isSymbolicLink())throw b(e,"missing regular ownership record");let i=H(n);if(!i.isFile()||i.size>Ut)throw b(e,"invalid ownership record file");let o=D(n,"cache ownership record"),s=Zt(o,e);if(s.canonicalProjectRoot!==t)throw b(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw b(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Xe("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Zt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Ve||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!qe(r.canonicalProjectRoot)||!qe(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw b(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ke(e){let t=le(e).filter(r=>r!==A&&!er(r));if(t.length>0)throw b(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function er(e){return e.startsWith(`${A}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function tr(e){for(let t of le(e)){let r=y(e,t);try{let n=H(r);if(n.isSymbolicLink())throw b(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())O(r);else if(n.isFile())pe(r);else throw b(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(tt(n))continue;throw n}}O(e)}function et(e,t=!1){try{let r=H(e);if(r.isSymbolicLink())throw b(e,"managed cache tree contains a symlink");if(r.isFile()){pe(e);return}if(!r.isDirectory())throw b(e,"managed cache tree contains a special file");O(e);for(let n of le(e))et(y(e,n),!0)}catch(r){if(t&&tt(r))return;throw r}}function tt(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rt(e,t=R){let r=He(e,t);return O(e),r}function rr(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,i,o=!1;try{i=r.openFile(n,"wx",384),o=!0,We(i,Buffer.from(t),r,"cache ownership record"),r.syncFile(i),r.closeFile(i),i=void 0,r.linkFile(n,e);let s=G(U(e),r);return r.removeFile(n),o=!1,W(s,G(U(e),r))}finally{if(i!==void 0)try{r.closeFile(i)}catch{}if(o)try{r.removeFile(n)}catch{}}}function O(e){process.platform!=="win32"&&Ye(e,448)}function pe(e){process.platform!=="win32"&&Ye(e,384)}function nr(e){if(k(e))return x(e);let t=[],r=e;for(;;){let n=U(r);if(n===r)return e;if(t.unshift(Ht(r)),k(n))return y(x(n),...t);r=n}}function Vn(e){return nr(J(e))}function ir(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as or}from"child_process";import{createHash as sr}from"crypto";import{existsSync as ar,lstatSync as cr,realpathSync as ur}from"fs";import{dirname as lr,isAbsolute as dr,join as pr,resolve as K}from"path";function he(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var T={run(e,t){let r=nt(e,t);return r.kind==="success"?r.output:void 0},runResult:nt},fr=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],fe=/^[0-9a-f]{40,64}$/;function ni(e,t,r=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!fe.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function ii(e,t=T){let r=t.runResult(e,fr);if(r.kind==="success"){let n=gr(r.output);if(n)return hr(n,t)}return mr(e,t)}function gr(e){let t=e.split(`
|
|
3
|
-
`).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!fe.test(o)||!fe.test(s))return;let a=P(r);return{root:a,gitDir:P(q(a,n)),commonDir:P(q(a,i)),headCommit:o,treeOid:s}}function hr(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...it(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:me("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function mr(e,t){let r=yr(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=P(q(i,o)),a=ge(t.run(i,["rev-parse","--verify","HEAD"])),c=ge(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(u!==void 0)return{...n,commonDir:s,repositoryId:me("repository",s),headCommit:a,treeOid:c,clean:u.length===0}}function yr(e,t=T){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=P(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=P(q(i,o));return{kind:"worktree",identity:it(i,s)}}function it(e,t){return{projectRoot:e,gitDir:t,worktreeId:me("worktree",`${e}\0${t}`)}}function oi(e,t=T){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:Sr(r)}function Sr(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:P(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function si(e,t,r=T){return ge(r.run(e,t))}function q(e,t){return dr(t)?t:K(e,t)}function P(e){try{return ur(e)}catch{return K(e)}}function me(e,t){return sr("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ge(e){return e?.trim()||void 0}function nt(e,t){let r=or("git",["-C",e,...t],{encoding:"utf-8",env:he(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&ar(K(e)))&&!xr(e)?{kind:"not-repository"}:{kind:"error",message:i}}function xr(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=K(e);for(;;){try{return cr(pr(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=lr(t);if(r===t)return!1;t=r}}import{execFileSync as Xr}from"child_process";import{createHash as ft}from"crypto";import{closeSync as Yr,fstatSync as gt,lstatSync as be,openSync as Vr,readdirSync as Qr,readFileSync as Zr,readlinkSync as en,realpathSync as V}from"fs";import{isAbsolute as tn,join as Pe,relative as rn,resolve as nn,sep as on}from"path";import{execFileSync as ye}from"child_process";import{createHash as br}from"crypto";import{mkdirSync as Pr,renameSync as jr,writeFileSync as wr}from"fs";import{basename as Cr,dirname as kr,join as Fr}from"path";var Er="git-content-hashes.json",vr=32*1024*1024,Ir=2e5,X=3e4;function Se(){return{env:he(),encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:X,killSignal:"SIGKILL"}}function ot(e){let t,r;try{t=ye("git",["-C",e,"ls-files","-s","-z","--","."],{...Se(),timeout:X}),r=ye("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...Se(),timeout:X})}catch{return null}let n=new Map,i=[];for(let l of t.split("\0")){if(!l)continue;let f=l.indexOf(" "),p=f>0?l.slice(0,f).split(" "):[];if(p.length!==3)continue;let[h,g,L]=p,w=l.slice(f+1);if(h!=="100644"&&h!=="100755"||L!=="0"){n.delete(w);continue}n.set(w,g),Cr(w)===".gitattributes"&&i.push(`${w}:${g}`)}let o=new Set;for(let l of r.split("\0"))l.length>=4&&l[2]===" "&&o.add(l.slice(3));let s=Dr(e,i),a=Fr(de(e),Er),c=Rr(a,s),u=new Map;return{lookup(l){if(o.has(l))return;let f=n.get(l);if(f)return u.get(f)??c.entries[f]},seed(l,f){if(o.has(l))return;let p=n.get(l);!p||c.entries[p]||u.has(p)||u.set(p,f)},persist(){if(u.size===0)return;let l=new Set(n.values()),f={};for(let[p,h]of Object.entries(c.entries))l.has(p)&&(f[p]=h);for(let[p,h]of u)f[p]=h;if(!(Object.keys(f).length>Ir))try{Pr(kr(a),{recursive:!0});let p=`${a}.${process.pid}.tmp`;wr(p,JSON.stringify({version:1,salt:s,entries:f})),jr(p,a)}catch{}}}}function Dr(e,t){let r="";try{r=ye("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...Se(),timeout:X})}catch{}return br("sha256").update(JSON.stringify([r.trim(),t.sort()])).digest("hex")}function Rr(e,t){let r={version:1,salt:t,entries:{}};try{let n=I(e,{maxBytes:vr,inputKind:"git-content-hash-store"}),i=JSON.parse(n);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return r;let o={};for(let[s,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(s)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[s]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return r}}import{AsyncLocalStorage as Or}from"async_hooks";var Ar=new Or;function E(e,t){let r=Y(e);if(!r||r.missing.has(t))return;let n=r.files.get(t);if(n)return n;let i=r.readBaseFile?.(t);return i&&r.files.set(t,i),i}function v(e,t){let r=Y(e);if(r)return r.missing.has(t)?"missing":r.paths.includes(t)?"present":"missing"}function st(e,t){return Y(e)?.fingerprints.get(t)}function F(e){return Y(e)?.paths}function Y(e){let t=Ar.getStore();if(t)return t.projectRoot===P(e)?t:void 0}import{createRequire as Tr}from"module";import{existsSync as _r,readdirSync as Br,statSync as Lr}from"fs";import d from"path";var Nr=Tr(import.meta.url),at=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function zr(e,t=[]){let r=d.resolve(e),n=t.flatMap(c=>Gr(r,c));if(n.length>0)return ct(r,lt(n));let i=Mr(r),o=lt(i),s=Wr(r,o)?[r,...o]:o,a=s.length>0?s:[r];return ct(r,a)}function dt(e,t,r=[]){let n;try{n=Nr("ts-morph")}catch{return null}let i=d.resolve(e),o=t==="workspace"?zr(i,r):["."],s=new Set;for(let a of o){let c=a==="."?i:d.join(i,a),u=d.join(c,"tsconfig.json"),l=Jr(n.ts,i);if(!l.fileExists(u))return null;let f=n.ts.readConfigFile(u,l.readFile);if(f.error)return null;let p=n.ts.parseJsonConfigFileContent(f.config,l,c);if(p.errors.length>0)return null;for(let h of p.fileNames){let g=d.resolve(h);S(i,g)&&s.add(d.relative(i,g).split(d.sep).join("/"))}}return s}function ct(e,t){return[...new Set(t.map(r=>_(e,r)))].sort((r,n)=>r.localeCompare(n))}function Mr(e){let t=F(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>at.has(s)))return[];let o=d.join(e,...i.split("/"));return ut(e,o)?[d.dirname(o)]:[]});let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Br(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=d.join(i,s.name);if(s.isDirectory()){!at.has(s.name)&&!s.name.startsWith(".")&&n.push(a);continue}s.isFile()&&ut(e,a)&&r.push(d.dirname(a))}}return r}function Gr(e,t){let r=t.trim();if(!r)return[];let n=d.resolve(e,r);if(!S(e,n))return[];let i=F(e);if(i){let o=_(e,n);if(i.includes(o)&&xe(d.basename(n)))return[d.dirname(n)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[n]:[]}try{let o=Lr(n);if(o.isDirectory())return[n];if(o.isFile()&&xe(d.basename(n)))return[d.dirname(n)]}catch{return[]}return[]}function ut(e,t){if(!xe(d.basename(t)))return!1;let r=pt(e,t);return r?d.basename(t)==="tsconfig.json"||"include"in r||"files"in r||"references"in r:!1}function xe(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function lt(e){let t=[...new Set(e.map(r=>d.resolve(r)))].sort((r,n)=>r.localeCompare(n));return t.length<=1?t:t.filter(r=>!t.some(n=>n!==r&&Kr(r,n)))}function Wr(e,t){if(t.length===0||t.some(n=>d.resolve(n)===e))return!1;let r=d.join(e,"tsconfig.json");return Hr(e,r)&&$r(e,r)}function $r(e,t){let n=pt(e,t)?.include;return Array.isArray(n)?n.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!d.extname(i))):!1}function pt(e,t){try{let r=JSON.parse(Ur(e,t));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function Hr(e,t){let r=_(e,t),n=v(e,r);return n?n==="present":_r(t)}function Ur(e,t){let r=_(e,t);if(F(e)){let i=E(e,r);if(!i)throw Object.assign(new Error(`Snapshot file ${r} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return D(t,"TypeScript project config")}function Jr(e,t){let r=F(t);if(!r)return e.sys;let n=d.resolve(t),i=new Set(r),o=qr(n,r),s=e,a=c=>{let u=d.resolve(c);return S(n,u)?_(n,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):E(n,u)?.content.toString("utf8")},readDirectory(c,u,l,f,p){let h=d.resolve(c);return S(n,h)?s.matchFiles(h,u,l,f,e.sys.useCaseSensitiveFileNames,n,p,g=>o.get(d.resolve(g))??{files:[],directories:[]},g=>g):e.sys.readDirectory(c,u,l,f,p)}}}function qr(e,t){let r=new Map,n=new Map,i=o=>{r.has(o)||r.set(o,new Set),n.has(o)||n.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),n.get(a).add(u),a=d.join(a,u),i(a)}r.get(a).add(s.at(-1))}return new Map([...r].map(([o,s])=>[o,{files:[...s].sort(),directories:[...n.get(o)??[]].sort()}]))}function _(e,t){let r=d.relative(e,t);return r?r.split(d.sep).join("/"):"."}function Kr(e,t){let r=d.relative(e,t);return!!r&&!r.startsWith("..")&&!d.isAbsolute(r)}var Q=64*1024*1024,B=class extends Error{constructor(r,n,i,o){super(`${r} ${JSON.stringify(n)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=r;this.inputPath=n;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function sn(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function ht(e,t,r={}){let n=C(t),i=V(e),o=nn(i,...n.split("/"));if(!S(i,o)||o===i)throw new m(t,"outside-project");let s=V(o);if(!S(i,s)||s===i)throw new m(t,"outside-project");let a=be(s);if(!a.isFile())throw new m(t,"not-a-file");let c={projectRoot:i,relativePath:n,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",c.relativePath,c.size,u);return c}function an(e,t,r={}){let n=C(t),i=v(e,n);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(n)} does not exist.`),{code:"ENOENT"});let c=E(e,n);if(!c)throw new m(n,"changed-during-read");let u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",n,c.size,u);return Buffer.from(c.content)}let o=ht(e,t,r),s=r.maxBytes??Q,a=Vr(o.absolutePath,"r");try{let c=gt(a);if(!c.isFile()||c.dev!==o.device||c.ino!==o.inode||c.size!==o.size)throw new m(t,"changed-during-read");if(c.size>s)throw new B(r.inputKind??"project file",o.relativePath,c.size,s);let u=Zr(a),l=gt(a);if(l.dev!==c.dev||l.ino!==c.ino||l.size!==c.size||u.byteLength!==c.size)throw new m(t,"changed-during-read");return u}finally{Yr(a)}}function Bi(e,t,r={}){return an(e,t,r).toString("utf8")}function je(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Li(e,t){try{return ht(e,t),!0}catch(r){if(je(r))return!1;throw r}}function mt(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function cn(e){return(F(e)??gn(e)??hn(e)).filter(t=>t&&!we(t)).sort()}function un(e,t={}){let r=(t.includePaths??[]).map(C),n=[...new Set([...cn(e),...r])].filter(c=>!we(c)).filter(c=>!t.language||_e(c,t.language,t.markerFiles)).filter(c=>!t.includePath||t.includePath(c)).sort(),i=V(e),o,s=()=>o??=ot(i),a=n.flatMap(c=>{let u=st(e,c);if(u)return[{path:c,size:u.fingerprintSize??u.size,hash:u.sha256}];let l=v(e,c);if(l==="present"){let g=E(e,c);if(g)return[{path:c,size:g.fingerprintSize??g.size,hash:g.sha256}]}let f=l===void 0?s():null,p=f?.lookup(c);if(p)return[{path:c,size:p.size,hash:p.hash}];let h=Pe(e,c);try{if(be(h).isSymbolicLink()){let Z=V(h),ee=rn(i,Z);if(ee===".."||ee.startsWith(`..${on}`)||tn(ee))throw new Error("external symlink");let Ce=en(h);return[{path:c,size:Buffer.byteLength(Ce),hash:ft("sha256").update("symlink\0").update(Ce).digest("hex")}]}let g=ft("sha256"),L=z(h,{inputKind:"project fingerprint input",maxBytes:Q},Z=>g.update(Z)),w=g.digest("hex");return f?.seed(c,{size:L,hash:w}),[{path:c,size:L,hash:w}]}catch(g){return je(g)?[]:[{path:c,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Ni(e,t,r){let n=pn(t,r),i=[...n.typescriptProjects.filter(s=>dn(e,s)),...n.clojureConfigPath?[n.clojureConfigPath]:[]],o=n.languages.includes("typescript")?dt(e,n.typescriptProjectMode,n.typescriptProjects):null;return{...n,files:un(e,{includePath:s=>{let a=oe(s,t,i);return a==="other"?!1:a!=="source"||!ln(s)||!o?!0:o.has(s)},includePaths:i})}}function ln(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function dn(e,t){let r;try{r=C(t)}catch{return!1}let n=v(e,r);if(n)return n==="present";try{return be(Pe(e,r)).isFile()}catch(i){if(je(i))return!1;throw i}}function pn(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:sn(t.typescriptProjects),clojureConfigPath:fn(t.clojureConfigPath)}}function fn(e){return e?.trim()||void 0}function gn(e){try{return Xr("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
4
|
-
`).filter(Boolean)}catch{return null}}function hn(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?Pe(e,n):e,o;try{o=Qr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){we(a)||r.push(a);continue}t.push(a)}}return t}function we(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(r=>mn.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var mn=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{Fe as a,Ee as b,xt as c,bt as d,j as e,ve as f,I as g,D as h,Pt as i,jt as j,wt as k,z as l,Ct as m,oe as n,wn as o,Cn as p,kt as q,vt as r,We as s,ae as t,R as u,He as v,G as w,W as x,m as y,ce as z,Tn as A,_n as B,Ue as C,Bn as D,S as E,C as F,Ge as G,A as H,de as I,Ze as J,qt as K,qn as L,Kn as M,Xn as N,Yn as O,Vn as P,he as Q,T as R,ni as S,ii as T,yr as U,oi as V,si as W,q as X,P as Y,zr as Z,B as _,sn as $,ht as aa,an as ba,Bi as ca,je as da,Li as ea,cn as fa,un as ga,Ni as ha,pn as ia};
|
|
5
|
-
//# sourceMappingURL=chunk-UQYQBLJX.js.map
|
package/dist/chunk-V4NGDIEA.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{V as Ue,W as Be}from"./chunk-JNXI6NQ7.js";import{N as ce,O as de,Q as C,R as M,S as N}from"./chunk-K4S2VH42.js";import{A as $e,B as je,K as L,P as Fe,l as le,m as Me,ma as Ge,n as I,p as Ne,q as Le,z as W}from"./chunk-MEUHIDI3.js";import{b as E,j as re,k as ie,l as He,m as se,n as _e,p as De,r as ae,s as D}from"./chunk-D7DOB27N.js";import{a as _,c as qe,d as te,e as ne}from"./chunk-6O3KXIDL.js";import{J as y,N as Te,U as Oe,W as oe,X as Pe,Y as k,a as Ie,f as Z,h as f,v as ee,w as x,x as We}from"./chunk-UQYQBLJX.js";import{spawn as Zt}from"child_process";import{existsSync as en,rmSync as rt}from"fs";import{dirname as tn,resolve as V}from"path";import{fileURLToPath as nn}from"url";import{createHash as Lt,randomUUID as ue}from"crypto";import{existsSync as $t,linkSync as jt,readdirSync as Ft,rmSync as w}from"fs";import{basename as Gt,dirname as Ut,join as h}from"path";var S=1,Bt=10*6e4,Vt=10080*6e4,j="requests",T="claims",$="completions",Ke="staging";function Je(e,t,n={}){let r=n.now?.()??new Date,o=zt(n.ttlMs),i=Qt(n.idempotencyKey),s=i?`key-${Lt("sha256").update(i).digest("hex")}`:`request-${(n.randomId??ue)()}`,a={version:S,requestId:s,...i?{idempotencyKey:i}:{},createdAt:r.toISOString(),deadlineAt:new Date(r.getTime()+o).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},c=et(e,s),d=he(e,c,a,n.onStage);if(d.published)return{disposition:"accepted",request:a,achievedDurability:d.achievedDurability,directorySync:d.directorySync};let p=pe(c);if(!p)throw new Error(`Watch refresh request identity ${s} exists but is malformed.`);return{disposition:"duplicate",request:p}}function er(e,t={}){let n=t.now?.()??new Date,r=`claim-${(t.randomId??ue)()}`,o=Math.max(1,Math.floor(t.limit??64)),i=Xe(e).sort(Xt),s=[];for(let a of i){if(s.length>=o)break;if(Ve(e,a.requestId))continue;if(Date.parse(a.deadlineAt)<=n.getTime()){Qe(e,{version:S,requestId:a.requestId,outcome:"expired",completedAt:n.toISOString()});continue}let c={version:S,requestId:a.requestId,claimId:r,claimedAt:n.toISOString()};if(he(e,tt(e,a.requestId),c).published){if(Ve(e,a.requestId)){Ye(e,a.requestId,r);continue}s.push(a)}}return{claimId:r,requests:s}}function tr(e,t,n=()=>new Date,r){let o=n().toISOString();for(let i of t.requests)Qe(e,{version:S,requestId:i.requestId,claimId:t.claimId,outcome:"completed",completedAt:o});r?.("after-completion"),Kt(e,t),r?.("after-claim-release")}function Kt(e,t){for(let n of t.requests)Ye(e,n.requestId,t.claimId)}function nr(e){let t=0;for(let n of b(h(e,T)))w(n,{force:!0}),t++;return t>0&&x(h(e,T)),Ze(e),t}function rr(e){let t=Xe(e),n=new Map,r=Jt(h(e,j),pe);for(let c of b(h(e,$))){let d=F(c);if(!d){r++;continue}n.set(d.requestId,d)}let o=new Set;for(let c of b(h(e,T))){let d=ze(c);if(!d){r++;continue}o.add(d.requestId)}let i=t.filter(c=>!n.has(c.requestId)&&!o.has(c.requestId)),s=[...n.values()].filter(c=>c.outcome==="completed").length,a=[...n.values()].filter(c=>c.outcome==="expired").length;return{pending:i.length,claimed:t.filter(c=>!n.has(c.requestId)&&o.has(c.requestId)).length,completed:s,expired:a,invalid:r,...i.length>0?{oldestPendingAt:i.map(c=>c.createdAt).reduce((c,d)=>Yt(c,d))}:{}}}function or(e,t={}){let n=(t.now?.()??new Date).getTime(),r=Math.max(0,t.retentionMs??Vt),o=0;for(let i of b(h(e,$))){let s=F(i);!s||n-Date.parse(s.completedAt)<r||(w(i,{force:!0}),w(et(e,s.requestId),{force:!0}),o++)}return o>0&&(x(h(e,$)),x(h(e,j))),Ze(e),o}function pe(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&(n.idempotencyKey===void 0||typeof n.idempotencyKey=="string")&&E(n.createdAt)&&E(n.deadlineAt)&&Date.parse(n.deadlineAt)>=Date.parse(n.createdAt)&&typeof n.detail=="string"&&n.detail.length>0})}function ze(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&q(n.claimId)&&E(n.claimedAt)})}function F(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&(n.claimId===void 0||q(n.claimId))&&(n.outcome==="completed"||n.outcome==="expired")&&E(n.completedAt)})}function Qe(e,t){let n=nt(e,t.requestId);if(he(e,n,t).published)return;let r=F(n);if(!r||r.requestId!==t.requestId||r.outcome!==t.outcome)throw new Error(`Watch refresh completion ${t.requestId} conflicts with an existing record.`)}function he(e,t,n,r){let o=h(e,Ke),i=Ut(t),s=ee(o),a=ee(i),c=h(o,`${Gt(t)}.${process.pid}.${ue()}.tmp`);try{let d=D(c,n,{spacing:2,trailingNewline:!0});r?.("after-staged");try{jt(c,t)}catch(u){if(u.code==="EEXIST")return{published:!1};throw u}let p=We(s,a,d.directorySync,x(i));return r?.("after-published"),{published:!0,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}finally{w(c,{force:!0})}}function Xe(e){let t=[];for(let n of b(h(e,j))){let r=pe(n);r&&t.push(r)}return t}function Ye(e,t,n){let r=tt(e,t),o=ze(r);!o||o.claimId!==n||(w(r,{force:!0}),x(h(e,T)))}function Ze(e){for(let t of b(h(e,Ke),".tmp"))w(t,{force:!0})}function Jt(e,t){return b(e).filter(n=>!t(n)).length}function b(e,t=".json"){return $t(e)?Ft(e,{withFileTypes:!0}).filter(n=>n.isFile()&&n.name.endsWith(t)).map(n=>h(e,n.name)).sort():[]}function fe(e,t){try{let n=JSON.parse(f(e,"watch refresh request record"));return t(n)?n:null}catch{return null}}function et(e,t){return h(e,j,`${t}.json`)}function tt(e,t){return h(e,T,`${t}.json`)}function nt(e,t){return h(e,$,`${t}.json`)}function Ve(e,t){return F(nt(e,t))!==null}function zt(e){if(e===void 0)return Bt;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Qt(e){let t=e?.trim();return t?t.slice(0,512):void 0}function q(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function Xt(e,t){return Date.parse(e.createdAt)-Date.parse(t.createdAt)||e.requestId.localeCompare(t.requestId)}function Yt(e,t){return Date.parse(t)<Date.parse(e)?t:e}var ot=5e3,rn=6e3,on=1e3,ge=10,sn=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","watch"]);function Rr(e){let t=e.classification;if(t.kind!=="live")return;let{state:n}=t;return n.watcher.state==="idle"&&n.lastError===void 0?n.indexGeneration:void 0}function an(e,t=process.env){return t.CODEBASEIQ_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!sn.has(e)}function Ar(e){let t=e.env??process.env;if(t.CODEBASEIQ_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!an(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let n=cn({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:n.disposition,state:n.state}}catch(n){return{kind:"failed",message:n instanceof Error?n.message:String(n)}}}function at(e,t,n){let r=k(V(e));if(n&&k(n.projectRoot)===r)return{projectRoot:r,worktreeKind:"git",worktreeId:n.worktreeId,cliVersion:t};let o=Oe(r);if(o.kind==="error")throw new Error(`Could not establish Git worktree identity for ${r}: ${o.message}`);return o.kind==="non-git"?{projectRoot:r,worktreeKind:"non-git",cliVersion:t}:{projectRoot:r,worktreeKind:"git",worktreeId:o.identity.worktreeId,cliVersion:t}}function Er(e){return U(e,at(e.projectRoot,e.cliVersion,e.gitContext))}function U(e,t){let n=e.runtime??Se,r=C(e.cacheDir),o=M(r.statePath),i=ke(r.lockPath);return{identity:t,classification:dn(o,t,n.now(),n.isProcessAlive),lock:i,lockIsLive:i!==null&&n.isProcessAlive(i.pid),paths:r}}function cn(e){let t=e.runtime??Se,n=at(e.projectRoot,e.cliVersion,e.gitContext),r=U(e,n),o=ye("ensure",r.classification);if(o.kind==="reuse")return G(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} is still alive but its heartbeat is old. Refusing automatic replacement because civil-clock age alone cannot authorize a process signal.`);if(o.kind==="replace")ve(o.state,e,t),O(r.paths,o.state.pid,t);else if(o.kind==="start"){if(r.lockIsLive){let a=it(e,n,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(a)return G(r.paths.activityPath,t),{disposition:"reused",state:a};throw new Error(`codebaseiq watch is already running for ${V(e.projectRoot)} (pid ${r.lock?.pid}; lock: ${r.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}r.classification.kind==="stale"&&O(r.paths,r.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${o.kind}`);if(r=U(e,n),o=ye("ensure",r.classification),o.kind==="reuse")return G(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} remains alive with an old heartbeat; automatic replacement is not authorized.`);let i=e.serverPath??nn(new URL("./watch-server.js",import.meta.url));t.spawnServer(i,n.projectRoot,e.cliVersion,e.watchOverrides??{},e.spawnEnv);let s=it(e,n,t,e.startupTimeoutMs??ot);if(!s)throw new Error(`codebaseiq watch service did not become ready within ${e.startupTimeoutMs??ot}ms.`);return G(r.paths.activityPath,t),{disposition:"started",state:s}}function Cr(e){let t=e.runtime??Se,n=C(e.cacheDir),r=M(n.statePath),o=r?t.isProcessAlive(r.pid)?{kind:"live",state:r}:{kind:"stale",state:r,reason:"dead-process"}:{kind:"stopped"},i=ye("stop",o);if(i.kind==="signal-stop")return ve(i.state,e,t),O(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};if(i.kind==="clean-stale")return O(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};let s=ke(n.lockPath);return i.kind==="already-stopped"&&s&&t.isProcessAlive(s.pid)?(ve(s,e,t),O(n,s.pid,t),{disposition:"stopped",pid:s.pid}):{disposition:"already-stopped"}}function Ir(e,t,n={}){let{durability:r="durable",...o}=n;r==="durable"?D(e,t,o):ae(e,t,o)}function ct(e,t=Date.now()){ae(e,{version:1,at:new Date(t).toISOString()})}function Wr(e,t,n=Date.now(),r={}){Je(C(tn(e)).refreshRequestsPath,t,{...r,now:()=>new Date(n)}),ct(e,n)}function Tr(e){try{let t=JSON.parse(f(e,"watch activity record"));return t.version!==1||!N(t.at)||t.refreshRequestedAt!==void 0&&!N(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function qr(e,t,n={}){let r=n.pid??process.pid,o=n.isProcessAlive??re,i=()=>{},s=n.readProcessIdentity??ne,a=n.now??(()=>new Date),c={...ie,wallNow:()=>a().getTime(),isProcessAlive:o,readProcessIdentity:s},d=He(e,{kind:"watch",pid:r,processIdentity:s(r),detail:{projectRoot:V(t)},parseLegacy:B,runtime:c});if(d.kind==="contended"){let p=dt(d.observation);return{acquired:!1,lockPath:e,message:ln(e,t,p),release:i}}return{acquired:!0,lockPath:e,message:"",release:()=>{d.lock.release()}}}function ke(e){return dt(se(e,{parseLegacy:B}))}var B=e=>{let t=lt(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function dt(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return lt(e.parsed)}function lt(e){try{let t=e;if(t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!N(t.startedAt))return null;let n=t.processIdentity===void 0?null:qe(t.processIdentity);return t.processIdentity!==void 0&&(!n||n.pid!==t.pid)?null:{version:1,pid:t.pid,...n?{processIdentity:n}:{},projectRoot:t.projectRoot,startedAt:t.startedAt}}catch{return null}}function dn(e,t,n,r){if(!e)return{kind:"stopped"};if(e.protocolVersion!==ce)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let o=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==o)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!r(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let i=Date.parse(e.heartbeatAt);return n-i>de?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function ye(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"refuse-replace",state:t.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return me(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return me(t)}default:return me(e)}}function Or(e){return e.idleTimeoutMs===0||e.watcher.state!=="idle"||(e.liveSessions??0)>0?!1:e.nowMs-e.lastActivityAtMs>=e.idleTimeoutMs}function it(e,t,n,r){let o=n.monotonicNow??_,i=o()+r;for(;o()<=i;){let s=U(e,t).classification;if(s.kind==="live")return s.state;n.sleep(ge)}return null}function ve(e,t,n){let{pid:r}=e;if(!n.isProcessAlive(r))return;st(e,n),n.signalProcess(r);let o=t.stopTimeoutMs??rn,i=n.monotonicNow??_,s=i()+o;for(;i()<=s;){if(!n.isProcessAlive(r))return;n.sleep(ge)}if(!n.forceSignalProcess)throw new Error(`codebaseiq watch service pid ${r} did not stop within ${o}ms and forced termination is unavailable.`);st(e,n),n.forceSignalProcess(r);let a=t.forceStopTimeoutMs??on,c=i()+a;for(;i()<=c;){if(!n.isProcessAlive(r))return;let d=n.readProcessIdentity(r);if(e.processIdentity&&d&&!te(e.processIdentity,d))return;n.sleep(ge)}throw new Error(`codebaseiq watch service pid ${r} remained alive ${a}ms after forced termination.`)}function O(e,t,n){if(rt(e.statePath,{force:!0}),rt(e.activityPath,{force:!0}),ke(e.lockPath)?.pid===t&&!n.isProcessAlive(t)){let o={...ie,wallNow:n.now,isProcessAlive:n.isProcessAlive,readProcessIdentity:n.readProcessIdentity},i=se(e.lockPath,{parseLegacy:B,runtime:o});_e(e.lockPath,i,{parseLegacy:B,runtime:o})}}function ln(e,t,n){return`error: codebaseiq watch is already running for ${V(t)}${n?` (pid ${n.pid}, started ${n.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function G(e,t){try{(t.recordActivity??ct)(e,t.now())}catch(n){let r=un(n);if(r!=="EPERM"&&r!=="EACCES"&&r!=="EROFS")throw n}}function un(e){return e.code}var Se={now:Date.now,monotonicNow:_,isProcessAlive:re,readProcessIdentity:ne,spawnServer(e,t,n,r,o){if(!en(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);Zt(process.execPath,[e,t,n,JSON.stringify(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:{...process.env,...o,CODEBASEIQ_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function st(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its ownership record has no process identity.`);let n=t.readProcessIdentity(e.pid);if(!n)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity is unavailable.`);if(!te(e.processIdentity,n))throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity does not match the ownership record.`)}function me(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}import{existsSync as m,mkdirSync as pn,rmdirSync as hn,unlinkSync as fn}from"fs";import{homedir as mn}from"os";import{basename as vt,dirname as Q,isAbsolute as gn,join as l,resolve as xe}from"path";import{fileURLToPath as yn}from"url";var ut=["- `codebaseiq search <exact-text>` \u2014 Where does this exact text occur in current project text, and which aligned compiler symbol owns each line? Requires: One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.","- `codebaseiq outline <file>` \u2014 What symbols and nesting exist in this file? Requires: One exact current project file path.","- `codebaseiq entrypoints [text]` \u2014 Which detected external roots or entry-surface candidates match this text? Requires: Optional exact text to filter candidates; otherwise the current indexed repository.","- `codebaseiq evidence` \u2014 Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap? Requires: One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.","- `codebaseiq inspect` \u2014 Which related source units across several known text, symbol, or location anchors should be read together? Requires: One or more exact text, symbol, or file:line selectors naming the unresolved behavior.","- `codebaseiq code <selectors...>` \u2014 What exact source defines these symbols, ranges, or file surfaces? Requires: One or more exact symbols, file:line ranges, or file paths.","- Choose graph controls explicitly: `execution incoming` \u2014 Who can call or reach this?; `execution outgoing` \u2014 What can this call or reach?; `dataflow incoming` \u2014 Where can this value come from?; `dataflow outgoing` \u2014 Where can this value go?; `runtime both` \u2014 Which producer and consumer rendezvous?; `state both` \u2014 What resource is observed or changed?; `temporal both` \u2014 What occurs before or after this?; `contract both` \u2014 What interface constrains this?; `identity both` \u2014 Are these observations the same entity?; `ownership both` \u2014 What contains or owns this?; `dependencies outgoing` \u2014 What does this statically rely on?. The CLI does not infer them from English intent.","- Calibration: exact is directly observed; derived is deterministically computed; candidate needs confirmation; mixed discloses its constituents; unknown cannot support a stronger claim. Read coverage and recovery before making absence claims.","- The controls above are complete for ordinary exploration. Run `codebaseiq capabilities --matrix` only when a named claim depends on uncertain provider support; do not run it for routine orientation."],_r=[{stage:"locate",id:"search",command:"search <exact-text>",question:"Where does this exact text occur in current project text, and which aligned compiler symbol owns each line?",requiredInput:"One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.",returnedFact:"exact cardinality, bounded identities and source, and scope commands that recover withheld matches",evidenceCeiling:"Exact current-text cardinality and locations within reported text coverage; compiler ownership only where aligned.",nonClaim:"Structural source ranking orders exact matches but does not establish task relevance. A literal co-occurrence does not establish a graph relationship.",outputCost:"small",contrasts:["outline: search locates exact text across files; outline enumerates compiler-owned constructs in one known file."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"outline",command:"outline <file>",question:"What symbols and nesting exist in this file?",requiredInput:"One exact current project file path.",returnedFact:"symbol names, nesting, and line ranges",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay.",nonClaim:"File ownership and nesting do not establish execution or task relevance.",outputCost:"small",contrasts:["search: outline enumerates constructs in one known file; search locates exact text across current project text.","code: outline returns identities and ranges; code materializes exact source for selected identities."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"entrypoints",command:"entrypoints [text]",question:"Which detected external roots or entry-surface candidates match this text?",requiredInput:"Optional exact text to filter candidates; otherwise the current indexed repository.",returnedFact:"entry symbols with files, confidence, evidence, and indexed caller counts",evidenceCeiling:"Source/compiler-grounded entry evidence and indexed caller counts; exported-only candidates remain candidates.",nonClaim:"A package-public export or zero indexed callers is an entry candidate, not proof of runtime ingress. Entry classification does not establish that the callable executes.",outputCost:"bounded",contrasts:["entry-map: entrypoints locates possible external roots; entry-map traverses static calls from one selected root.","search: entrypoints classifies callable roots; search only locates exact text and ownership."],gapClosingCommands:["evidence","inspect","code"]},{stage:"project",id:"evidence",command:"evidence",question:"Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap?",requiredInput:"One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.",returnedFact:"batched exact selectors and typed graph relationships; compact endpoints with exact locations and follow-up commands; coverage and recoverable omissions; exact source-recovery command when source was requested with a graph projection; explicit ambiguity failure with exact rerun commands",evidenceCeiling:"Typed edges only to each registered provider ceiling within the explicitly selected projection and reported coverage.",nonClaim:"The projection does not infer which relationships are relevant to the user task. Reference, dependency, data, state, temporal, contract, and identity edges do not become execution claims.",outputCost:"bounded",contrasts:["refs: refs enumerates direct reference sites; evidence traverses explicitly selected typed relationships.","call-graph: call-graph specializes in static calls; evidence can combine execution with other selected families.","value-flow: value-flow specializes in proved transfers; evidence projects bounded dataflow alongside other families.","dependence-slice: dependence-slice computes a program-dependence slice; evidence performs bounded graph projection."],gapClosingCommands:["inspect","code"]},{stage:"read",id:"inspect",command:"inspect",question:"Which related source units across several known text, symbol, or location anchors should be read together?",requiredInput:"One or more exact text, symbol, or file:line selectors naming the unresolved behavior.",returnedFact:"one ranked, deduplicated semantic packet plus exact selector cardinality and explicit expansion coverage",evidenceCeiling:"Complete current source for every materialized syntax unit; bounded selector and packet coverage remain explicit.",nonClaim:"A source packet does not choose which implementation details are relevant to the user task. A reference mention does not establish executable reachability.",outputCost:"potentially-large",contrasts:["code: inspect batches bounded behavior or source gaps; code materializes complete exact source.","evidence: inspect reads implementation units; evidence projects typed relationships without source."],gapClosingCommands:[]},{stage:"read",id:"code",command:"code <selectors...>",question:"What exact source defines these symbols, ranges, or file surfaces?",requiredInput:"One or more exact symbols, file:line ranges, or file paths.",returnedFact:"per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed.",nonClaim:"Source materialization does not establish callers, runtime reachability, or task relevance by itself.",outputCost:"potentially-large",contrasts:["inspect: code materializes complete exact source; inspect batches bounded behavior or source gaps.","outline: code reads selected implementations; outline enumerates file structure without reading every body."],gapClosingCommands:[]}];var g="<!-- codebaseiq:agent-setup:begin -->",R="<!-- codebaseiq:agent-setup:end -->",vn="# codebaseiq:agent-setup",X=[".codex/hooks.json",".claude/settings.local.json"],pt="# codebaseiq:local-agent-hooks:begin",ht="# codebaseiq:local-agent-hooks:end",we="hook-architecture-stop",kt=["claude","codex"],P={claude:".claude/settings.local.json",codex:".codex/hooks.json"},St="sentinel-hook.mjs",kn=l("dist","sentinel-hook.js"),Sn=l("dist","cli.js"),bn="cli-path",xn="installed-projects.json";function Yr(e){let t=e.written.length+e.unchanged.length,n=e.skipped.length;return{verdict:n===0?"ready":t===0?"blocked":"partial",ready:t,skipped:n}}function Zr(e,t={}){let n={written:[],unchanged:[],skipped:[]};return wn(e,n),t.architectureHook!==!1&&En(e,n,t.architectureHook),n}function eo(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return mt(e,"AGENTS.md",t,n),mt(e,"CLAUDE.md",t,n),xt(e,t,n,r=>Ot(Wn(r))),qt(e,t,n),An(e,t,n),n}function wn(e,t){let n=[g,"## codebaseiq","","This repository uses codebaseiq as its primary code exploration surface.","","codebaseiq separates two responsibilities: the agent decides what repository fact it needs, while the tool locates exact referents and reports compiler, runtime, data, state, temporal, contract, identity, ownership, and dependency evidence without guessing task relevance. The ordinary loop is locate an exact root, project explicitly chosen relationships, read behavior only for a named remaining gap, then stop when the requested claims are established.","","- Use codebaseiq for repository exploration, including literal search and exact source reads. Native tools are for applying edits, running checks, binary content, or a specific unsupported gap that codebaseiq has explicitly reported\u2014not a parallel exploration workflow.","- Before exploring, state the few material repository facts the answer depends on. Include behavior-changing predicates, authorization checks, data reshaping, hard bounds, runtime crossings, durable state changes, emitted notifications, returned values, relevant sibling outcomes, and externally visible ordering only when the request depends on them.","- For end-to-end explanations, use the installed codebaseiq-explore guidance to maintain the evidence ledger and audit the final answer; codebaseiq supplies the repository observations.",...ut,"- Any exact symbol or `file:line` returned by a locator is immediately usable as a graph root. There is no required anchor-discovery phase and locator ordering never proves task relevance. For an end-to-end question, include the initiating owner as a root or request incoming execution capable of exposing it; do not assume a core type is the ingress. Locate independent roots together when the question already implies several participants.","- A materialized evidence projection requires repeated `--symbol`, `--at`, or `--search` selectors plus one or more repeated `--edge <family>` flags, explicit `--direction incoming|outgoing|both`, `--depth <n>`, and `--max-edges <n>`. The agent chooses the relationships capable of establishing its claim; the CLI resolves identity, direction, evidence strength, provider support, and coverage. Use optional exact `--subtype <subtype>` and `--connecting` only when the selected roots themselves must be connected. Never request `complete`, `all`, or every family merely to discover what exists; use `--inventory-only` when only counts can determine the next bounded projection.","- Treat execution calls and exact runtime handoffs as executable reachability. Dataflow, state, temporal, contract, identity, ownership, and dependency edges say what a path carries, changes, orders, constrains, identifies, contains, or relies on; they do not become call claims. Treat exact edges as facts only within their stated coverage and candidate edges as leads requiring source confirmation.","- Read every packet as a coverage contract. `accounted` means the requested bounded projection reports every omission; `bounded` means requested edges were placed in stable recoverable folds by the output budget; `incomplete` means a selector or provider could not be resolved. None proves the user task complete, and missing output is no evidence of absence.","- Prefer batched locators, projections, and gap reads. Query count measures exploration efficiency; it never makes a known recoverable material fact optional. Before drilling down, name the still-missing fact. Expand only a printed fold or exact adjacent identity that can establish it; batch independent roots and gaps instead of shuttling between abstraction levels, and repeat only while a named fact remains unresolved.","- Use `codebaseiq inspect --symbol <symbol> --symbol <symbol> --at <file:line> --view behavior` for several named behavioral gaps. Connected behavior is already source evidence; do not reread lines it rendered. Use `codebaseiq code <symbol-or-range>` only when exact implementation syntax can change the decision. Do not replace these reads with `rg`, `grep`, `sed`, or `nl`.","- For a multi-step mutation, preserve later compaction, rollback, and cleanup. For every event, log, or outbox write, preserve its operation and record identity. For coordination, state the lock scope and which checks and writes occur inside it. State whether interruption is prevented, atomic, rolled back, or repaired later. Resolve exact constant values when they can change the answer.","- For a tiered policy or dispatcher, preserve the precedence of its tiers and the exact scope of every bypass; never imply that a later bypass can skip an earlier hard rejection unless the rendered condition proves it.","- For a stateful owner, preserve its lifetime and sharing scope, including whether it is a singleton, shared registry, per-session instance, or per-invocation value.","- Use `codebaseiq diff-impact` to map changed symbols and downstream consumers after a nontrivial edit.","- Use `codebaseiq architecture` to inspect explicit structural rules.","- Use `codebaseiq health` to find React, Vue, duplication, complexity, drift, and cleanup candidates.","- Before claiming a complete relationship set or an absence, inspect coverage and use `--full` only when complete coverage can change the decision. A bounded or unsupported result cannot establish that no caller, route, branch, poller, or consumer exists.","- Before claiming what every callsite passes, read the `trace` or `evidence` claim-support section. Only an eligible callsite-argument claim is backed by complete syntactic invocations; bounded context is not proof.","- Prefer human output for agent reading. Use `--json --result-only` only for a programmatic consumer.","- Never rerun a successful human command as JSON. Before each drilldown, name the still-unanswered fact and check whether an earlier packet already establishes it; if so, update the ledger or draft without another query. Stop when no unanswered fact remains because every additional reasoning step pays again for the accumulated context.","- Before answering, compare the draft to selected statement-complete behavior. Preserve every material behavior-changing predicate, returned default, separately merged field, cache invalidation, and cleanup effect. Do not collapse fields with different operations into a generic summary, and do not re-query evidence already in context.","- With an explicit CODEBASEIQ_SESSION, a complete source unit, a byte-identical exact subset of a prior exact source read, or a graph unit/edge may be replaced by a visible receipt from the same index generation. Preview coverage never suppresses an exact unit; changed bytes, changed graph content, a new generation, or --reemit force full evidence.","- If output emits `Continue exactly:`, run that command unchanged until transport is complete.","- When architecture rules are configured and clean, setup installs one checkout-local Stop hook. It checks architecture only after indexed source changes.","- Commit relevant `.codebaseiq/suppressions/*.json` records with the change. Do not commit local agent-tool settings.",R].join(`
|
|
2
|
-
`);ft(e,"AGENTS.md",n,t);let r=[g,"@AGENTS.md",R].join(`
|
|
3
|
-
`);ft(e,"CLAUDE.md",r,t,o=>o.includes("@AGENTS.md")&&!o.includes(g))}function ft(e,t,n,r,o){let i=l(e,t),s=!1,a=Re(i,t,r,c=>{if(o?.(c.text))return s=!0,{kind:"unchanged"};let d=Rn(c.text,n);return d===c.text?{kind:"unchanged"}:{kind:"write",text:d,...c.revision.exists?{}:{mode:420}}});a&&(!a.changed||s?r.unchanged.push(t):r.written.push(t))}function mt(e,t,n,r){let o=l(e,t);if(n.dryRun){if(!m(o)){r.unchanged.push(t);return}try{let s=f(o,"agent instruction file");s.includes(g)?(gt(s),r.removed.push(t)):r.unchanged.push(t)}catch(s){r.skipped.push({target:t,reason:s instanceof Error?s.message:String(s)})}return}let i=Re(o,t,r,s=>{if(!s.revision.exists||!s.text.includes(g))return{kind:"unchanged"};let a=gt(s.text);return a.length===0?{kind:"delete"}:{kind:"write",text:a}});i&&(i.changed?r.removed.push(t):r.unchanged.push(t))}function Rn(e,t){if(bt(e)==="present"){let r=new RegExp(`${g}[\\s\\S]*?${R}`);return e.replace(r,t)}return e.length>0?`${e.replace(/\n*$/,`
|
|
4
|
-
|
|
5
|
-
`)}${t}
|
|
6
|
-
`:`${t}
|
|
7
|
-
`}function gt(e){bt(e);let t=new RegExp(`${g}[\\s\\S]*?${R}`),n=e.replace(t,"").replace(/\n{3,}/g,`
|
|
8
|
-
|
|
9
|
-
`).trim();return n.length===0?"":`${n}
|
|
10
|
-
`}function bt(e){let t=e.split(g).length-1,n=e.split(R).length-1;if(t===0&&n===0)return"absent";if(t===1&&n===1&&e.indexOf(g)<e.indexOf(R))return"present";throw new Error("managed codebaseiq markers are incomplete, duplicated, or out of order")}function Re(e,t,n,r){try{return W(e,r,{maxRetries:0})}catch(o){n.skipped.push({target:t,reason:o instanceof Error?o.message:String(o)});return}}function An(e,t,n){let r=".git/hooks/pre-commit",o=l(e,r);if(!m(o)){n.unchanged.push(r);return}if(!f(o,"pre-commit hook").includes(vn)){n.skipped.push({target:r,reason:"pre-commit hook is not managed by codebaseiq"});return}if(t.dryRun){n.removed.push(r);return}Re(o,r,n,()=>({kind:"delete"}))?.changed&&n.removed.push(r)}function En(e,t,n={}){let r=(n.inspectReadiness??Cn)(e);if(r.state==="not-configured")return;if(r.state==="blocked"){t.skipped.push({target:"architecture Stop hook",reason:r.reason});return}let o=n.commandPrefix??"codebaseiq";for(let i of X){if(L(e,i)){t.skipped.push({target:i,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}Ee(l(e,i),i,t,s=>In(s,o))}Ct(e,t)}function xt(e,t,n,r){for(let o of X){let i=l(e,o);if(m(i)){if(L(e,o)){n.skipped.push({target:o,reason:"tracked repository config; the checkout-local hook remover will not modify it"});continue}if(t.dryRun){try{let s=At(i);JSON.stringify(r(s))!==JSON.stringify(s)&&n.removed.push(o)}catch(s){n.skipped.push({target:o,reason:v(s)})}continue}Ee(i,o,n,r,!0)}}}function Cn(e){let t=je(e);if(!t.architecture||t.architecture.boundaries.length===0)return{state:"not-configured"};let n=Te(e,t),r=Fe(e,t,n);if(r.state!=="fresh")return{state:"blocked",reason:`the index is ${r.state}; refresh it before installing a persistent architecture grader`};let o;try{o=Ge(e);let i=Be(Ue(o));return i.length>0?{state:"blocked",reason:`the current architecture baseline has ${i.length} enforced violation(s); make the declared policy clean before installing the Stop hook`}:{state:"ready"}}catch(i){return{state:"blocked",reason:v(i)}}finally{o?.close()}}function In(e,t="codebaseiq"){let n=H(e.hooks),r=Array.isArray(n.Stop)?n.Stop:[],o={type:"command",command:`${t} ${we}`,timeout:120,statusMessage:"Checking architecture boundaries"};return{...e,hooks:{...n,Stop:wt(r,{hook:o},Rt)}}}function to(e,t){return e===we&&t.sentinel?.enabled===!0}function Wn(e){let t=H(e.hooks),n=Array.isArray(t.Stop)?t.Stop:[],r=Tn(n),o={...t};r.length>0?o.Stop=r:delete o.Stop;let i={...e};return Object.keys(o).length>0?i.hooks=o:delete i.hooks,i}function H(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Tn(e){return e.map(t=>({...t,hooks:Array.isArray(t.hooks)?t.hooks.filter(n=>!Rt(n)):[]})).filter(t=>t.hooks.length>0)}function Ae(e){return typeof e=="object"&&e!==null&&Array.isArray(e.hooks)}function wt(e,t,n){let r=!1,o=[];for(let i of e){if(!Ae(i)||!i.hooks.some(n)){o.push(i);continue}let s=i.hooks.every(n),a=[],c=!1;for(let d of i.hooks)n(d)?r||(a.push(t.hook),r=!0,c=!0):a.push(d);a.length!==0&&o.push(c&&s?qn({...i,hooks:a},t.matcher):{...i,hooks:a})}return r||o.push({...t.matcher!==void 0?{matcher:t.matcher}:{},hooks:[t.hook]}),o}function qn(e,t){let{matcher:n,...r}=e;return t===void 0?r:{matcher:t,...r}}function Rt(e){if(!e||typeof e!="object")return!1;let t=e.command;return typeof t=="string"&&new RegExp(`(?:^|\\s)${we}$`,"u").test(t)}function Ee(e,t,n,r,o=!1){try{W(e,s=>{let a=s.revision.exists?Et(s.text,e):{},c=r(a);return JSON.stringify(c)===JSON.stringify(a)?{kind:"unchanged"}:o&&Object.keys(c).length===0?{kind:"delete"}:{kind:"write",text:`${JSON.stringify(c,null,2)}
|
|
11
|
-
`,mode:384}}).changed?"written"in n?n.written.push(t):n.removed.push(t):o||n.unchanged.push(t)}catch(i){n.skipped.push({target:t,reason:v(i)})}}function At(e){return Et(f(e,"agent hook settings"),e)}function Et(e,t){let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`Cannot update ${t}: the hook config is not a JSON object.`);return n}function Ct(e,t){let n=oe(e,["rev-parse","--git-path","info/exclude"]),r=n?Pe(e,n):void 0;if(!r||!m(Q(r))){t.skipped.push({target:".git/info/exclude",reason:"Git metadata was not found; local hook files may appear as untracked"});return}let o=On(oe(e,["rev-parse","--show-prefix"])??"");try{W(r,i=>{let s=new RegExp(`${pt}([\\s\\S]*?)${ht}\\n?`,"gu"),a=[...i.text.matchAll(s)].flatMap(A=>A[1].split(`
|
|
12
|
-
`).filter(Nt=>Nt!=="")),c=i.text.replace(s,"").replace(/\n*$/u,""),d=[...X,$e].map(A=>`/${o}${A}`),p=[pt,...new Set([...a,...d]),ht].join(`
|
|
13
|
-
`),u=`${c}${c?`
|
|
14
|
-
|
|
15
|
-
`:""}${p}
|
|
16
|
-
`;return u===i.text?{kind:"unchanged"}:{kind:"write",text:u,mode:420}})}catch(i){t.skipped.push({target:".git/info/exclude",reason:v(i)})}}function On(e){return e.replace(/[\\*?[]/gu,"\\$&")}function v(e){return e instanceof Error?e.message:String(e)}var It={claude:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",timeout:15,async:!0},{event:"Stop",timeout:30},{event:"SessionEnd",timeout:2}],codex:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"apply_patch|Edit|Write",timeout:15},{event:"Stop",timeout:30}]};function Y(e){let t=l(e,"bin");return{directory:t,script:l(t,St),version:l(t,"sentinel-hook.version"),manifest:l(t,"package.json"),cliPath:l(t,bn)}}function Wt(e={}){let t=Pn(e.packageRoot??Q(yn(import.meta.url)));if(!t)return{state:"skipped",reason:"the codebaseiq package root was not found"};let n=l(t.root,kn);if(!m(n))return{state:"skipped",reason:"build the package first (dist/sentinel-hook.js was not found)"};let r=Y(e.cacheRoot??y());try{let o=`${JSON.stringify({name:"codebaseiq",version:t.version,private:!0},null,2)}
|
|
17
|
-
`,i=[K(r.script,Z(n,Tt("sentinel hook bundle"))),K(r.version,Buffer.from(`${t.version}
|
|
18
|
-
`)),K(r.manifest,Buffer.from(o)),K(r.cliPath,Buffer.from(`${xe(t.root,Sn)}
|
|
19
|
-
`))];return{state:"installed",script:r.script,version:t.version,changed:i.some(Boolean)}}catch(o){return{state:"skipped",reason:`the hook binary could not be installed: ${v(o)}`}}}function no(e,t={}){let n=Y(t.cacheRoot??y());if(!(be(n.version,"sentinel hook version")===e&&m(n.cliPath)))return Wt(t)}function Pn(e){let t=e;for(;;){try{let r=JSON.parse(f(l(t,"package.json"),"package manifest"));if(r.name==="codebaseiq"&&typeof r.version=="string")return{root:t,version:r.version}}catch{}let n=Q(t);if(n===t)return;t=n}}function Tt(e){return{maxBytes:Ie,inputKind:e}}function K(e,t){try{if(Z(e,Tt("sentinel hook file")).equals(t))return!1}catch{}return De(e,t),!0}function ro(e,t={}){let n=t.hosts??kt,r=t.cacheRoot??y(),o=Wt({packageRoot:t.packageRoot,cacheRoot:r}),i={written:[],unchanged:[],skipped:[],binary:o,notices:[]};if(o.state==="skipped")return i.skipped.push({target:"sentinel hook binary",reason:o.reason}),i;for(let a of n){let c=P[a];if(L(e,c)){i.skipped.push({target:c,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}let d=[];Ee(l(e,c),c,i,p=>{let u=Dn(p,Mn(a,o.script,t.nodeExecutable));return d=Hn(p,u),u}),a==="codex"&&d.length>0&&i.written.includes(c)&&i.notices.push(`Codex must re-approve the changed hooks (${d.join(", ")}): open Codex once in this project and approve them. The approval it recorded for the old command no longer applies, and codebaseiq can only see that an approval exists, not that it still matches.`)}if(Ct(e,i),n.map(a=>P[a]).some(a=>i.written.includes(a)||i.unchanged.includes(a)))try{Vn(r,e)}catch(a){i.skipped.push({target:"sentinel project registry",reason:v(a)})}return i}function Hn(e,t){let n=o=>`${o.event}:${o.group}:${o.index}:${JSON.stringify(o.hook)}`,r=new Set(z(t).map(n));return[...new Set(z(e).filter(o=>!r.has(n(o))).map(o=>o.event))]}function _n(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return xt(e,t,n,Ot),qt(e,t,n),n}function oo(e={}){let t=e.cacheRoot??y(),n={removed:[],unchanged:[],skipped:[]};for(let o of Bn(t)){if(!m(o)){e.dryRun||Mt(t,o);continue}let i=_n(o,{dryRun:e.dryRun,cacheRoot:t});n.removed.push(...i.removed.map(s=>l(o,s))),n.skipped.push(...i.skipped.map(s=>({...s,target:l(o,s.target)})))}let r=Y(t);if(n.skipped.length>0)return m(r.script)&&n.skipped.push({target:r.script,reason:"kept: hooks that run it could not be removed from every project; run uninstall again once they can"}),n;for(let o of[r.script,r.version,r.manifest,r.cliPath])if(m(o)&&(n.removed.push(o),!e.dryRun))try{fn(o)}catch(i){n.skipped.push({target:o,reason:v(i)})}if(!e.dryRun)try{hn(r.directory)}catch{}return n}function qt(e,t,n){let r=X;if(!(t.dryRun||n.skipped.some(o=>r.includes(o.target))))try{Mt(t.cacheRoot??y(),e)}catch(o){n.skipped.push({target:"sentinel project registry",reason:v(o)})}}function J(e){if(!e||typeof e!="object")return!1;let{command:t,args:n}=e;return Array.isArray(n)&&n.includes(I)?!0:typeof t=="string"&&t.split(/\s+/u).includes(I)}function Dn(e,t){let n={...H(e.hooks)};for(let{event:r,...o}of t){let i=n[r];n[r]=wt(Array.isArray(i)?i:[],o,J)}return{...e,hooks:n}}function Ot(e){let t=H(e.hooks),n={},r=!1;for(let[i,s]of Object.entries(t)){if(!Array.isArray(s)){n[i]=s;continue}let a=[];for(let c of s){if(!Ae(c)||!c.hooks.some(J)){a.push(c);continue}r=!0;let d=c.hooks.filter(p=>!J(p));d.length>0&&a.push({...c,hooks:d})}(a.length>0||s.length===0)&&(n[i]=a)}if(!r)return e;let o={...e};return Object.keys(n).length>0?o.hooks=n:delete o.hooks,o}function Mn(e,t,n=process.execPath){return It[e].map(r=>({event:r.event,...r.matcher!==void 0?{matcher:r.matcher}:{},hook:e==="claude"?Nn(t,r):Ln(t,r,n)}))}function Nn(e,t){return{type:"command",command:"node",args:[e,"--host","claude",...t.async?["--async"]:[],I],...t.async?{async:!0,asyncRewake:!0}:{},timeout:t.timeout}}function Ln(e,t,n){let r=gn(n)&&/^node(?:\.exe)?$/iu.test(vt(n))?n:"node";return{type:"command",command:`${process.platform==="win32"?"& ":""}${yt(r)} ${yt(e)} --host codex ${I}`,timeout:t.timeout}}function yt(e){if((process.platform==="win32"?/["\r\n%$`]/u:/["\r\n$`]/u).test(e))throw new Error(`${JSON.stringify(e)} cannot be quoted in a Codex hook command`);return`"${e}"`}function z(e){let t=[];for(let[n,r]of Object.entries(H(e.hooks)))Array.isArray(r)&&r.forEach((o,i)=>{Ae(o)&&o.hooks.forEach((s,a)=>{J(s)&&t.push({event:n,group:i,index:a,hook:s})})});return t}function Pt(e){if(m(e))try{return At(e)}catch{return}}function io(e,t={}){let n=Y(t.cacheRoot??y()),r=be(n.version,"sentinel hook version"),o=be(n.cliPath,"sentinel hook CLI path");return{binary:{script:n.script,present:m(n.script),...r?{version:r}:{},...o?{cliTarget:o}:{}},hosts:kt.map(i=>{let s=P[i],a=Pt(l(e,s)),c=a?z(a):[],d=It[i].map(u=>u.event),p=new Set(c.map(u=>u.event));return{host:i,file:s,events:d.filter(u=>p.has(u)),missing:d.filter(u=>!p.has(u)),scripts:[...new Set(c.flatMap(u=>$n(u.hook)))]}})}}function be(e,t){try{return f(e,t).trim()||void 0}catch{return}}function $n(e){return(Array.isArray(e.args)?e.args.filter(n=>typeof n=="string"):[...e.command.matchAll(/"([^"]*)"|(\S+)/gu)].map(n=>n[1]??n[2]??"")).filter(n=>vt(n)===St)}function so(e,t={}){let n=l(e,P.codex),r=Pt(n),o=r?z(r):[];if(o.length===0)return;let i=l(t.codexHome??process.env.CODEX_HOME??l(mn(),".codex"),"config.toml"),s=Gn(i),a=[...new Set([n,l(k(e),P.codex)])];return{configPath:i,hooks:o.map(({event:c,group:d,index:p})=>{let u=`:${Un(c)}:${d}:${p}`;return{event:c,key:`${n}${u}`,trusted:a.some(A=>s.has(Ht(`${A}${u}`)))}})}}var jn=/^\s*\[hooks\.state\.(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\]\s*(?:#.*)?$/u,Fn=/^\s*trusted_hash\s*=\s*"sha256:[0-9a-f]+"/u;function Gn(e){let t=new Set,n;try{n=f(e,"Codex config")}catch{return t}let r;for(let o of n.split(/\r?\n/u)){let i=jn.exec(o);i?r=Ht(i[1]??(i[2]??"").replace(/\\(["\\])/gu,"$1")):/^\s*\[/u.test(o)?r=void 0:r!==void 0&&Fn.test(o)&&t.add(r)}return t}function Un(e){return e.replace(/([a-z])([A-Z])/gu,"$1_$2").toLowerCase()}function Ht(e){return process.platform==="win32"?e.replaceAll("/","\\").toLowerCase():e}function ao(e){let t={...Le.delivery};try{let n=JSON.parse(f(l(e,le,Me),"sentinel settings")).delivery;for(let r of Ne){let o=n?.[r];(o==="shadow"||o==="live")&&(t[r]=o)}}catch{}return t}function Ce(e){return l(e,le,xn)}function Bn(e=y()){try{return _t(f(Ce(e),"sentinel project registry"))}catch{return[]}}function _t(e){try{let{projects:t}=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Dt(e,t){let n=Ce(e);pn(Q(n),{recursive:!0}),W(n,r=>{let o=t(r.revision.exists?_t(r.text):[]);return o===void 0?{kind:"unchanged"}:{kind:"write",text:`${JSON.stringify({projects:o},null,2)}
|
|
20
|
-
`,mode:384}})}function Vn(e,t){let n=k(xe(t));Dt(e,r=>r.includes(n)?void 0:[...r,n].sort())}function Mt(e,t){if(!m(Ce(e)))return;let n=k(xe(t));Dt(e,r=>r.includes(n)?r.filter(o=>o!==n):void 0)}export{Je as a,er as b,tr as c,Kt as d,nr as e,rr as f,or as g,Rr as h,an as i,Ar as j,at as k,Er as l,cn as m,Cr as n,Ir as o,Wr as p,Tr as q,qr as r,Or as s,_r as t,Yr as u,Zr as v,eo as w,to as x,Ct as y,no as z,ro as A,_n as B,oo as C,io as D,so as E,ao as F};
|
|
21
|
-
//# sourceMappingURL=chunk-V4NGDIEA.js.map
|
package/dist/chunk-XUPFA6GH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as I}from"./chunk-YPBKBYPS.js";import{bb as v,ib as s,lb as E,mb as V}from"./chunk-JNXI6NQ7.js";import{c as y}from"./chunk-ZZ3MWF33.js";import{fa as h,pa as S,w}from"./chunk-MEUHIDI3.js";import{G as x}from"./chunk-UQYQBLJX.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{I(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=V(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&E(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?v({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
|
|
2
|
-
//# sourceMappingURL=chunk-XUPFA6GH.js.map
|
package/dist/chunk-YPBKBYPS.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{eb as he,gb as z}from"./chunk-JNXI6NQ7.js";import{b as le}from"./chunk-ZZ3MWF33.js";import{j as ge,l as P,r as v}from"./chunk-D7DOB27N.js";import{c as de,d as pe,e as D}from"./chunk-6O3KXIDL.js";import{h as b}from"./chunk-UQYQBLJX.js";import{AsyncLocalStorage as nt}from"async_hooks";import{createHash as V}from"crypto";import{existsSync as rt,mkdirSync as st}from"fs";import{tmpdir as it}from"os";import{isAbsolute as ot,join as ye,resolve as Se}from"path";var q=2,at="CODEBASEIQ_SESSION",me="CODEBASEIQ_SESSION_DIR",ut=128,I=new nt;function ve(e,t){let n=e.sessionEnabled===!1||e.json?void 0:It(),r={enabled:n!==void 0,reemit:e.reemit===!0,command:e.command,projectRoot:Se(e.cwd),sessionIdentity:n,staged:[],stagedEvidence:[],finalized:!1};return I.run(r,t)}function Dn(e){let t=I.getStore();!t||t.finalized||(t.generationIdentity=e)}function zn(){return I.getStore()?.staged.length??0}function qn(e){let t=I.getStore();!t||e<0||e>t.staged.length||(t.staged.length=e)}function W(e){let t=I.getStore();if(!t||t.finalized)return;t.finalized=!0;let n=t.state;if(!n){t.staged.length=0,t.stagedEvidence.length=0;return}try{if(e&&(t.staged.length>0||t.stagedEvidence.length>0)){let r=n.ledger.nextOrdinal,s=yt(t.staged).map(o=>({...o,ordinal:r,command:t.command})),i=vt(t.stagedEvidence).map(o=>({...o,ordinal:r,command:t.command}));n.ledger.ranges.push(...s),n.ledger.evidence.push(...i),n.ledger.nextOrdinal+=1,n.ledger.updatedAt=new Date().toISOString(),v(n.ledgerPath,n.ledger,{spacing:2,trailingNewline:!0})}}catch{}finally{n.lock.release(),t.state=null,t.staged.length=0,t.stagedEvidence.length=0}}function Vn(e){let t=e.source.split(`
|
|
2
|
-
`);if(t.length===0)return"";let n=ct(e.relativePath,e.startLine,t,e.ownerSymbol,e.sessionPolicy??"exact-unit"),r=e.indent??" ",s=e.sourceIndent??" ",i=e.focusLines??new Set;return n.map(o=>{let a=z(e.relativePath,o.startLine,o.endLine);if(o.kind==="covered"){let p=o.ordinal===null?"this command":`session #${o.ordinal} via ${o.command}`;return[`${r}${a} [source previously emitted: ${p}; not repeated]`,...e.afterHeader??[]].join(`
|
|
3
|
-
`)}let u=e.headerSuffix??"",d=o.lines.map((p,l)=>{let g=o.startLine+l,c=e.showFocusMarker===!1?"":i.has(g)?">":" ",m=e.lineNumberWidth??5;return`${s}${c}${String(he(g)).padStart(m)} ${p}`});return[`${r}${a}${u}`,...e.blankAfterHeader?[""]:[],...e.afterHeader??[],...d].join(`
|
|
4
|
-
`)}).join(`
|
|
5
|
-
`)}function Wn(e){let t=I.getStore();if(!t||!t.enabled)return e.content;let n=G(t);if(!n)return e.content;let r=Oe(e.content),s=R(n.ledger.evidence,i=>i.kind===e.kind&&i.identity===e.identity&&i.contentHash===r);if(s&&!t.reemit){let i=e.label?`; ${fe(e.label)}`:"";return`${e.indent??""}[${e.kind} evidence previously emitted: receipt ${s.receiptId}; session #${s.ordinal} via ${s.command}${i}; not repeated]`}return t.stagedEvidence.push({kind:e.kind,identity:e.identity,contentHash:r,receiptId:wt(e.kind,e.identity,r),...e.label?{label:fe(e.label)}:{}}),e.content}function Gn(e=!1){let t=I.getStore();if(!t?.enabled)return{enabled:!1,reason:"No explicit CODEBASEIQ_SESSION is active; source packets render independently.",uniqueLines:0,evidenceItems:0,emissions:0,rows:[]};let n=G(t);if(!n)return{enabled:!1,reason:"The exploration-session ledger was unavailable or contended; evidence output is fail-open for this command.",uniqueLines:0,evidenceItems:0,emissions:0,rows:[]};if(e){n.ledger.ranges=[],n.ledger.evidence=[],n.ledger.nextOrdinal=1,n.ledger.updatedAt=new Date().toISOString();try{v(n.ledgerPath,n.ledger,{spacing:2,trailingNewline:!0})}catch{return{enabled:!1,reason:"The exploration-session ledger could not be reset; evidence output remains fail-open.",uniqueLines:0,evidenceItems:0,emissions:0,rows:[]}}}let r=new Map;for(let a of n.ledger.ranges){let u=r.get(a.ordinal)??[];u.push(a),r.set(a.ordinal,u)}let s=new Map;for(let a of n.ledger.evidence){let u=s.get(a.ordinal)??[];u.push(a),s.set(a.ordinal,u)}let o=[...new Set([...r.keys(),...s.keys()])].sort((a,u)=>a-u).map(a=>{let u=r.get(a)??[],d=s.get(a)??[],p=u[0]?.command??d[0]?.command??"unknown",l=u.length===0?null:(()=>{let m=u.slice(0,8).map(h=>z(h.relativePath,h.startLine,h.endLine)).join(", "),f=u.length>8?`, ... ${u.length-8} more range(s)`:"";return` #${a} ${p}: ${m}${f}`})();if(d.length===0)return l;let g=d.slice(0,8).map(m=>`${m.receiptId} ${m.kind}${m.label?` ${m.label}`:""}`).join(", "),c=d.length>8?`, ... ${d.length-8} more item(s)`:"";return l?`${l}
|
|
6
|
-
evidence: ${g}${c}`:` #${a} ${p}: ${g}${c}`});return{enabled:!0,uniqueLines:Ot(n.ledger.ranges),evidenceItems:n.ledger.evidence.length,emissions:new Set([...r.keys(),...s.keys()]).size,rows:o}}function ct(e,t,n,r,s){let i=I.getStore(),o=t+n.length-1;if(!i)return[{kind:"source",startLine:t,endLine:o,lines:[...n]}];let u=(i.enabled?G(i):null)?.ledger.ranges??[],d=n.map(Oe),p=s==="exact-unit"&&!i.reemit?R(u,h=>h.policy==="exact-unit"&&h.relativePath===e&&h.startLine===t&&h.endLine===o&&h.ownerSymbol===r&&Et(h.lineHashes,d)):void 0;if(p)return[{kind:"covered",startLine:t,endLine:o,ordinal:p.ordinal,command:p.command}];let l=s==="exact-unit"&&!i.reemit?pt(u,e,t,o,d):void 0;if(l)return[{kind:"covered",startLine:t,endLine:o,ordinal:l.ordinal,command:l.command}];let g=n.map((h,y)=>dt(u,e,t+y,d[y]));if(!(s==="preview"&&!i.reemit&&g.every(h=>h!==void 0)))return i.staged.push({relativePath:e,startLine:t,endLine:o,ownerSymbol:r,policy:s,lineHashes:d}),[{kind:"source",startLine:t,endLine:o,lines:[...n]}];let m=[],f=0;for(;f<n.length;){let h=g[f],y=f;for(;y+1<n.length&>(h,g[y+1]);)y+=1;let S=t+f,N=t+y;m.push({kind:"covered",startLine:S,endLine:N,ordinal:h.ordinal,command:h.command}),f=y+1}return m}function dt(e,t,n,r){let s=R(e,i=>i.relativePath===t&&i.startLine<=n&&n<=i.endLine&&i.lineHashes[n-i.startLine]===r);if(s)return{ordinal:s.ordinal,command:s.command}}function pt(e,t,n,r,s){let i=R(e,o=>o.policy==="exact-unit"&&o.relativePath===t&&o.startLine<=n&&o.endLine>=r&&s.every((a,u)=>o.lineHashes[n-o.startLine+u]===a));return i?{ordinal:i.ordinal,command:i.command}:void 0}function gt(e,t){return!e||!t?e===t:e.ordinal===t.ordinal&&e.command===t.command}function G(e){if(e.state!==void 0)return e.state;if(!e.sessionIdentity||!e.generationIdentity)return e.state=null,null;try{let t=bt();st(t,{recursive:!0,mode:448});let n=V("sha256").update(e.projectRoot).update("\0").update(e.generationIdentity).update("\0").update(e.sessionIdentity).digest("hex"),r=ye(t,`${n}.json`),s=P(`${r}.lock`,{kind:"source-emission-session",detail:{session:n.slice(0,12)}});if(s.kind!=="acquired")return e.state=null,null;let i;try{i=rt(r)?ht(JSON.parse(b(r,"source emission session ledger")),{projectRoot:e.projectRoot,generationIdentity:e.generationIdentity,sessionIdentity:e.sessionIdentity}):lt(e)}catch{return s.lock.release(),e.state=null,null}return e.state={ledgerPath:r,lock:s.lock,ledger:i},e.state}catch{return e.state=null,null}}function lt(e){return{version:q,projectRoot:e.projectRoot,generationIdentity:e.generationIdentity,sessionIdentity:e.sessionIdentity,nextOrdinal:1,updatedAt:new Date().toISOString(),ranges:[],evidence:[]}}function ht(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid source emission ledger.");let n=e;if(e.version===1&&n.projectRoot===t.projectRoot&&n.generationIdentity===t.generationIdentity&&n.sessionIdentity===t.sessionIdentity&&Number.isSafeInteger(n.nextOrdinal)&&(n.nextOrdinal??0)>0)return{version:q,projectRoot:t.projectRoot,generationIdentity:t.generationIdentity,sessionIdentity:t.sessionIdentity,nextOrdinal:n.nextOrdinal,updatedAt:typeof n.updatedAt=="string"?n.updatedAt:new Date().toISOString(),ranges:[],evidence:[]};if(n.version!==q||n.projectRoot!==t.projectRoot||n.generationIdentity!==t.generationIdentity||n.sessionIdentity!==t.sessionIdentity||!Number.isSafeInteger(n.nextOrdinal)||(n.nextOrdinal??0)<=0||!Array.isArray(n.ranges)||!n.ranges.every(mt)||!Array.isArray(n.evidence)||!n.evidence.every(ft))throw new Error("Invalid source emission ledger.");return n}function mt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return typeof t.relativePath=="string"&&t.relativePath!==""&&Number.isSafeInteger(t.startLine)&&(t.startLine??-1)>=0&&Number.isSafeInteger(t.endLine)&&(t.endLine??-1)>=(t.startLine??0)&&Number.isSafeInteger(t.ordinal)&&(t.ordinal??0)>0&&typeof t.command=="string"&&t.command!==""&&(t.policy==="exact-unit"||t.policy==="preview")&&Array.isArray(t.lineHashes)&&t.lineHashes.length===(t.endLine??0)-(t.startLine??0)+1&&t.lineHashes.every(be)&&(t.ownerSymbol===void 0||typeof t.ownerSymbol=="string")}function ft(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="unit"||t.kind==="edge")&&typeof t.identity=="string"&&t.identity!==""&&typeof t.contentHash=="string"&&be(t.contentHash)&&typeof t.receiptId=="string"&&/^ev-[0-9a-f]{12}$/u.test(t.receiptId)&&Number.isSafeInteger(t.ordinal)&&(t.ordinal??0)>0&&typeof t.command=="string"&&t.command!==""&&(t.label===void 0||typeof t.label=="string")}function yt(e){let t=[...e].sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine),n=[];for(let r of t){let s=n[n.length-1];if(s&&s.relativePath===r.relativePath&&s.ownerSymbol===r.ownerSymbol&&s.policy===r.policy&&r.startLine<=s.endLine+1&&St(s,r)){let i=r.startLine-s.startLine;for(let o=0;o<r.lineHashes.length;o+=1)s.lineHashes[i+o]??=r.lineHashes[o];s.endLine=Math.max(s.endLine,r.endLine)}else n.push({...r,lineHashes:[...r.lineHashes]})}return n}function St(e,t){let n=Math.max(e.startLine,t.startLine),r=Math.min(e.endLine,t.endLine);for(let s=n;s<=r;s+=1)if(e.lineHashes[s-e.startLine]!==t.lineHashes[s-t.startLine])return!1;return!0}function vt(e){let t=new Set,n=[];for(let r of e){let s=`${r.kind}\0${r.identity}\0${r.contentHash}`;t.has(s)||(t.add(s),n.push(r))}return n}function Ot(e){let t=new Map;for(let r of e){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let n=0;for(let r of t.values()){r.sort((o,a)=>o.startLine-a.startLine||o.endLine-a.endLine);let s=-1,i=-1;for(let o of r)s<0?(s=o.startLine,i=o.endLine):o.startLine<=i+1?i=Math.max(i,o.endLine):(n+=i-s+1,s=o.startLine,i=o.endLine);s>=0&&(n+=i-s+1)}return n}function bt(){let e=process.env[me];if(!e)return ye(it(),`codebaseiq-source-sessions-${process.getuid?.()??"user"}`);if(!ot(e))throw new Error(`${me} must be an absolute path.`);return Se(e)}function It(){let e=process.env[at]?.trim();if(e&&!(e.length>ut||!/^[A-Za-z0-9._:-]+$/.test(e)))return`explicit:${e}`}function wt(e,t,n){return`ev-${V("sha256").update(e).update("\0").update(t).update("\0").update(n).digest("hex").slice(0,12)}`}function fe(e){let t=e.replace(/[\r\n\t]+/gu," ").replace(/\s+/gu," ").trim();return t.length<=160?t:`${t.slice(0,157)}...`}function Oe(e){return V("sha256").update(e).digest("hex")}function Et(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function R(e,t){for(let n=e.length-1;n>=0;n-=1){let r=e[n];if(t(r))return r}}function be(e){return typeof e=="string"&&/^[0-9a-f]{64}$/u.test(e)}import{createHash as Ct}from"crypto";import{existsSync as Q,mkdirSync as Pt,rmSync as xt}from"fs";import{tmpdir as At}from"os";import{isAbsolute as Nt,join as we,resolve as T}from"path";var Ee=1,Lt="CODEBASEIQ_SESSION",Ie="CODEBASEIQ_SESSION_DIR",_t=128,Ce=8,Pe=32768,k=new Map;function tr(e,t,n=!0){if(!n)return;let r=$();if(!r)return;let s=Y(e),i=t.map(a=>a.trim()).filter(a=>a.startsWith("codebaseiq system-map ")&&a.length<=Pe).slice(0,Ce),o=xe(s,r);i.length===0?k.delete(o):k.set(o,i)}function J(e,t,n,r=!0,s){if(!r||e!=="anchors"&&e!=="system-map")return;let i=$();if(!i)return;let o=Y(t),a=K(o,i);if(e==="system-map"){n?xt(a,{force:!0}):Q(a)&&s&&F(a,()=>{let u=Z(a,o,i);u&&v(a,{...u,pendingMapContinuation:s,mapExecution:void 0,updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})});return}F(a,()=>{let u=Rt(o,i),d={version:Ee,projectRoot:o,sessionIdentity:i,mapRequired:!0,...u.length>0?{recommendedMapCommands:u}:{},updatedAt:new Date().toISOString()};v(a,d,{spacing:2,trailingNewline:!0})})}function X(e,t=!0){if(!t)return;let n=$();if(!n)return;let r=Y(e),s=K(r,n);Q(s)&&F(s,()=>{let i=Z(s,r,n);if(i){if(i.pendingMapContinuation)throw new Error(["MAP TRANSPORT INCOMPLETE","The selected system map has already been computed. Restarting it would repeat the same repository work.",`Continue exactly: ${i.pendingMapContinuation}`].join(`
|
|
7
|
-
`));if(i.mapExecution&&Tt(i.mapExecution.processId))throw new Error(["NAVIGATION MAP ALREADY RUNNING","A selected system map is already computing in this CODEBASEIQ_SESSION.","Poll the existing terminal execution. Do not launch a duplicate map or inspect in parallel."].join(`
|
|
8
|
-
`));v(s,{...i,mapExecution:{processId:process.pid,startedAt:new Date().toISOString()},updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})}})}function nr(e,t,n=!0){if(!n)return;let r=$();if(!r)return;let s=K(T(e),r);if(!Q(s))return;let i=Z(s,T(e),r);if(!i?.mapRequired)return;let o=i.recommendedMapCommands?.length?["This refusal is a recoverable protocol step, not evidence that the requested code cannot be explored.","Run exactly one of the ranked map commands below, then finish every emitted continuation:",...i.recommendedMapCommands.map((a,u)=>` [${u+1}] ${a}`)]:[`Do not retry ${t}. Run one printed next-abstraction system-map command and finish every emitted continuation first.`];throw new Error(["NAVIGATION MAP REQUIRED","An anchors locator completed in this CODEBASEIQ_SESSION, but its selected system map has not reached transport completion.",`Do not retry ${t}.`,...o,"The map must complete before the agent can choose source detail; map and detail exploration cannot run concurrently."].join(`
|
|
9
|
-
`))}function Z(e,t,n){try{let r=JSON.parse(b(e,"navigation session state"));return r.version===Ee&&r.projectRoot===t&&r.sessionIdentity===n&&r.mapRequired===!0&&(r.recommendedMapCommands===void 0||Array.isArray(r.recommendedMapCommands)&&r.recommendedMapCommands.length<=Ce&&r.recommendedMapCommands.every(s=>typeof s=="string"&&s.startsWith("codebaseiq system-map ")&&s.length<=Pe))&&(r.pendingMapContinuation===void 0||typeof r.pendingMapContinuation=="string")&&(r.mapExecution===void 0||typeof r.mapExecution=="object"&&r.mapExecution!==null&&Number.isSafeInteger(r.mapExecution.processId)&&typeof r.mapExecution.startedAt=="string")?r:null}catch{return null}}function Rt(e,t){let n=xe(e,t),r=k.get(n)??[];return k.delete(n),r}function xe(e,t){return`${e}\0${t}`}function Tt(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function K(e,t){let n=kt();Pt(n,{recursive:!0,mode:448});let r=Ct("sha256").update(e).update("\0").update(t).digest("hex");return we(n,`navigation-${r}.json`)}function kt(){let e=process.env[Ie];if(!e)return we(At(),`codebaseiq-source-sessions-${process.getuid?.()??"user"}`);if(!Nt(e))throw new Error(`${Ie} must be an absolute path.`);return T(e)}function Y(e){let t=process.env.CODEBASEIQ_PROJECT_ROOT?.trim();return T(t||e)}function $(){let e=process.env[Lt]?.trim();if(e&&!(e.length>_t||!/^[A-Za-z0-9._:-]+$/u.test(e)))return`explicit:${e}`}function F(e,t){let n=P(`${e}.lock`,{kind:"navigation-session",detail:{state:e.slice(-17,-5)}});if(n.kind!=="acquired")throw new Error("Navigation session state is busy. Retry the completed command.");try{t()}finally{n.lock.release()}}import{createHash as H,randomBytes as Mt}from"crypto";import{chmodSync as Ht,closeSync as te,fstatSync as Ne,lstatSync as Ut,mkdirSync as Bt,openSync as Te,readSync as jt,readdirSync as ke,renameSync as Dt,rmSync as $e,statSync as zt,writeSync as qt}from"fs";import{tmpdir as Vt}from"os";import{join as _}from"path";import{StringDecoder as Me}from"string_decoder";import{InvalidArgumentError as Le}from"commander";var $t=/^[A-Za-z0-9_@%+=:,./-]+$/u;function Ae(e,t={}){return t.omitSafeQuotes&&$t.test(e)?e:(t.platform??process.platform)==="win32"?`"${e.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${e.replaceAll("'",`'"'"'`)}'`}var Wt="codebaseiq-output-page",Gt=1,Ft="continue",M=32e3,x=256,A=1e5,U=4096,ne=32e6,Qt=64*1024*1024,Jt=256*1024*1024,Xt=32,re=32768,He=3600*1e3,Ue=3;function Be(){return _(Vt(),`codebaseiq-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var ae=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,je=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,Zt=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,Kt=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,De=1,Yt="quota.lock",en=2e3,tn=5,_e=1024*1024,nn=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),ee,rn=Object.freeze({maxSnapshotBytes:Qt,maxAggregateBytes:Jt,maxSnapshotCount:Xt});var ze={writeStdout:e=>{process.stdout.write(e)},writeStderr:e=>{process.stderr.write(e)}};async function sn(e,t,n=ze){return ve({command:e.command,cwd:e.cwd,argv:e.argv,json:e.json,sessionEnabled:e.sourceSession,reemit:e.reemitSource},async()=>{try{await on(e,t,n)}finally{W(!1)}})}async function on(e,t,n){let r=e.pageSize??M,s=e.snapshotRoot??Be(),i=hn(e.snapshotLimits),o=e.maxOutputCharacters??ne;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let a=Math.min(o,ne);if(qe(r),e.cursor!==void 0&&e.cursor.length>U)throw new Error(`Output cursor exceeds the ${U}-character limit. Run the command again without --output-cursor.`);if(e.json&&e.pageSize===void 0&&e.cursor===void 0){e.command==="system-map"&&X(e.cwd,e.sourceSession!==!1),await an(e,t,n);return}let u=Ze(e.argv),d=Ye(e.invocationPrefix),p=Xe(e.command,e.cwd,d,u),l=e.cursor===void 0?void 0:Cn(e.cursor,p);e.command==="system-map"&&!l&&X(e.cwd,e.sourceSession!==!1);let g=l?.snapshotId,c;if(l)try{c=dn(l,p,r,a,s,e.onSnapshotRead)}catch(S){let N=S instanceof Error?S.message:String(S);throw new Error(`${N} Restart with: ${Ke(d,u,r)}`,{cause:S})}else{let S=new ie(p,d,e.command,e.cwd,u,r,a,s,i,!e.json),N=un(j=>S.write(j)),ce=!1;try{await t(),ce=!0}finally{N(),ce||S.abort()}let C;try{C=S.complete()}catch(j){throw S.abort(),j}g=C.snapshotId,c={content:C.content,offset:0,pageIndex:0,pageCount:C.pageCount,totalCharacters:C.totalCharacters,outputHash:C.outputHash}}let m=c.offset+c.content.length,f=c.pageIndex+1>=c.pageCount,h=f?void 0:wn({invocationPrefix:d,nextPageIndex:c.pageIndex+1,snapshotId:On(g)});if(J(e.command,e.cwd,f,e.sourceSession!==!1,h?.command),c.offset===0&&f&&e.cursor===void 0){n.writeStdout(c.content),W(!0),g&&E(g,s);return}let y={kind:Wt,schemaVersion:Gt,producer:{name:"codebaseiq",version:e.producerVersion},command:e.command,contentType:e.json?"application/json":"text/plain",agentInstruction:h?"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.":"OUTPUT COMPLETE: all rendered characters have been retrieved. Evaluate the command result's own coverage separately.",page:h?{offset:c.offset,returnedCharacters:c.content.length,totalCharacters:c.totalCharacters,omittedCharacters:c.totalCharacters-c.content.length,remainingCharacters:c.totalCharacters-m,complete:!1,outputHash:c.outputHash,continuation:h}:{offset:c.offset,returnedCharacters:c.content.length,totalCharacters:c.totalCharacters,omittedCharacters:c.totalCharacters-c.content.length,remainingCharacters:c.totalCharacters-m,complete:!0,outputHash:c.outputHash},content:c.content};if(e.json){n.writeStdout(`${JSON.stringify(y)}
|
|
10
|
-
`),f&&g&&E(g,s);return}n.writeStdout(_n(y)),f&&g&&E(g,s)}async function Or(e,t,n=Be(),r=ze){if(e.length>U)throw new Error(`Output cursor exceeds the ${U}-character limit.`);let s=Je(e);if(!s)throw new Error("Invalid output cursor. Run the original command again.");let i=We(s.snapshotId,n);await sn({command:i.command,producerVersion:t,invocationPrefix:i.invocationPrefix,argv:[...i.argv,"--output-page-size",String(i.pageSize),"--output-cursor",e],cwd:i.cwd,json:i.argv.some(o=>o==="--json"||o.startsWith("--json=")),sourceSession:!i.argv.some(o=>o==="--no-session"),pageSize:i.pageSize,cursor:e,snapshotRoot:n},()=>{throw new Error("Output continuation attempted to rerun the original command.")},r)}function br(e){if(!/^\d+$/u.test(e))throw new Le(`Output page size must be an integer from ${x} through ${A}.`);let t=Number(e);try{qe(t)}catch{throw new Le(`Output page size must be an integer from ${x} through ${A}.`)}return t}function qe(e){if(!Number.isSafeInteger(e)||e<x||e>A)throw new Error(`Output page size must be an integer from ${x} through ${A}.`)}async function an(e,t,n){let r=new se(M,e.maxOutputCharacters??ne),s=process.stdout.write,i=!1,o=`${le(`codebaseiq: JSON output exceeds ${M} characters and may be truncated by the client. Do not use possibly partial client output as evidence. Read every page with: ${Ke(Ye(e.invocationPrefix),Ze(e.argv),M)}`)}
|
|
11
|
-
`;process.stdout.write=((a,u,d)=>{let p=r.push(a,u);return p!==void 0&&(i||(i=!0,n.writeStderr(o)),s.call(process.stdout,p)),Ve(u,d),!0});try{await t();let a=r.finish();a.crossedPageBoundary&&!i&&(i=!0,n.writeStderr(o)),a.bytes.length>0&&s.call(process.stdout,a.bytes),i&&n.writeStderr(o),J(e.command,e.cwd,!0,e.sourceSession!==!1)}finally{process.stdout.write=s}}function un(e){let t=process.stdout.write;return process.stdout.write=((n,r,s)=>{let i=cn(n,r);return e(i),Ve(r,s),!0}),()=>{process.stdout.write=t}}function cn(e,t){return typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):Buffer.from(e)}function Ve(e,t){let n=typeof e=="function"?e:t;typeof n=="function"&&n()}var se=class{constructor(t,n){this.limit=t;this.maxOutputCharacters=n}limit;maxOutputCharacters;decoder=new Me("utf8");chunks=[];overflowed=!1;totalCharacters=0;push(t,n){let r=typeof t=="string"?Buffer.from(t,typeof n=="string"?n:"utf8"):Buffer.from(t);if(this.addCharacters(this.decoder.write(r)),this.overflowed)return r;if(this.chunks.push(r),this.totalCharacters<=this.limit)return;this.overflowed=!0;let s=Buffer.concat(this.chunks);return this.chunks.length=0,s}finish(){this.addCharacters(this.decoder.end());let t=this.totalCharacters>this.limit,n=Buffer.concat(this.chunks);return this.chunks.length=0,{bytes:n,crossedPageBoundary:t}}addCharacters(t){if(this.totalCharacters+=t.length,!Number.isSafeInteger(this.totalCharacters)||this.totalCharacters>this.maxOutputCharacters)throw new Error(`Command output exceeds the ${this.maxOutputCharacters}-character safety limit. Narrow the query before retrying.`)}},ie=class{constructor(t,n,r,s,i,o,a,u,d,p){this.invocationHash=t;this.invocationPrefix=n;this.command=r;this.cwd=s;this.argv=i;this.pageSize=o;this.maxOutputCharacters=a;this.snapshotRoot=u;this.limits=d;this.preferLineBoundaries=p;ue(u);do this.snapshotId=Mt(9).toString("base64url");while(this.snapshotId.startsWith("-"));this.temporaryPath=O(u,this.snapshotId,"tmp")}invocationHash;invocationPrefix;command;cwd;argv;pageSize;maxOutputCharacters;snapshotRoot;limits;preferLineBoundaries;snapshotId;temporaryPath;decoder=new Me("utf8");hash=H("sha256");pages=[];descriptor=null;pending="";firstPageContent="";totalCharacters=0;pageCharacterOffset=0;byteLength=0;reservedBytes=0;opened=!1;finished=!1;write(t){if(this.finished)throw new Error("Output snapshot writer is closed.");this.appendDecoded(this.decoder.write(t))}complete(){if(this.finished)throw new Error("Output snapshot writer is closed.");if(this.appendDecoded(this.decoder.end()),this.finished=!0,!this.opened){let s=this.pending,i=Buffer.from(s);return this.assertWithinByteLimit(i.length),this.hash.update(i),this.pending="",{content:s,totalCharacters:this.totalCharacters,outputHash:this.hash.digest("hex"),pageCount:1}}if((this.pending.length>0||this.pages.length===0)&&(this.flushPage(this.pending),this.pending=""),this.descriptor===null)throw new Error("Output snapshot writer is not open.");te(this.descriptor),this.descriptor=null;let t=this.hash.digest("hex"),n=O(this.snapshotRoot,this.snapshotId,"output"),r=O(this.snapshotRoot,this.snapshotId,"json");try{Dt(this.temporaryPath,n);let s={version:Ue,snapshotId:this.snapshotId,invocationHash:this.invocationHash,invocationPrefix:[...this.invocationPrefix],command:this.command,cwd:this.cwd,argv:[...this.argv],outputHash:t,pageSize:this.pageSize,pages:this.pages,totalCharacters:this.totalCharacters,byteLength:this.byteLength,createdAtMs:Date.now()};return v(r,s),Re(this.snapshotRoot,this.snapshotId,this.byteLength,"complete",this.limits),this.reservedBytes=this.byteLength,{content:this.firstPageContent,totalCharacters:this.totalCharacters,outputHash:t,pageCount:this.pages.length,snapshotId:this.snapshotId}}catch(s){throw E(this.snapshotId,this.snapshotRoot),s}}abort(){this.descriptor!==null&&(te(this.descriptor),this.descriptor=null),this.finished=!0,E(this.snapshotId,this.snapshotRoot)}appendDecoded(t){if(t.length===0)return;let n=this.totalCharacters+t.length;if(!Number.isSafeInteger(n)||n>this.maxOutputCharacters)throw new Error(`Command output exceeds the ${this.maxOutputCharacters}-character safety limit. Narrow the query before retrying.`);for(this.totalCharacters=n,this.pending+=t,this.assertWithinByteLimit(this.byteLength+Buffer.byteLength(this.pending));this.pending.length>this.pageSize;){this.open();let r=In(this.pending,this.pageSize,this.preferLineBoundaries),s=this.pending.slice(0,r);this.pending=this.pending.slice(r),this.flushPage(s)}}open(){if(!this.opened){mn(this.snapshotRoot,this.snapshotId,0,this.limits);try{this.descriptor=Te(this.temporaryPath,"wx",384),this.opened=!0}catch(t){throw fn(this.snapshotRoot,this.snapshotId),t}}}flushPage(t){if(this.descriptor===null)throw new Error("Output snapshot writer is not open.");if(this.pages.length>=re)throw new Error(`Command output requires more than ${re} snapshot pages. Retry with a larger --output-page-size or narrow the query.`);let n=Buffer.from(t),r=this.byteLength+n.length;if(this.assertWithinByteLimit(r),r>this.reservedBytes){let o=Math.min(this.limits.maxSnapshotBytes,Math.ceil(r/_e)*_e);Re(this.snapshotRoot,this.snapshotId,o,"active",this.limits),this.reservedBytes=o}let s=0;for(;s<n.length;){let o=qt(this.descriptor,n,s,n.length-s);if(o<=0)throw new Error("Output snapshot write made no progress.");s+=o}let i={characterOffset:this.pageCharacterOffset,characterLength:t.length,byteOffset:this.byteLength,byteLength:n.length,hash:H("sha256").update(n).digest("hex")};this.pages.length===0&&(this.firstPageContent=t),this.pages.push(i),this.hash.update(n),this.pageCharacterOffset+=t.length,this.byteLength=r}assertWithinByteLimit(t){if(!Number.isSafeInteger(t)||t>this.limits.maxSnapshotBytes)throw new Error(`Command output exceeds the ${this.limits.maxSnapshotBytes}-byte snapshot limit. Narrow the query before retrying.`)}};function dn(e,t,n,r,s,i){ue(s);let o=We(e.snapshotId,s);if(o.invocationHash!==t)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");if(o.snapshotId!==e.snapshotId||e.version===3&&(o.invocationHash!==e.invocationHash||o.outputHash!==e.outputHash))throw new Error("Output snapshot identity does not match this cursor.");if(o.pageSize!==n||e.version===3&&e.pageSize!==n)throw new Error(`Output page size changed after this cursor was issued; use ${o.pageSize}.`);let a=o.pages[e.pageIndex];if(!a)throw new Error("Output cursor points past the current result.");if(o.totalCharacters>r)throw new Error(`Output snapshot exceeds the ${r}-character safety limit.`);if(Date.now()-o.createdAtMs>He)throw E(e.snapshotId,s),new Error("Output snapshot expired before all pages were read.");let u=O(s,e.snapshotId,"output"),d=Te(u,"r");try{let p=Ne(d);if(!p.isFile()||p.size!==o.byteLength)throw new Error("Output snapshot size or type changed.");let l=Buffer.allocUnsafe(a.byteLength),g=0;for(;g<l.length;){let f=jt(d,l,g,l.length-g,a.byteOffset+g);if(f===0)break;g+=f,i?.(f)}let c=Ne(d);if(c.dev!==p.dev||c.ino!==p.ino||c.size!==p.size||g!==a.byteLength)throw new Error("Output snapshot changed while it was being read.");if(H("sha256").update(l).digest("hex")!==a.hash)throw new Error("Output snapshot page no longer matches its metadata.");let m=l.toString("utf8");if(m.length!==a.characterLength)throw new Error("Output snapshot page character count changed.");return{content:m,offset:a.characterOffset,pageIndex:e.pageIndex,pageCount:o.pages.length,totalCharacters:o.totalCharacters,outputHash:o.outputHash}}catch(p){throw E(e.snapshotId,s),p}finally{te(d)}}function We(e,t){if(!w(e))throw new Error("Output snapshot identifier is invalid.");let n;try{n=JSON.parse(b(O(t,e,"json"),"output snapshot metadata"))}catch(r){throw new Error("Output snapshot is unavailable.",{cause:r})}if(!pn(n))throw new Error("Output snapshot metadata is invalid.");return n}function pn(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===Ue&&typeof t.snapshotId=="string"&&w(t.snapshotId)&&L(t.invocationHash)&&et(t.invocationPrefix)&&typeof t.command=="string"&&t.command.length>0&&t.command.length<=256&&typeof t.cwd=="string"&&t.cwd.length>0&&t.cwd.length<=8192&&Ln(t.argv)&&Xe(t.command,t.cwd,t.invocationPrefix,t.argv)===t.invocationHash&&L(t.outputHash)&&Number.isSafeInteger(t.pageSize)&&(t.pageSize??0)>=x&&(t.pageSize??0)<=A&&Array.isArray(t.pages)&&t.pages.length>1&&t.pages.length<=re&&t.pages.every(gn)&&ln(t.pages)&&Number.isSafeInteger(t.totalCharacters)&&(t.totalCharacters??-1)>=0&&t.pages.reduce((n,r)=>n+r.characterLength,0)===t.totalCharacters&&Number.isSafeInteger(t.byteLength)&&(t.byteLength??-1)>=0&&t.pages.reduce((n,r)=>n+r.byteLength,0)===t.byteLength&&Number.isSafeInteger(t.createdAtMs)&&(t.createdAtMs??-1)>=0}function gn(e){if(!e||typeof e!="object")return!1;let t=e;return Number.isSafeInteger(t.characterOffset)&&(t.characterOffset??-1)>=0&&Number.isSafeInteger(t.characterLength)&&(t.characterLength??0)>0&&Number.isSafeInteger(t.byteOffset)&&(t.byteOffset??-1)>=0&&Number.isSafeInteger(t.byteLength)&&(t.byteLength??0)>0&&L(t.hash)}function ln(e){let t=0,n=0;for(let r of e){if(r.characterOffset!==t||r.byteOffset!==n)return!1;t+=r.characterLength,n+=r.byteLength}return!0}function ue(e){Bt(e,{recursive:!0,mode:448});let t=Ut(e);if(!t.isDirectory()||t.isSymbolicLink())throw new Error(`Output snapshot root is not a private directory: ${e}`);if(typeof process.getuid=="function"&&t.uid!==process.getuid())throw new Error(`Output snapshot root is not owned by the current user: ${e}`);process.platform!=="win32"&&Ht(e,448)}function hn(e){let t={...rn,...e};for(let[n,r]of Object.entries(t))if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Output snapshot ${n} must be a positive integer.`);if(t.maxSnapshotBytes>t.maxAggregateBytes)throw new Error("Output snapshot maxSnapshotBytes cannot exceed maxAggregateBytes.");return t}function mn(e,t,n,r){B(e,()=>{Sn(e),Ge(e,t,n,"active",r)})}function Re(e,t,n,r,s){if(!Number.isSafeInteger(n)||n<0||n>s.maxSnapshotBytes)throw new Error(`Command output exceeds the ${s.maxSnapshotBytes}-byte snapshot limit.`);B(e,()=>{Ge(e,t,n,r,s)})}function Ge(e,t,n,r,s){if(!Number.isSafeInteger(n)||n<0||n>s.maxSnapshotBytes)throw new Error(`Command output exceeds the ${s.maxSnapshotBytes}-byte snapshot limit.`);let i=yn(e),o=i.find(l=>l.snapshotId===t),a=i.reduce((l,g)=>l+g.reservedBytes,0)-(o?.reservedBytes??0)+n,u=i.length+(o?0:1);if(u>s.maxSnapshotCount||a>s.maxAggregateBytes)throw new Error(`Output snapshot capacity is full (${u}/${s.maxSnapshotCount} snapshots, ${a}/${s.maxAggregateBytes} bytes). Narrow the query or finish an existing pagination sequence before retrying.`);let d=Date.now(),p={version:De,snapshotId:t,pid:process.pid,...oe()?{processIdentity:oe()}:{},reservedBytes:n,state:r,createdAtMs:o?.createdAtMs??d,updatedAtMs:d};v(O(e,t,"reserve"),p)}function fn(e,t){B(e,()=>{$e(O(e,t,"reserve"),{force:!0})})}function yn(e){let t=[];for(let n of ke(e,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let r=n.name.slice(0,-8);if(w(r))try{let s=JSON.parse(b(_(e,n.name),"output snapshot reservation"));if(!Fe(s)||s.snapshotId!==r)throw new Error("reservation identity is invalid");t.push(s)}catch(s){throw new Error(`Output snapshot reservation ${n.name} is invalid; retry after its owning process or snapshot expires.`,{cause:s})}}return t}function Fe(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===De&&typeof t.snapshotId=="string"&&w(t.snapshotId)&&Number.isSafeInteger(t.pid)&&(t.pid??0)>0&&(t.processIdentity===void 0||de(t.processIdentity)!==null&&t.processIdentity.pid===t.pid)&&Number.isSafeInteger(t.reservedBytes)&&(t.reservedBytes??-1)>=0&&(t.state==="active"||t.state==="complete")&&Number.isSafeInteger(t.createdAtMs)&&Number.isSafeInteger(t.updatedAtMs)}function Sn(e){let t=Date.now();for(let n of ke(e,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let r=n.name.slice(0,-8);if(!w(r))continue;let s=null;try{let u=JSON.parse(b(_(e,n.name),"output snapshot reservation"));s=Fe(u)?u:null}catch{s=null}let i=vn(O(e,r,"json")),o=s?.state==="active"&&ge(s.pid)&&(s.processIdentity===void 0||(()=>{let u=D(s.pid);return u!==null&&pe(s.processIdentity,u)})()),a=s?t-s.updatedAtMs>He:!1;o||i&&!a||!i&&s&&!a&&s.state==="complete"||Qe(r,e)}}function vn(e){try{return zt(e),!0}catch{return!1}}function B(e,t){ue(e);let n=_(e,Yt),r=Date.now()+en;for(;;){let s=P(n,{kind:"output-snapshot-quota",processIdentity:oe()});if(s.kind==="acquired")try{return t()}finally{s.lock.release()}if(Date.now()>=r)throw new Error("Output snapshot quota is busy. Retry the command.");Atomics.wait(nn,0,0,tn)}}function oe(){return ee===void 0&&(ee=D(process.pid)),ee}function E(e,t){w(e)&&B(t,()=>Qe(e,t))}function Qe(e,t){for(let n of["json","output","tmp","reserve"])$e(O(t,e,n),{force:!0})}function O(e,t,n){if(!w(t))throw new Error("Output snapshot identifier is invalid.");return _(e,`${t}.${n}`)}function On(e){if(!e)throw new Error("Incomplete output did not create a resumable snapshot.");return e}function bn(e){return e>=55296&&e<=56319}function In(e,t,n){if(n){let r=e.lastIndexOf(`
|
|
12
|
-
`,t-1);if(r>=0)return r+1}return bn(e.charCodeAt(t-1))?t-1:t}function wn(e){let t=En({pageIndex:e.nextPageIndex,snapshotId:e.snapshotId});return{cursor:t,command:Nn(e.invocationPrefix,t)}}function En(e){return je.test(e.snapshotId)?e.pageIndex===1?e.snapshotId:`${e.snapshotId}.${e.pageIndex.toString(36)}`:`4.${xn(e.snapshotId)}.${e.pageIndex.toString(36)}`}function Cn(e,t){let n=Je(e);if(!n)throw new Error("Invalid output cursor. Run the command again without --output-cursor.");if(n.version===3&&n.invocationHash!==t)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");return n}function Je(e){let t=Kt.exec(e);if(t){let r=t[2]??"1",s=Number.parseInt(r,36);return Number.isSafeInteger(s)&&s>=1&&s.toString(36)===r?{version:4,pageIndex:s,snapshotId:t[1]}:null}let n=Zt.exec(e);if(n){let r=An(n[1]),s=Number.parseInt(n[2],36);return r&&Number.isSafeInteger(s)&&s>=1&&s.toString(36)===n[2]?{version:4,pageIndex:s,snapshotId:r}:null}try{let r=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));return Pn(r)?r:null}catch{return null}}function Pn(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===3&&L(t.invocationHash)&&Number.isSafeInteger(t.pageIndex)&&(t.pageIndex??-1)>=1&&Number.isSafeInteger(t.pageSize)&&(t.pageSize??0)>=x&&(t.pageSize??0)<=A&&L(t.outputHash)&&typeof t.snapshotId=="string"&&w(t.snapshotId)}function xn(e){if(!ae.test(e))throw new Error("Output snapshot identifier is invalid.");return Buffer.from(e.replaceAll("-",""),"hex").toString("base64url")}function An(e){let t=Buffer.from(e,"base64url");if(t.length!==16)return null;let n=t.toString("hex"),r=`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`;return ae.test(r)?r:null}function w(e){return typeof e=="string"&&(je.test(e)||ae.test(e))}function L(e){return typeof e=="string"&&/^[a-f0-9]{64}$/u.test(e)}function Xe(e,t,n,r){return H("sha256").update(JSON.stringify({command:e,cwd:t,invocationPrefix:n,argv:r})).digest("hex")}function Ze(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r==="--output-page-size"||r==="--output-cursor"){n+=1;continue}r.startsWith("--output-page-size=")||r.startsWith("--output-cursor=")||t.push(r)}return t}function Ke(e,t,n){return tt([...e,...t,"--output-page-size",String(n)])}function Nn(e,t){return tt([...e,Ft,t])}function Ye(e){let t=e===void 0?["codebaseiq"]:[...e];if(!et(t))throw new Error("Output pagination invocation prefix must contain one to sixteen non-empty shell arguments.");return t}function et(e){return Array.isArray(e)&&e.length>0&&e.length<=16&&e.every(t=>typeof t=="string"&&t.length>0&&t.length<=2048&&!t.includes("\0")&&!t.includes("\r")&&!t.includes(`
|
|
13
|
-
`))}function Ln(e){return Array.isArray(e)&&e.length>0&&e.length<=256&&e.every(t=>typeof t=="string"&&t.length<=8192&&!t.includes("\0")&&!t.includes("\r")&&!t.includes(`
|
|
14
|
-
`))}function tt(e){return e.map(t=>Ae(t,{omitSafeQuotes:!0})).join(" ")}function _n(e){let t=e.page.continuation,n=Math.max(e.page.offset,e.page.offset+e.page.returnedCharacters-1),r=`[codebaseiq output page: characters ${e.page.offset}-${n} of ${e.page.totalCharacters}]
|
|
15
|
-
`,s=t?`
|
|
16
|
-
[Incomplete: ${e.page.remainingCharacters} characters remain. Continue exactly:
|
|
17
|
-
${t.command}]
|
|
18
|
-
`:`
|
|
19
|
-
[codebaseiq transport complete; evaluate command coverage separately]
|
|
20
|
-
`;return`${r}${e.content}${s}`}export{Ae as a,Dn as b,zn as c,qn as d,Vn as e,Wn as f,Gn as g,tr as h,nr as i,Ft as j,M as k,sn as l,Or as m,br as n};
|
|
21
|
-
//# sourceMappingURL=chunk-YPBKBYPS.js.map
|
package/dist/chunk-ZMA5HWXY.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as fe}from"./chunk-V4NGDIEA.js";import{A as me,z as M}from"./chunk-JNXI6NQ7.js";import{c as se,h as ae}from"./chunk-O2M3VNDY.js";import{Q as D,R as ue,U as pe,V as he}from"./chunk-K4S2VH42.js";import{B as N,D as ge}from"./chunk-MEUHIDI3.js";import{d as ie}from"./chunk-5FWR5HLG.js";import{K as ce,L as le,V as de,a as j,k as ne,l as k}from"./chunk-T75DS2E6.js";import{g as oe}from"./chunk-RCIGX23V.js";import{j as w,r as W}from"./chunk-D7DOB27N.js";import{a as Y,c as Z,e as ee}from"./chunk-6O3KXIDL.js";import{H,I as z,J as R,K as X,M as J,N as K,P,R as te,T as O,V as re,W as T,X as _,h as C,n as V}from"./chunk-UQYQBLJX.js";import{statSync as ye}from"fs";import{basename as He,isAbsolute as ze,join as L,relative as Xe}from"path";import{fileURLToPath as Je}from"url";import{watch as Ke}from"chokidar";import Ze from"ignore";var Ee=5e3,Re=class{projectRoot;config;watchConfig;outputDb;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;clojureConfigPath;indexerConcurrency;onStatus;onReindexComplete;onReindexError;onRefreshSuppressed;onFileChanged;onBulkChange;onError;reindexRunner;subscriptionFactory;budgetInspector;clock;activeOperation=null;stopPromise=null;stopInProgress=!1;status={state:"idle"};debounceTimer=null;cooldownTimer=null;budgetTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fileChangeTimer=null;pendingFileChanges=new Set;bulkChangePending=!1;fsWatchers=[];sourcePollingFallbackStarted=!1;gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;observationEpoch=0;changeSequence=0;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=ge(e.config),this.outputDb=e.outputDb??L(z(this.projectRoot,e.config),"index.db"),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.clojureConfigPath=e.config.indexer?.clojure?.configPath,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onReindexError=e.onReindexError??(()=>{}),this.onRefreshSuppressed=e.onRefreshSuppressed??(()=>{}),this.onFileChanged=e.onFileChanged,this.onBulkChange=e.onBulkChange;let r=e.onError??(n=>console.error(n.message));this.onError=n=>{this.observationEpoch+=1,r(n)},this.clock=e.clock??it,Ie.set(this,gt(e.stopTimeoutMs??Ee,"watcher stop timeout")),this.reindexRunner=e.reindexRunner??pt(),this.subscriptionFactory=e.subscriptionFactory??ot,this.budgetInspector=e.budgetInspector??ae,Pe.set(this,{gitReader:e.gitReader??te,languages:Te(e.languages??e.config.languages),stagedIndexEntries:null,gitSignalPaths:null,lastGitSignal:null}),this.gitignoreFilter=oe(e.projectRoot),this.extraIgnore=Ze(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){if(this.stopInProgress)throw new Error("Cannot restart a watcher while its previous ownership is still draining.");this.stopped=!1,this.stopPromise=null,G(this).errors=[],this.sourcePollingFallbackStarted=!1,this.observationEpoch+=1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{this.startSourceWatcher()}catch(e){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(e)}`))}}stop(){if(this.stopPromise)return this.stopPromise;this.stopped=!0,this.stopInProgress=!0;let e=this.fsWatchers;this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearBudgetTimer(),this.clearGitPollTimer(),this.clearFileChangeWindow();let r=this.activeOperation;r&&this.setStatus({state:"draining",startedAt:this.wallNow(),reason:"waiting for the active reindex worker to exit"});let n=[...G(this).closures],i=tt(this),s=this.clock.now()+i;return this.stopPromise=this.finishStop(e,n,r,s,i).catch(a=>{throw this.stopInProgress=!1,a}),this.stopPromise}observation(){return{epoch:this.observationEpoch,changeSequence:this.changeSequence}}requestRefresh(e,r={}){if(!this.stopped){if(!r.immediate||this.reindexInFlight||this.status.state==="cooldown"||this.status.state==="budget-paused"){this.scheduleReindex(e);return}this.pendingTrigger=Se(this.pendingTrigger,e),this.changedFiles+=1,this.changeSequence+=1,this.clearDebounceTimer(),this.triggerReindex()}}startSourceWatcher(e=!1){let r=this.subscriptionFactory(this.projectRoot,{ignoreInitial:!0,ignored:(n,i)=>this.isIgnoredWatchPath(n,i?.isDirectory()??!1),usePolling:e,...e?{interval:500,binaryInterval:1e3}:{}});r.on("all",(n,i)=>{!this.stopped&&n!=="addDir"&&n!=="unlinkDir"&&this.handleFileChange(i)}),r.on("error",n=>this.handleSourceWatcherError(r,n,e)),this.fsWatchers.push(r)}handleSourceWatcherError(e,r,n){if(n||this.sourcePollingFallbackStarted||!ht(r)||this.stopped){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(r)}`));return}this.observationEpoch+=1,this.sourcePollingFallbackStarted=!0,this.fsWatchers=this.fsWatchers.filter(i=>i!==e),rt(G(this),e,i=>this.onError(i));try{this.startSourceWatcher(!0)}catch(i){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(i)}`))}}isIgnoredWatchPath(e,r){let n=this.relativeWatchPath(e);if(!n)return!1;let i=r?`${n}/`:n;return i===".git/"||i.startsWith(".git/")?!0:this.gitignoreFilter.isIgnored(i)||this.extraIgnore.ignores(i)}handleFileChange(e){let r=this.relativeWatchPath(e);!r||r===".."||r.startsWith("../")||r===".git"||r.startsWith(".git/")||this.gitignoreFilter.isIgnored(r)||this.extraIgnore.ignores(r)||r.endsWith("index.db")||r.endsWith("index.scip")||r.endsWith("index.db.tmp")||He(r).startsWith(se)||(r===".codebaseiq.json"&&Ce(this,this.projectRoot),we(this,r)&&(this.noteFileChange(r),this.scheduleReindex({kind:"watch-source",detail:r})))}noteFileChange(e){!this.onFileChanged&&!this.onBulkChange||(this.bulkChangePending||(this.pendingFileChanges.add(e),this.pendingFileChanges.size>at&&(this.pendingFileChanges.clear(),this.bulkChangePending=!0)),this.fileChangeTimer??=this.clock.setTimeout(()=>this.flushFileChangeWindow(),st))}flushFileChangeWindow(){if(this.fileChangeTimer=null,this.stopped)return;let e=[...this.pendingFileChanges],r=this.bulkChangePending;this.pendingFileChanges.clear(),this.bulkChangePending=!1;try{r?this.onBulkChange?.():this.onFileChanged?.(e)}catch{}}clearFileChangeWindow(){this.fileChangeTimer&&(this.clock.clearTimeout(this.fileChangeTimer),this.fileChangeTimer=null),this.pendingFileChanges.clear(),this.bulkChangePending=!1}relativeWatchPath(e){let r=ze(e)?e:L(this.projectRoot,e);return Xe(this.projectRoot,r).replaceAll("\\","/")}scheduleReindex(e){if(this.pendingTrigger=Se(this.pendingTrigger,e),this.changedFiles++,this.changeSequence+=1,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}if(this.status.state==="budget-paused"){this.dirty=!0,this.setStatus({...this.status,dirty:!0});return}this.clearDebounceTimer();let r=this.wallNow()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:r}),this.debounceTimer=this.clock.setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=this.inspectBudget();if(e.state==="paused"){this.dirty=!0;let a=Math.max(this.wallNow()+1,e.until);this.setStatus({state:"budget-paused",until:a,dirty:!0,reason:e.detail,rebuilt:e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes}),this.clearBudgetTimer(),this.budgetTimer=this.clock.setTimeout(()=>{this.budgetTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},Math.min(2147483647,Math.max(1,a-this.wallNow())));return}let r=this.clock.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&r<this.watchConfig.cooldownMs){let a=this.watchConfig.cooldownMs-r;this.dirty=!0;let o=this.wallNow()+a;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},a);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let n=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let i=this.wallNow();this.setStatus({state:"indexing",startedAt:i});let s=this.reindexRunner.start(this.reindexRequest(n));this.activeOperation=s,s.completion.then(a=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),this.stopped)return;let o=!1;try{o=this.onReindexComplete(a,n)===!0}catch(l){this.onError(l instanceof Error?l:new Error(String(l)))}if(this.dirty&&!this.stopped){if(o){let c=this.pendingTrigger??{kind:"unknown"};this.dirty=!1,this.changedFiles=0,this.pendingTrigger=null,this.onRefreshSuppressed(c),this.setStatus({state:"idle"});return}let l=this.wallNow()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:l,dirty:!0}),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(a=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),this.stopped)return;let o=a instanceof Error?a:new Error(String(a));this.onReindexError(o,n),this.onError(o),this.setStatus({state:"idle"})}).finally(()=>{this.activeOperation===s&&(this.activeOperation=null)})}async finishStop(e,r,n,i,s){let a=[],o=e.map(async p=>{try{await p.close()}catch(m){a.push(`watch subscription close failed: ${String(m)}`)}});o.push(...r),n&&o.push((async()=>{try{let p=await n.cancel();p.state==="degraded"&&a.push(p.reason)}catch(p){a.push(`reindex cancellation failed: ${p instanceof Error?p.message:String(p)}`)}})());let l=o.length,c=o.map(p=>p.finally(()=>{l-=1})),u=await et(c,i,this.clock),d=G(this);return a.push(...d.errors),d.errors=[],u?this.stopInProgress=!1:(a.push(`watch shutdown exceeded the ${s}ms deadline with ${l} operation(s) still pending`),Promise.all(c).then(()=>{this.stopInProgress=!1})),a.length>0?(this.setStatus({state:"draining",startedAt:this.wallNow(),reason:a.join("; ")}),{state:"degraded",reasons:a}):(this.setStatus({state:"idle"}),{state:"stopped"})}wallNow(){return this.clock.wallNow?.()??this.clock.now()}inspectBudget(){try{return this.budgetInspector(this.outputDb,this.watchConfig.resourceBudget,new Date(this.wallNow()))}catch(e){return{state:"paused",reason:"activity-evidence",until:this.wallNow()+this.watchConfig.resourceBudget.windowMs,rebuilt:0,estimatedWriteBytes:0,detail:`reindex activity evidence could not be read: ${e instanceof Error?e.message:String(e)}`}}}reindexRequest(e){return{projectRoot:this.projectRoot,config:this.config,languages:this.languages,pnpmWorkspaces:this.pnpmWorkspaces,typescriptProjectMode:this.typescriptProjectMode,typescriptProjects:this.typescriptProjects,clojureConfigPath:this.clojureConfigPath,indexerConcurrency:this.indexerConcurrency,trigger:e}}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(this.clock.clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(this.clock.clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}clearBudgetTimer(){this.budgetTimer&&(this.clock.clearTimeout(this.budgetTimer),this.budgetTimer=null)}startGitStatePolling(){if(this.lastGitState=this.readGitState(),!this.lastGitState)return;let e=y(this);e.gitSignalPaths=this.resolveGitSignalPaths(),e.lastGitSignal=this.gitActivitySignal(),e.stagedIndexEntries=xe(this.projectRoot,e.gitReader),this.gitPollTimer=this.clock.setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.()}resolveGitSignalPaths(){let e=y(this).gitReader,r=T(this.projectRoot,["rev-parse","--git-dir"],e),n=T(this.projectRoot,["rev-parse","--git-common-dir"],e);if(!r)return null;let i=_(this.projectRoot,r),s=n?_(this.projectRoot,n):i,a=this.lastGitState?.indexPath;return[L(i,"HEAD"),L(s,"packed-refs"),L(s,"refs","heads"),...a?[a]:[]]}gitActivitySignal(){let e=y(this).gitSignalPaths;if(!e)return null;let r="";for(let n of e)try{let i=ye(n);r+=`${n}:${i.mtimeMs}:${i.size};`}catch{r+=`${n}:absent;`}return r}pollGitState(){let e=this.gitActivitySignal();if(e!==null){if(e===y(this).lastGitSignal)return;y(this).lastGitSignal=e}let r=this.lastGitState,n=this.readGitState();if(!r||!n||this.stopped){this.lastGitState=n;return}this.lastGitState=n;let i=r.head!==n.head,s=r.indexPath!==n.indexPath||r.indexMtimeMs!==n.indexMtimeMs||r.indexSize!==n.indexSize;if(!i&&!s)return;let a=y(this),o=a.stagedIndexEntries,l=xe(this.projectRoot,a.gitReader);a.stagedIndexEntries=l;let c=ft(this.projectRoot,a.gitReader,r,n,o,l,i,s),u=null;c!==null&&(c.includes(".codebaseiq.json")&&Ce(this,this.projectRoot),u=c.filter(d=>we(this,d)),u.length===0)||(i&&s?this.scheduleReindex({kind:"watch-git-state",detail:F("HEAD and index changed",u)}):i?this.scheduleReindex({kind:"watch-git-head",detail:F("HEAD changed",u)}):s&&this.scheduleReindex({kind:"watch-git-index",detail:F(n.indexPath??"index changed",u)}))}readGitState(){let e=y(this).gitReader,r=T(this.projectRoot,["rev-parse","--git-path","index"],e);if(!r)return null;let n=_(this.projectRoot,r),i={head:T(this.projectRoot,["rev-parse","--verify","HEAD"],e),indexPath:n};try{let s=ye(n);i.indexMtimeMs=s.mtimeMs,i.indexSize=s.size}catch{i.indexMtimeMs=void 0,i.indexSize=void 0}return i}clearGitPollTimer(){this.gitPollTimer&&(this.clock.clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};async function et(t,e,r){if(t.length===0)return!0;let n=Promise.all(t).then(()=>!0),i=Math.max(0,e-r.now()),s=null,a=new Promise(l=>{s=r.setTimeout(()=>l(!1),i)}),o=await Promise.race([n,a]);return o&&s&&r.clearTimeout(s),o}var ve=new WeakMap,Ie=new WeakMap,Pe=new WeakMap;function G(t){let e=ve.get(t);if(e)return e;let r={closures:new Set,errors:[]};return ve.set(t,r),r}function tt(t){return Ie.get(t)??Ee}function y(t){let e=Pe.get(t);if(!e)throw new Error("Watcher input state was not initialized.");return e}function rt(t,e,r){let n=Promise.resolve().then(()=>e.close()).catch(i=>{let s=`watch subscription close failed during polling fallback: ${String(i)}`;t.errors.push(s),r(new Error(s))});t.closures.add(n),n.then(()=>t.closures.delete(n))}function nt(t,e=ee){let{projectRoot:r,config:n,languages:i,pnpmWorkspaces:s,typescriptProjectMode:a,typescriptProjects:o,clojureConfigPath:l,indexerConcurrency:c,trigger:u}=t,d=N(r),p=Object.keys(d).length>0?d:n,m=K(r,p),f=p.indexer?.typescript,g=p.indexer?.clojure,I=e(process.pid);if(!I)throw new Error(`Could not establish watcher process identity for reindex worker ownership (pid ${process.pid}).`);return{workerPath:Je(new URL("./reindex-worker.js",import.meta.url)),env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:r,SCIP_REINDEX_OUTPUT_SCIP:m.indexPath,SCIP_REINDEX_OUTPUT_DB:m.dbPath,SCIP_REINDEX_LANGUAGES:(p.languages??i)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(p.indexerConcurrency??c??""),SCIP_REINDEX_PNPM_WORKSPACES:f?.pnpmWorkspaces??s?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:f?.projectMode??a,projects:f?.projects??o??[]}),SCIP_REINDEX_CLOJURE_CONFIG_PATH:g?.configPath??l??"",SCIP_REINDEX_TRIGGER_KIND:u.kind,SCIP_REINDEX_TRIGGER_DETAIL:u.detail??"",SCIP_REINDEX_PROCESS_GROUP_LEADER:"1",SCIP_REINDEX_PARENT_IDENTITY:JSON.stringify(I)}}}var it={now:Y,wallNow:()=>Date.now(),setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},ot=(t,e)=>Ke(t,e),st=120,at=200,ct=15*6e4,lt=1e3,dt=64*1024;function ut(){return{stdoutTail:"",stderrTail:"",stdoutTruncated:!1,stderrTruncated:!1}}function be(t,e){let r=t instanceof Error?t.message:String(t),n=e.stderrTail.trim()||e.stdoutTail.trim();return n?`${r}
|
|
2
|
-
${n}`:r}function pt(t={}){let e=t.timeoutMs??ct,r=t.terminationGraceMs??lt,n=t.maxOutputBytes??dt,i=t.resolveLaunch??nt;return{start(s){let a=i(s),o=new AbortController,l=ut(),c=!1,u=he({command:process.execPath,args:[...process.execArgv,a.workerPath],label:"watch reindex worker",env:a.env,timeoutMs:e,terminationGraceMs:r,maxStdoutBytes:n,maxStderrBytes:n,outputLimitBehavior:"truncate-tail",signal:o.signal,detached:!0}).then(d=>{if(l={stdoutTail:d.stdout,stderrTail:d.stderr,stdoutTruncated:d.stdoutTruncated,stderrTruncated:d.stderrTruncated},d.status!==0)throw new Error(be(new Error(`Reindex worker exited with ${d.signal?`signal ${d.signal}`:`code ${d.status}`}`),l));return d.durationMs}).catch(d=>{throw d instanceof pe&&(l={stdoutTail:d.stdout,stderrTail:d.stderr,stdoutTruncated:d.stdoutTruncated,stderrTruncated:d.stderrTruncated}),new Error(be(d,l),{cause:d})}).finally(()=>{c=!0});return{completion:u,async cancel(){c||o.abort();try{await u}catch{}return{state:"exited",diagnostics:l}},diagnostics:()=>l}}}}function Se(t,e){return t?t.kind===e.kind?t.detail===e.detail?t:{kind:t.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${t.kind}, ${e.kind}`}:e}function ht(t){return t instanceof Error&&"code"in t&&t.code==="EMFILE"||String(t).includes("EMFILE: too many open files")}function gt(t,e){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`${e} must be a positive integer.`);return t}function Te(t){return t&&t.length>0?[...t]:j}function Ce(t,e){try{y(t).languages=Te(N(e).languages)}catch{y(t).languages=j}}function we(t,e){return V(e,y(t).languages)!=="other"}function ft(t,e,r,n,i,s,a,o){let l=new Set;if(a){if(!r.head||!n.head)return null;let c=e.runResult(t,["diff","--name-only","-z","--no-renames","--relative",r.head,n.head,"--"]);if(c.kind!=="success")return null;for(let u of mt(c.output))l.add(u)}if(o){if(i===null||s===null)return null;for(let c of Rt(i,s))l.add(c)}return[...l].sort()}function xe(t,e){let r=e.runResult(t,["diff","--cached","--raw","-z","--no-renames","--relative","--"]);return r.kind==="success"?yt(r.output):null}function mt(t){return t.split("\0").filter(e=>e.length>0)}function yt(t){let e=t.split("\0");if(e.at(-1)===""&&e.pop(),e.length%2!==0)return null;let r=new Map;for(let n=0;n<e.length;n+=2){let i=e[n],s=e[n+1];if(!i.startsWith(":")||!s)return null;r.set(s,i)}return r}function Rt(t,e){return[...new Set([...t.keys(),...e.keys()])].filter(n=>t.get(n)!==e.get(n))}function F(t,e){return e===null?`${t}; changed paths unavailable`:e.length===0?t:e.length===1?e[0]:`${e.length} compiler inputs changed`}import{existsSync as E,lstatSync as b,readdirSync as Ae,realpathSync as ke,rmSync as v,statSync as _e}from"fs";import{join as h,resolve as A,sep as We}from"path";var vt=3600*1e3,bt=2*1024*1024*1024,B=300*1e3,St="gc-state.json",Ct="gc.lock",wt="projects-gc-state.json",xt="projects-gc.lock",Et=1440*60*1e3;function It(t){let e=t.leases.filter(o=>o.managed&&!o.live&&!o.busy),r=Ge(t.leases,t.locks),n={};for(let o of t.generations)r.has(o.generationId)||(n[o.generationId]=o.unreferencedAt??t.nowMs);let i=t.generations.filter(o=>!r.has(o.generationId)).sort((o,l)=>n[o.generationId]-n[l.generationId]||o.generationId.localeCompare(l.generationId)),s=new Set;for(let o of i)t.nowMs-n[o.generationId]>=t.policy.generationTtlMs&&s.add(o.generationId);let a=t.generations.filter(o=>!s.has(o.generationId)).reduce((o,l)=>o+l.size,0);for(let o of i){if(a<=t.policy.budgetBytes)break;s.has(o.generationId)||(s.add(o.generationId),a-=o.size)}for(let o of s)delete n[o];return{deleteWorktrees:e,deleteGenerations:t.generations.filter(o=>s.has(o.generationId)),deleteLocks:t.locks.filter(o=>!o.live),deleteTemporaries:t.temporaries.filter(o=>!o.live),protectedGenerationIds:[...r].sort(),unreferencedSince:n}}function Ge(t,e){let r=new Set(t.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of e)n.live&&r.add(n.generationId);return r}function lr(t,e,r={}){if(!J())return{kind:"disabled"};let n=O(t);if(!n)return{kind:"unavailable"};let i=h(R(),"repositories",n.repositoryId),s=(r.now??Date.now)(),a=E(i)?je(t,i,n.repositoryId,e,s,r):{kind:"unavailable"};return kt(t,n.repositoryId,e,s,r),Pt(s,r),a}function Pt(t,e){let r=h(R(),"projects"),n={examined:0,reclaimed:0};if(!E(r))return n;let i=h(r,wt),s=Ne(i);if(!e.force&&s!==void 0&&t-s<B)return n;let a=k(h(r,xt));if(!a)return n;try{for(let o of x(r)){let l=h(r,o),c;try{c=b(l)}catch{continue}if(!(!c.isDirectory()||c.isSymbolicLink())&&(n.examined+=1,!!Tt(l,t)))try{v(l,{recursive:!0,force:!0}),n.reclaimed+=1}catch{}}W(i,{version:1,lastSweepAt:new Date(t).toISOString()},{spacing:2,trailingNewline:!0})}finally{a.release()}return n}function Tt(t,e){let r=h(t,H),n;try{let a=JSON.parse(C(r,"cache-ownership"));if(typeof a.canonicalProjectRoot!="string"||a.canonicalProjectRoot.length===0)return!1;n=a.canonicalProjectRoot}catch{return!1}if(E(n))return!1;try{if(e-b(t).mtimeMs<Et)return!1}catch{return!1}let i=ue(D(t).statePath);if(i&&w(i.pid))return!1;let s=k(h(t,"cache-lifecycle.lock"));return s===null?!1:(s.release(),!0)}function je(t,e,r,n,i,s){let a=h(e,"gc-state.json"),o=De(a);if(!s.force&&o&&i-Date.parse(o.lastSweepAt)<B)return{kind:"throttled",sweptAt:o.lastSweepAt};let l=ne(e,{now:()=>i});if(!l)return{kind:"busy"};try{let c=Oe(t,e,r,o?.unreferencedSince??{}),u=It({nowMs:i,...c,policy:{generationTtlMs:s.policy?.generationTtlMs??vt,budgetBytes:s.policy?.budgetBytes??bt}}),d=0,p=0;for(let g of u.deleteWorktrees){if(!Q(g.lease))continue;if(!E(g.lease.localCacheDir)){v(g.leasePath,{force:!0}),p+=1;continue}if(!At(g.lease))continue;let I=k(h(g.lease.localCacheDir,"cache-lifecycle.lock"));if(I)try{if($(g.lease,!0))continue;try{fe({projectRoot:g.lease.projectRoot,cacheDir:g.lease.localCacheDir,cliVersion:n})}catch{continue}if($(g.lease,!0))continue;v(g.lease.localCacheDir,{recursive:!0,force:!0}),v(g.leasePath,{force:!0}),p+=1}finally{I.release()}}for(let g of u.deleteLocks)v(g.path,{force:!0});for(let g of u.deleteTemporaries)v(g.path,{recursive:!0,force:!0});for(let g of u.deleteGenerations)v(g.path,{recursive:!0,force:!0}),d+=g.size;ie(h(e,"evidence.db"));let m={kind:"swept",sweptAt:new Date(i).toISOString(),deletedWorktrees:p,deletedGenerations:u.deleteGenerations.length,deletedBytes:d,protectedGenerations:u.protectedGenerationIds.length},f={version:1,lastSweepAt:m.sweptAt,unreferencedSince:u.unreferencedSince,lastResult:m};return W(a,f,{spacing:2,trailingNewline:!0}),m}catch(c){return{kind:"failed",error:c instanceof Error?c.message:String(c)}}finally{l.release()}}function kt(t,e,r,n,i){let s=h(R(),"repositories");if(!E(s))return;let a=h(s,St),o=Ne(a);if(!i.force&&o!==void 0&&n-o<B)return;let l=k(h(s,Ct));if(l)try{for(let c of x(s)){if(c===e||!/^[a-f0-9]{24}$/.test(c))continue;let u=h(s,c),d;try{d=b(u)}catch{continue}if(!d.isDirectory()||d.isSymbolicLink())continue;let p=_t(u)??t;je(p,u,c,r,n,i)}W(a,{version:1,lastSweepAt:new Date(n).toISOString()},{spacing:2,trailingNewline:!0})}finally{l.release()}}function dr(t,e,r){let n=ce(t,r.dbPath,e);if(n)return{state:"bypassed",reason:n,localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=O(t);if(!i)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let s=h(R(),"repositories",i.repositoryId),a=U(h(s,"worktrees",`${i.worktreeId}.json`)),o=De(h(s,"gc-state.json")),l=Oe(t,s,i.repositoryId,o?.unreferencedSince??{}),c=Ge(l.leases,l.locks),u=l.generations.filter(f=>!c.has(f.generationId)),d=l.generations.reduce((f,g)=>f+g.size,0),p=le(t,e),m=0;return p&&(m=Lt(p)),{state:"managed",repositoryId:i.repositoryId,worktreeId:i.worktreeId,localCacheDir:r.cacheDir,...a?{baseGenerationId:a.baseGenerationId,activeGenerationId:a.activeGenerationId,lastAction:a.lastAction,reason:a.lastReason,lastSeenAt:a.lastSeenAt}:{},generations:l.generations.length,generationBytes:d,protectedGenerations:l.generations.filter(f=>c.has(f.generationId)).length,unreferencedGenerations:u.length,unreferencedBytes:u.reduce((f,g)=>f+g.size,0),temporaryGenerations:l.temporaries.length,sharedEvidence:{path:p,exists:m>0,bytes:m},cleanup:o?.lastResult}}function Lt(t){return[t,`${t}-wal`,`${t}-shm`].reduce((e,r)=>{try{return e+_e(r).size}catch{return e}},0)}function Oe(t,e,r,n){let i=new Set(re(t).map(c=>A(c.path))),s=[];for(let c of x(h(e,"worktrees"))){if(!c.endsWith(".json"))continue;let u=h(e,"worktrees",c),d=U(u);if(!d)continue;let p=A(d.projectRoot);s.push({leasePath:u,lease:d,managed:d.repositoryId===r&&Q(d),live:i.has(p)||E(p),busy:$(d)})}let a=[];for(let c of x(h(e,"locks"))){let u=/^([a-f0-9]{64})\.lock$/.exec(c);if(!u)continue;let d=h(e,"locks",c),p=q(d),m=p!==void 0&&w(p),f=u[1];a.push({generationId:f,path:d,live:m})}let o=[],l=[];for(let c of x(h(e,"generations"))){let u=/^\.tmp-(\d+)-/.exec(c);if(u){let m=h(e,"generations",c),f=Number(u[1]);try{l.push({path:m,size:Le(m),live:Number.isSafeInteger(f)&&w(f)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(c))continue;let d=h(e,"generations",c),p;try{p=b(d)}catch{continue}!p.isDirectory()||p.isSymbolicLink()||o.push({generationId:c,path:d,size:Le(d),...n[c]===void 0?{}:{unreferencedAt:n[c]}})}return{leases:s,generations:o,locks:a,temporaries:l}}function Q(t){if(t.ownershipChecksum!==de(t)||P(t.localCacheDir)!==P(X(t.projectRoot)))return!1;let e=P(h(R(),"projects"));return P(t.localCacheDir).startsWith(`${e}${We}`)}function At(t){if(!Q(t))return!1;let e=A(R()),r=A(h(e,"projects")),n=A(t.localCacheDir);try{let i=b(e),s=b(r),a=b(n);if(!i.isDirectory()||i.isSymbolicLink()||!s.isDirectory()||s.isSymbolicLink()||!a.isDirectory()||a.isSymbolicLink())return!1;let o=ke(r);return ke(n).startsWith(`${o}${We}`)}catch{return!1}}function _t(t){for(let e of x(h(t,"worktrees"))){if(!e.endsWith(".json"))continue;let r=U(h(t,"worktrees",e));if(r)return r.projectRoot}}function $(t,e=!1){for(let n of e?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let i=q(h(t.localCacheDir,n));if(i!==void 0&&w(i))return!0}let r=q(D(t.localCacheDir).lockPath);return r!==void 0&&w(r)}function U(t){try{let e=JSON.parse(C(t,"worktree cache lease"));return e.version!==1||typeof e.repositoryId!="string"||typeof e.worktreeId!="string"||typeof e.projectRoot!="string"||e.treeOid!==void 0&&typeof e.treeOid!="string"||typeof e.localCacheDir!="string"||e.baseGenerationId!==void 0&&typeof e.baseGenerationId!="string"||e.activeGenerationId!==void 0&&typeof e.activeGenerationId!="string"||typeof e.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(e.ownershipChecksum)||typeof e.lastAction!="string"||e.lastReason!==void 0&&typeof e.lastReason!="string"||typeof e.lastSeenAt!="string"?null:e}catch{return null}}function q(t){try{let e=JSON.parse(C(t,"watch lock record"));return typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0?e.pid:void 0}catch{return}}function De(t){try{let e=JSON.parse(C(t,"repository cache GC state"));return e.version!==1||typeof e.lastSweepAt!="string"||!Number.isFinite(Date.parse(e.lastSweepAt))||!e.unreferencedSince||typeof e.unreferencedSince!="object"||!e.lastResult?null:e}catch{return null}}function Ne(t){try{let e=JSON.parse(C(t,"global repository cache GC state"));if(e.version!==1||typeof e.lastSweepAt!="string")return;let r=Date.parse(e.lastSweepAt);return Number.isFinite(r)?r:void 0}catch{return}}function x(t){try{return Ae(t)}catch{return[]}}function Le(t){let e=0,r=[t];for(;r.length>0;){let n=r.pop();for(let i of Ae(n,{withFileTypes:!0})){let s=h(n,i.name);i.isDirectory()?r.push(s):i.isFile()&&(e+=_e(s).size)}}return e}import{createHash as Me}from"crypto";import{tmpdir as Wt,userInfo as Gt}from"os";import{join as Fe}from"path";var S=1,mr=1*1024*1024,yr=64*1024*1024,Rr=12e4,vr=["NO_COLOR","FORCE_COLOR","CLICOLOR","CLICOLOR_FORCE","TERM","CODEBASEIQ_DEBUG"];function br(t){let e=$e(),r=Me("sha256").update(`${e}\0${t}`).digest("hex");return process.platform==="win32"?`\\\\.\\pipe\\codebaseiq-lane-${r.slice(0,32)}`:Fe(jt(),`lane-${r.slice(0,24)}.sock`)}function jt(){let t=$e(),e=Me("sha256").update(t).digest("hex").slice(0,16);return Fe(Wt(),`codebaseiq-${e}`)}function $e(){try{return Gt().username}catch{return`uid-${typeof process.getuid=="function"?process.getuid():"unknown"}`}}function Sr(t,e){let r=Buffer.from(JSON.stringify(t),"utf8");if(r.byteLength>e)throw new Error(`query-lane frame of ${r.byteLength} bytes exceeds the ${e}-byte limit`);let n=Buffer.allocUnsafe(4+r.byteLength);return n.writeUInt32LE(r.byteLength,0),r.copy(n,4),n}function Cr(t,e,r){let n=Buffer.alloc(0),i=!1,s=a=>{i||(i=!0,r(new Error(a)))};return{push(a){if(!i)for(n=n.byteLength===0?a:Buffer.concat([n,a]);n.byteLength>=4;){let o=n.readUInt32LE(0);if(o>t){s(`query-lane frame of ${o} bytes exceeds the ${t}-byte limit`);return}if(n.byteLength<4+o)return;let l=n.subarray(4,4+o);n=n.subarray(4+o);let c;try{c=JSON.parse(l.toString("utf8"))}catch{s("query-lane frame carried invalid JSON");return}if(e(c),i)return}}}}function wr(t){if(!t||typeof t!="object")return null;let e=t;return e.protocolVersion!==S||typeof e.projectRoot!="string"||e.projectRoot.length===0?null:e.kind==="ping"?{protocolVersion:S,kind:"ping",projectRoot:e.projectRoot}:e.kind!=="execute"||!Array.isArray(e.argv)||!e.argv.every(r=>typeof r=="string")||typeof e.cwd!="string"||e.deadlineMs!==void 0&&!Number.isFinite(e.deadlineMs)||e.envAllowlist!==void 0&&(typeof e.envAllowlist!="object"||e.envAllowlist===null||Array.isArray(e.envAllowlist)||!Object.values(e.envAllowlist).every(r=>typeof r=="string"))||e.tty!==void 0&&(typeof e.tty!="object"||e.tty===null||typeof e.tty.isTTY!="boolean"||e.tty.columns!==void 0&&!Number.isFinite(e.tty.columns))||e.clientInvocation!==void 0&&(typeof e.clientInvocation!="object"||e.clientInvocation===null||typeof e.clientInvocation.execPath!="string"||e.clientInvocation.execPath.length===0||e.clientInvocation.scriptPath!==void 0&&typeof e.clientInvocation.scriptPath!="string")?null:{...e,kind:"execute"}}function xr(t){if(!t||typeof t!="object")return null;let e=t;if(e.protocolVersion!==S)return null;if(e.ok===!1)return e.code!=="unsupported"&&e.code!=="invalid-request"&&e.code!=="wrong-project"&&e.code!=="busy"&&e.code!=="stale-index"&&e.code!=="ineligible-command"&&e.code!=="execution-error"||typeof e.message!="string"?null:{ok:!1,protocolVersion:S,code:e.code,message:e.message};if(e.ok!==!0)return null;if(e.kind==="accepted"){let n=e.serverPid;return typeof n!="number"||!Number.isInteger(n)||n<=0?null:{ok:!0,kind:"accepted",protocolVersion:S,serverPid:n}}if(e.kind==="executed"){let n=e;return typeof n.serverPid!="number"||!Number.isInteger(n.serverPid)||n.serverPid<=0||typeof n.exitCode!="number"||!Number.isInteger(n.exitCode)||typeof n.stdout!="string"||typeof n.stderr!="string"||typeof n.generation!="string"||!/^[a-f0-9]{64}$/.test(n.generation)||typeof n.durationMs!="number"||!Number.isFinite(n.durationMs)?null:{ok:!0,kind:"executed",protocolVersion:S,serverPid:n.serverPid,exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr,generation:n.generation,durationMs:n.durationMs}}if(e.kind!=="pong"||typeof e.serverPid!="number"||!Number.isInteger(e.serverPid)||e.serverPid<=0||typeof e.cliVersion!="string"||typeof e.projectRoot!="string"||e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration))return null;let r;if(e.processIdentity!==void 0){let n=Z(e.processIdentity);if(!n||n.pid!==e.serverPid)return null;r=n}return{ok:!0,kind:"pong",protocolVersion:S,serverPid:e.serverPid,...r?{processIdentity:r}:{},cliVersion:e.cliVersion,projectRoot:e.projectRoot,...e.indexGeneration!==void 0?{indexGeneration:e.indexGeneration}:{}}}var qe=[{question:"Who can call or reach this?",family:"execution",direction:"incoming"},{question:"What can this call or reach?",family:"execution",direction:"outgoing"},{question:"Where can this value come from?",family:"dataflow",direction:"incoming"},{question:"Where can this value go?",family:"dataflow",direction:"outgoing"},{question:"Which producer and consumer rendezvous?",family:"runtime",direction:"both"},{question:"What resource is observed or changed?",family:"state",direction:"both"},{question:"What occurs before or after this?",family:"temporal",direction:"both"},{question:"What interface constrains this?",family:"contract",direction:"both"},{question:"Are these observations the same entity?",family:"identity",direction:"both"},{question:"What contains or owns this?",family:"ownership",direction:"both"},{question:"What does this statically rely on?",family:"dependencies",direction:"outgoing"}],Be={execution:{establishes:"Static may-call reachability between resolved program constructs.",nonClaims:["A may-call edge does not prove that a runtime invocation occurred."]},runtime:{establishes:"A source-grounded handoff between producer and consumer participants through a runtime mechanism.",nonClaims:["An unresolved or candidate join does not prove a runtime handoff."]},dataflow:{establishes:"A value, definition, argument, parameter, return, or statically resolved value may flow to another construct.",nonClaims:["Current partial providers do not establish general interprocedural definition-use coverage."]},state:{establishes:"A construct reads, writes, creates, deletes, or otherwise changes an identified state resource.",nonClaims:["A state edge does not prove transactionality, durability, or exclusive ownership unless qualified."]},temporal:{establishes:"One observed construct is locally ordered before or after another under the reported source evidence.",nonClaims:["Source order does not imply cross-process happens-before or durability."]},contract:{establishes:"A program construct implements, constrains, or is typed by an identified contract.",nonClaims:["Contract identity does not prove runtime invocation or conformance outside reported checks."]},identity:{establishes:"Two observations refer to the same compiler-owned or source-owned program entity.",nonClaims:["Shared identity does not establish execution or value transfer."]},ownership:{establishes:"A source construct, symbol, runtime observation, or state resource is contained or owned by another program entity.",nonClaims:["Structural ownership does not establish lifetime, singleton scope, or runtime execution unless qualified."]},dependencies:{establishes:"A file, module, or symbol statically relies on another indexed entity.",nonClaims:["A dependency edge does not establish that the depended-on code executes."]}};function Qe(t){return M.flatMap(e=>e.relations.filter(r=>r.family===t).map(r=>({...r,providerId:e.id,providerLabel:e.label})))}function Ue(t){return[...new Set(M.filter(e=>e.relations.some(r=>r.family===t)).map(e=>e.label))]}var Tr=me.map(t=>({family:t,...Be[t],providers:Ue(t),relations:Qe(t)}));function Ve(t){return{family:t,...Be[t],providers:Ue(t),relations:Qe(t)}}var Ar=["search","outline","entrypoints","evidence","inspect","code"];function _r(){return qe.map(t=>{let e=Ve(t.family);return{...t,establishes:e.establishes,evidenceStrengths:Ye(e.relations.flatMap(r=>r.evidenceStrengths)),supportCeilings:Ye(e.relations.map(r=>r.supportCeiling)),nonClaim:e.nonClaims.join(" ")}})}function Ye(t){return[...new Set(t)]}export{Re as a,lr as b,dr as c,S as d,mr as e,yr as f,Rr as g,vr as h,br as i,Sr as j,Cr as k,wr as l,xr as m,Tr as n,Ar as o,_r as p};
|
|
3
|
-
//# sourceMappingURL=chunk-ZMA5HWXY.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{$ as b,_ as a,aa as c,ba as d,ca as e,da as f,ea as g,fa as h,ga as i,ha as j,ia as k,ja as l,ka as m,la as n,ma as o,na as p}from"./chunk-7UCDGXRW.js";import"./chunk-5T44HG5Y.js";import"./chunk-DUKHVPU5.js";export{b as activateCliProjectContext,n as collect,c as currentCliDatabase,o as formatBytes,p as formatStatus,i as openDb,j as openProjectDb,f as prepareWorktreeIndex,h as residentQueryLaneEligible,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,k as rootIndexFallbackWarning,l as setResidentDatabaseProvider,g as sharedCachePreparationEligible,m as withDb};
|
|
3
|
-
//# sourceMappingURL=cli-context-FJL2JHOE.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{da as a,ea as b,fa as c,ga as d,ha as e,ia as f,ja as g,ka as h,la as i,ma as j,na as k,oa as l,pa as m,qa as n,ra as o,sa as p}from"./chunk-MEUHIDI3.js";import"./chunk-T75DS2E6.js";import"./chunk-RCIGX23V.js";import"./chunk-D7DOB27N.js";import"./chunk-R2NOK63J.js";import"./chunk-6O3KXIDL.js";import"./chunk-UQYQBLJX.js";export{b as activateCliProjectContext,n as collect,c as currentCliDatabase,o as formatBytes,p as formatStatus,i as openDb,j as openProjectDb,f as prepareWorktreeIndex,h as residentQueryLaneEligible,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,k as rootIndexFallbackWarning,l as setResidentDatabaseProvider,g as sharedCachePreparationEligible,m as withDb};
|
|
2
|
-
//# sourceMappingURL=cli-context-PQNWHMCQ.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{c as K}from"./chunk-KUKWHP4R.js";import{c as Q}from"./chunk-B3UYV66Z.js";import{a as J}from"./chunk-KUKKLWJD.js";import{a as h}from"./chunk-R4OJGTMP.js";import"./chunk-362QOSFD.js";import{c as F,d as H,e as q,f as W,g as B,h as G}from"./chunk-CLPCFGRT.js";import{j as _,l as V,n as U}from"./chunk-6FXXYYQM.js";import{p as L,q as z}from"./chunk-BIADXGC3.js";import"./chunk-OWJWOEDU.js";import"./chunk-B2OB55RR.js";import{a as v,b as I}from"./chunk-XZEE23VG.js";import{$ as p,N as A,O as R,_ as j,ba as $,ea as k,ka as T}from"./chunk-7UCDGXRW.js";import{e as M}from"./chunk-EOKVZXNF.js";import"./chunk-D62CTZX6.js";import{aa as P,ba as O,ca as N,da as S,ea as D,l as s}from"./chunk-5T44HG5Y.js";import{d as E,r as x}from"./chunk-DUKHVPU5.js";import{Command as Pe,Help as Oe}from"commander";import{Option as se}from"commander";function y(e){return e.evidence?e.evidence:ae.has(e.id)?"mixed":e.heuristic?"heuristic":"graph-fact"}var ae=new Set(["health","context","co-change"]);function X(e){if(e.claims){if(e.claims.origin==="mixed"&&!e.claims.families?.length)throw new Error(`Mixed command ${e.id} must declare at least one claim family.`);return e.claims}let t=y(e);if(t==="mixed")throw new Error(`Mixed command ${e.id} must declare claim families.`);let n=e.agent?H(e.agent.operation):[];return n.length>0&&n.every(o=>o==="repository-observation"||o==="repository-preview")?{origin:t==="heuristic"?"heuristic":"compiler-graph",observedSources:["index-generation"],producerValidation:{status:"not-evaluated"}}:{origin:"unknown",observedSources:["process"],producerValidation:{status:"not-evaluated"}}}var Y;function Z(){return Y||{argv:process.argv.slice(2),execPath:process.execPath,...process.argv[1]!==void 0?{scriptPath:process.argv[1]}:{},cwd:process.cwd()}}function ee(e,t){return W(new Map(t.map(n=>[n.id,y(n)]))),G(new Map(t.map(n=>[n.id,X(n)]))),B(new Map(t.flatMap(n=>n.agent?[[n.id,{...n.agent,resultUnits:me(n)}]]:[]))),t.map(n=>{let i=n.hidden?e.command(n.command,{hidden:!0}):e.command(n.command);i.description(n.description),n.helpAfter&&i.addHelpText("after",`
|
|
3
|
-
${n.helpAfter.trim()}
|
|
4
|
-
`);for(let o of n.arguments??[])i.argument(o.name);for(let o of n.options??[])if(o.hidden){let r=new se(o.flags,o.description).hideHelp();o.parser&&r.argParser(o.parser),Object.hasOwn(o,"defaultValue")&&r.default(o.defaultValue),i.addOption(r)}else o.parser&&Object.hasOwn(o,"defaultValue")?i.option(o.flags,o.description,o.parser,o.defaultValue):o.parser?i.option(o.flags,o.description,o.parser):Object.hasOwn(o,"defaultValue")?i.option(o.flags,o.description,o.defaultValue):i.option(o.flags,o.description);return i.action(async(...o)=>{try{let r=i.optsWithGlobals();ce(r);let a=Z(),d=()=>n.id===_?n.handler(...o):V({command:n.id,producerVersion:s,invocationPrefix:a.scriptPath?[a.execPath,a.scriptPath]:["codebaseiq"],argv:[...a.argv],cwd:a.cwd,json:r.json===!0,sourceSession:r.session!==!1,reemitSource:r.reemit===!0,...typeof r.outputPageSize=="number"?{pageSize:r.outputPageSize}:{},...typeof r.outputCursor=="string"?{cursor:r.outputCursor}:{}},()=>n.handler(...o)),c=n.agent?F(n.agent.operation,{args:o.slice(0,-1),options:r}):void 0;await(c?q(c,d):d())}catch(r){de(r)}finally{p(void 0),R()}}),{descriptor:n,command:i}})}function ce(e){if(e.resultOnly===!0&&e.json!==!0)throw new Error("--result-only requires --json.");if(e.compact===!0&&e.json!==!0)throw new Error("--compact requires --json.")}function me(e){let t=e.agent?.resultUnits;if(t?.kind==="field"&&t.field.trim()==="")throw new Error(`Command ${e.id} declares an empty result-unit field.`);return t||(e.renderShape==="list"||e.renderShape==="table"||e.renderShape==="grouped-by-file"?{kind:"rows"}:{kind:"report"})}function de(e){let t=e instanceof Error?e.message:String(e);console.error(`error: ${I(t)}`),process.exitCode=1}import{existsSync as le,mkdirSync as pe,writeFileSync as ue}from"fs";import{homedir as fe}from"os";import{join as g}from"path";var he=1440*60*1e3,ne="update-check.json",ge="https://registry.npmjs.org/codebaseiq/latest";async function oe(e={}){let t=e.env??process.env;if(t.CODEBASEIQ_UPDATE_CHECK==="0"||t.NO_UPDATE_NOTIFIER)return;let n=e.cacheDir??ye(t),i=e.now??Date.now(),o=e.currentVersion??s,r=be(n),a=r&&i-r.checkedAt<he?r.latestVersion:await we(n,e.fetchLatestVersion??xe,i);if(!a||!ve(a,o))return;(e.writeNotice??(c=>console.error(c)))(Ce(o,a))}function Ce(e,t){return[`codebaseiq update available: ${e} -> ${t}.`,"Agent: tell your human to update with: npm install -g codebaseiq@latest",""].join(`
|
|
5
|
-
`)}function ve(e,t){let n=te(e),i=te(t);if(!n||!i)return e!==t;for(let o=0;o<n.length;o++){let r=n[o]-i[o];if(r>0)return!0;if(r<0)return!1}return!1}function ye(e){let t=e.XDG_CACHE_HOME||g(fe(),".cache");return g(t,"codebaseiq")}function be(e){let t=g(e,ne);if(!le(t))return null;try{let n=JSON.parse(x(t,"update notice cache"));return typeof n.checkedAt=="number"&&(typeof n.latestVersion=="string"||n.latestVersion===null)?{checkedAt:n.checkedAt,latestVersion:n.latestVersion}:null}catch{return null}}async function we(e,t,n){let i;try{i=await t()}catch{i=null}return Ee(e,{checkedAt:n,latestVersion:i}),i}function Ee(e,t){try{pe(e,{recursive:!0}),ue(g(e,ne),`${JSON.stringify(t,null,2)}
|
|
6
|
-
`)}catch{}}async function xe(){let e=await fetch(ge,{signal:AbortSignal.timeout(1e3)});if(!e.ok)return null;let t=await e.json();return typeof t.version=="string"?t.version:null}function te(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}async function ct(e={}){let t=new Pe;e.resident&&t.exitOverride(),e.terminalOutput&&t.configureOutput({writeOut:o=>process.stdout.write(v(o)),writeErr:o=>process.stderr.write(v(o))}),t.name("codebaseiq").description("Language-agnostic code intelligence CLI powered by SCIP indexes").version(s).option("--output-page-size <characters>","Return bounded output pages with an exact continuation command",U).option("--output-cursor <cursor>","Continue a bounded output page").option("--no-session","Disable the explicit exploration evidence ledger").option("--reemit","Recovery only: render source and graph evidence again instead of citing session receipts").option("--help-all","Display every command, including compatibility and deprecated controls");let n=await K(e.invocationCommand);ee(t,n);let i=new Oe;return t.configureHelp({formatHelp:(o,r)=>o===t?Q(t,n):i.formatHelp(o,r)}),t.hook("preAction",async(o,r)=>{let a=r.name();if(e.resident){await e.resident.preAction(a);return}let d=k(a),c=L(a);if(!d&&!c){ie(),await re(a);return}let m=j(),u=E(m);A(u);let C=$(m,u);p(C),ie(),await re(a);let{config:b,paths:w}=C;if(d){let l=await J({commandName:a,projectRoot:m,config:b,paths:w,dbPathSource:C.dbPathSource,gitContext:u});process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-freshness: ${l.source}`),l.service.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${l.service.message}`),(l.service.kind==="failed"||l.service.kind==="skipped")&&h(m,s);return}if(!c){h(m,s);return}let f=z({commandName:a,projectRoot:m,cacheDir:w.cacheDir,cliVersion:s,config:b,gitContext:u});f.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${f.message}`),(f.kind==="failed"||f.kind==="skipped")&&h(m,s)}),t.hook("postAction",()=>p(void 0)),{program:t,descriptors:n}}async function re(e){e.startsWith("__")||await oe({commandName:e})}function ie(){if(N(),!P()||S())return;let e=null;try{e=T(t=>M(t))}catch{}D({command:O()??`codebaseiq ${process.argv.slice(2).join(" ")}`,toolVersion:s,projectFingerprint:e})}export{ct as createCliProgram};
|
|
7
|
-
//# sourceMappingURL=cli-program-SCHOHOQE.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{z as a}from"./chunk-OBC7HSSO.js";import"./chunk-CLPCFGRT.js";import"./chunk-6FXXYYQM.js";import"./chunk-OWJWOEDU.js";import"./chunk-B2OB55RR.js";import"./chunk-XZEE23VG.js";import"./chunk-7UCDGXRW.js";import"./chunk-EOKVZXNF.js";import"./chunk-D62CTZX6.js";import"./chunk-5T44HG5Y.js";import"./chunk-DUKHVPU5.js";export{a as directNavigationQueryCommandDescriptors};
|
|
3
|
-
//# sourceMappingURL=direct-navigation-3JOYP2MO.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{z as a}from"./chunk-WO6OFKUC.js";import"./chunk-XUPFA6GH.js";import"./chunk-YPBKBYPS.js";import"./chunk-JNXI6NQ7.js";import"./chunk-ZZ3MWF33.js";import"./chunk-K4S2VH42.js";import"./chunk-YUKYB54I.js";import"./chunk-JAFDMV5I.js";import"./chunk-P5XHIJHI.js";import"./chunk-EQNMD62X.js";import"./chunk-LSZYMN2A.js";import"./chunk-JYRJYXUV.js";import"./chunk-CIYA2KZN.js";import"./chunk-C6WKPKCF.js";import"./chunk-XQAVQVIL.js";import"./chunk-DRENNWRG.js";import"./chunk-SV2LEFVM.js";import"./chunk-MEUHIDI3.js";import"./chunk-5FWR5HLG.js";import"./chunk-T75DS2E6.js";import"./chunk-YT4DVWUV.js";import"./chunk-RCIGX23V.js";import"./chunk-D7DOB27N.js";import"./chunk-R2NOK63J.js";import"./chunk-6O3KXIDL.js";import"./chunk-UQYQBLJX.js";export{a as directNavigationQueryCommandDescriptors};
|
|
2
|
-
//# sourceMappingURL=direct-navigation-SJMJLBY7.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-HNXRVGMY.js";import"./chunk-YPBKBYPS.js";import"./chunk-JNXI6NQ7.js";import"./chunk-ZZ3MWF33.js";import"./chunk-K4S2VH42.js";import"./chunk-YUKYB54I.js";import"./chunk-JAFDMV5I.js";import"./chunk-P5XHIJHI.js";import"./chunk-EQNMD62X.js";import"./chunk-LSZYMN2A.js";import"./chunk-JYRJYXUV.js";import"./chunk-CIYA2KZN.js";import"./chunk-C6WKPKCF.js";import"./chunk-XQAVQVIL.js";import"./chunk-DRENNWRG.js";import"./chunk-SV2LEFVM.js";import"./chunk-MEUHIDI3.js";import"./chunk-5FWR5HLG.js";import"./chunk-T75DS2E6.js";import"./chunk-YT4DVWUV.js";import"./chunk-RCIGX23V.js";import"./chunk-D7DOB27N.js";import"./chunk-R2NOK63J.js";import"./chunk-6O3KXIDL.js";import"./chunk-UQYQBLJX.js";export{a as outputContinuationCommandDescriptor};
|
|
2
|
-
//# sourceMappingURL=output-continuation-command-5NWVDQT7.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a}from"./chunk-N2XDMNVI.js";import"./chunk-6FXXYYQM.js";import"./chunk-OWJWOEDU.js";import"./chunk-B2OB55RR.js";import"./chunk-XZEE23VG.js";import"./chunk-7UCDGXRW.js";import"./chunk-EOKVZXNF.js";import"./chunk-D62CTZX6.js";import"./chunk-5T44HG5Y.js";import"./chunk-DUKHVPU5.js";export{a as outputContinuationCommandDescriptor};
|
|
3
|
-
//# sourceMappingURL=output-continuation-command-RNEHNYPU.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{k as a}from"./chunk-MC46AL7B.js";import"./chunk-EN4AHLL3.js";import"./chunk-EOKVZXNF.js";import"./chunk-D62CTZX6.js";import"./chunk-5T44HG5Y.js";import"./chunk-DUKHVPU5.js";export{a as reindexConfiguredProject};
|
|
3
|
-
//# sourceMappingURL=project-reindex-MIW5CYEG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-OQ3DK7FW.js";import"./chunk-O2KWU34K.js";import"./chunk-YTJHCGYB.js";import"./chunk-ILMHV3KM.js";import"./chunk-O2M3VNDY.js";import"./chunk-K4S2VH42.js";import"./chunk-YUKYB54I.js";import"./chunk-EQNMD62X.js";import"./chunk-JYRJYXUV.js";import"./chunk-4LK5OIPW.js";import"./chunk-C6WKPKCF.js";import"./chunk-XQAVQVIL.js";import"./chunk-DRENNWRG.js";import"./chunk-5FWR5HLG.js";import"./chunk-T75DS2E6.js";import"./chunk-YT4DVWUV.js";import"./chunk-RCIGX23V.js";import"./chunk-D7DOB27N.js";import"./chunk-R2NOK63J.js";import"./chunk-6O3KXIDL.js";import"./chunk-UQYQBLJX.js";export{a as reindexConfiguredProject};
|
|
2
|
-
//# sourceMappingURL=project-reindex-VQ23LWDA.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-OP6BUIV6.js";import"./chunk-V4NGDIEA.js";import"./chunk-JNXI6NQ7.js";import"./chunk-ZZ3MWF33.js";import"./chunk-K4S2VH42.js";import"./chunk-YUKYB54I.js";import"./chunk-JAFDMV5I.js";import"./chunk-P5XHIJHI.js";import"./chunk-EQNMD62X.js";import"./chunk-LSZYMN2A.js";import"./chunk-JYRJYXUV.js";import"./chunk-CIYA2KZN.js";import"./chunk-C6WKPKCF.js";import"./chunk-XQAVQVIL.js";import"./chunk-DRENNWRG.js";import"./chunk-PUVNH4PO.js";import"./chunk-SV2LEFVM.js";import"./chunk-MEUHIDI3.js";import"./chunk-5FWR5HLG.js";import"./chunk-T75DS2E6.js";import"./chunk-YT4DVWUV.js";import"./chunk-RCIGX23V.js";import"./chunk-D7DOB27N.js";import"./chunk-R2NOK63J.js";import"./chunk-6O3KXIDL.js";import"./chunk-UQYQBLJX.js";export{a as ensureSentinelService,b as sentinelEnsureCommandDescriptor};
|
|
2
|
-
//# sourceMappingURL=sentinel-ensure-command-H66AZ3VE.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{d as a,e as b}from"./chunk-6EYESTJM.js";import"./chunk-BIADXGC3.js";import"./chunk-OWJWOEDU.js";import"./chunk-B2OB55RR.js";import"./chunk-XZEE23VG.js";import"./chunk-7UCDGXRW.js";import"./chunk-EOKVZXNF.js";import"./chunk-D62CTZX6.js";import"./chunk-5T44HG5Y.js";import"./chunk-DUKHVPU5.js";export{a as ensureSentinelService,b as sentinelEnsureCommandDescriptor};
|
|
3
|
-
//# sourceMappingURL=sentinel-ensure-command-R4YAUCJB.js.map
|