@maycombhq/atticus 2.0.0-beta.22 → 2.0.0-beta.24
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/dist/bin.js +12 -7
- package/dist/{chunk-J2JAKCIW.js → chunk-25CUJJTP.js} +511 -291
- package/dist/chunk-26AB2WNW.js +62 -0
- package/dist/{chunk-VBTP56CE.js → chunk-2ITYURTR.js} +9 -8
- package/dist/{chunk-6ZJ5A7AF.js → chunk-2JHE75RW.js} +13 -11
- package/dist/{chunk-QFWA2DPH.js → chunk-37UTWGU4.js} +8 -6
- package/dist/{chunk-VW62D6QE.js → chunk-3BEGKSDW.js} +14 -12
- package/dist/{chunk-3RM4UK6W.js → chunk-3FGQFDS4.js} +20 -18
- package/dist/{chunk-23XVSEV5.js → chunk-3NS4RS3C.js} +20 -18
- package/dist/{chunk-FSMSFDLD.js → chunk-3TGX4SJ3.js} +10 -7
- package/dist/{chunk-7JITZFJC.js → chunk-3UMKLB6P.js} +7 -5
- package/dist/chunk-3VS7RNEB.js +96 -0
- package/dist/{chunk-AJYXNTNZ.js → chunk-3XCCT2GR.js} +167 -42
- package/dist/{chunk-XERYFDB5.js → chunk-3XZRYQWU.js} +38 -34
- package/dist/{chunk-FUJM6RTF.js → chunk-432FGEVB.js} +9 -7
- package/dist/{chunk-SFUP7TTO.js → chunk-44QUCNPH.js} +7 -5
- package/dist/{chunk-O5PXQR67.js → chunk-4CS3PMIM.js} +15 -13
- package/dist/{chunk-RGERPOIV.js → chunk-4DCIUKIE.js} +22 -12
- package/dist/{chunk-RLDGWLQ7.js → chunk-4DX4DIND.js} +9 -7
- package/dist/chunk-4MNMOUU7.js +108 -0
- package/dist/{chunk-SLXZOMA6.js → chunk-4RKIOUPA.js} +9 -7
- package/dist/{chunk-AJQ72EBM.js → chunk-532HDXMM.js} +9 -7
- package/dist/{chunk-CADWLE2T.js → chunk-5EIKOU7L.js} +6 -4
- package/dist/{chunk-CQDGOPGH.js → chunk-5FPAKAGE.js} +7 -5
- package/dist/{chunk-IVBOQAGB.js → chunk-5FUFVNXB.js} +27 -3
- package/dist/{chunk-UUU4CLJG.js → chunk-5MKV4TV6.js} +5 -1
- package/dist/{chunk-ZQXZ2SES.js → chunk-5ORLKITZ.js} +23 -21
- package/dist/{chunk-OHVTTOPS.js → chunk-5PSKLTBR.js} +3 -3
- package/dist/{chunk-RUGXBPWI.js → chunk-5QF5W5P2.js} +10 -10
- package/dist/{chunk-BPK5P77O.js → chunk-5Z7L2TSR.js} +3 -3
- package/dist/{chunk-L27SV425.js → chunk-66DWUSNY.js} +22 -20
- package/dist/{chunk-JAVI7JSP.js → chunk-6FIYEB7M.js} +25 -22
- package/dist/{chunk-VY72R2XZ.js → chunk-6OZAQPU5.js} +532 -358
- package/dist/{chunk-AFWUDXEM.js → chunk-6TNQO76I.js} +34 -17
- package/dist/{chunk-WF7B67YE.js → chunk-6UTD5RQH.js} +18 -16
- package/dist/{chunk-HNM2YQT2.js → chunk-775FMPUB.js} +7 -7
- package/dist/{chunk-7ASNL4Q4.js → chunk-77AZRGWE.js} +19 -16
- package/dist/{chunk-WKUJ3KPV.js → chunk-7HWCEDPX.js} +7 -5
- package/dist/{chunk-G6X77UJZ.js → chunk-7U46TCRZ.js} +25 -22
- package/dist/{chunk-O45HFTFS.js → chunk-A3NUZJFI.js} +4 -2
- package/dist/{chunk-UPOY4YSQ.js → chunk-A4VDFIMR.js} +14 -12
- package/dist/{chunk-EMRIQUND.js → chunk-A53IYUCR.js} +87 -29
- package/dist/{chunk-S4PMJU6H.js → chunk-A6ZG3UOS.js} +108 -50
- package/dist/{chunk-PMUAJGLI.js → chunk-AAY6VPPO.js} +18 -16
- package/dist/{chunk-MG4ZL5RW.js → chunk-ABDE5IRC.js} +18 -16
- package/dist/{chunk-T6DQR5TV.js → chunk-AM7PYKVP.js} +15 -13
- package/dist/{chunk-SFSPGFCV.js → chunk-ANUMIPF6.js} +22 -20
- package/dist/{chunk-VTZMAJ3W.js → chunk-ASFRT33J.js} +11 -9
- package/dist/{chunk-7FTTA3HD.js → chunk-AWDCVZYO.js} +9 -7
- package/dist/{chunk-KFAVQZSX.js → chunk-B63NWU3P.js} +14 -12
- package/dist/{chunk-YYY3AZFE.js → chunk-BBZ6UKN3.js} +16 -5
- package/dist/{chunk-Q4K5WB2W.js → chunk-BFQ5IKQA.js} +12 -10
- package/dist/{chunk-ZFL7NY4F.js → chunk-BLVFHN3C.js} +73 -42
- package/dist/{chunk-MO6P2JZH.js → chunk-BQXAHIZ6.js} +10 -8
- package/dist/{chunk-Y2EQNWKV.js → chunk-BTS56NV7.js} +91 -41
- package/dist/{chunk-UGUP3ZM6.js → chunk-BWYW533C.js} +18 -16
- package/dist/{chunk-O7FDLW7L.js → chunk-BYKWWSXL.js} +14 -12
- package/dist/chunk-C7BB6IQT.js +147 -0
- package/dist/{chunk-JLUCKAEL.js → chunk-CCQWQFOT.js} +19 -17
- package/dist/{chunk-SYV5LHML.js → chunk-CCQZN6W3.js} +35 -33
- package/dist/{chunk-UCROWG2D.js → chunk-CFSBBLDD.js} +28 -25
- package/dist/{chunk-EIPTLPFC.js → chunk-CFSHLQPK.js} +26 -24
- package/dist/{chunk-2IIMFOPM.js → chunk-CI4D6VSU.js} +20 -18
- package/dist/{chunk-66PPNOON.js → chunk-CKRPMRFQ.js} +28 -25
- package/dist/{chunk-IUPG3UKI.js → chunk-CNF2EZ6S.js} +191 -125
- package/dist/chunk-CTJHEG6A.js +97 -0
- package/dist/{chunk-DOBQKHIF.js → chunk-CU7ZK7KP.js} +30 -29
- package/dist/{chunk-745DAZ4L.js → chunk-CZ75S2EZ.js} +886 -313
- package/dist/{chunk-LGFL54FP.js → chunk-D5CJEKZI.js} +11 -4
- package/dist/{chunk-PBPBMP2B.js → chunk-D5ZC7IMC.js} +5 -3
- package/dist/{chunk-LZ7NUC62.js → chunk-D63NU53X.js} +20 -18
- package/dist/{chunk-BO4KX37X.js → chunk-DCQSPSXU.js} +28 -23
- package/dist/{chunk-WXFLMQSR.js → chunk-DCRZ3OQ7.js} +8 -6
- package/dist/chunk-DD2AXECF.js +41 -0
- package/dist/{chunk-4EURQWQD.js → chunk-DF6DPCW2.js} +16 -14
- package/dist/{chunk-53T4O55J.js → chunk-DH3EQMIA.js} +5 -3
- package/dist/{chunk-ZX57KSEQ.js → chunk-DIXA74N7.js} +5 -3
- package/dist/{chunk-6ZGLAACW.js → chunk-DIYNRYXW.js} +2 -2
- package/dist/chunk-DYDNW4O6.js +52 -0
- package/dist/{chunk-P2V7QW4D.js → chunk-E7YDJH6B.js} +16 -14
- package/dist/chunk-EEKQI3U4.js +45 -0
- package/dist/{chunk-GZY6RUZ6.js → chunk-EHF2MBGR.js} +9 -4
- package/dist/chunk-EHXDB3SA.js +25 -0
- package/dist/{chunk-PJSJPMJI.js → chunk-ENZ3PI7L.js} +3 -3
- package/dist/{chunk-E3ISYXO3.js → chunk-EPQQ2XVM.js} +16 -14
- package/dist/{chunk-7IGKHZ4Z.js → chunk-ESJALLOK.js} +222 -213
- package/dist/chunk-ETQSQ2EC.js +33 -0
- package/dist/{chunk-MFR5OPBD.js → chunk-EUMXLSW5.js} +14 -6
- package/dist/{chunk-BTY3HZBO.js → chunk-F63F4NKT.js} +18 -16
- package/dist/{chunk-ZFFYNRIO.js → chunk-FDL2JOLB.js} +26 -22
- package/dist/{chunk-5SJZW52K.js → chunk-FFDVAV56.js} +24 -22
- package/dist/chunk-FFYOZ7PF.js +27 -0
- package/dist/{chunk-RXPJMEOW.js → chunk-FGW5TLGM.js} +24 -19
- package/dist/{chunk-UPS2DGFC.js → chunk-FL53R4SW.js} +1 -1
- package/dist/chunk-FYWLB7PO.js +38 -0
- package/dist/{chunk-FFLNS6VP.js → chunk-G3W7GNEP.js} +24 -18
- package/dist/chunk-G3ZFEHCX.js +925 -0
- package/dist/{chunk-YHCMZC2J.js → chunk-G67GOK4S.js} +10 -8
- package/dist/{chunk-2F4CYZKJ.js → chunk-GCMDDVIE.js} +14 -9
- package/dist/{chunk-QKUJMING.js → chunk-GFYVVTKH.js} +10 -8
- package/dist/chunk-GJVCBTSO.js +20722 -0
- package/dist/{chunk-VCTWPLAO.js → chunk-GKZDHXC2.js} +8 -8
- package/dist/{chunk-5BD2KYLE.js → chunk-GQFUEUC7.js} +18 -16
- package/dist/chunk-GQPP4P2E.js +33 -0
- package/dist/{chunk-42SIDKEU.js → chunk-GS7N3RFG.js} +51 -32
- package/dist/{chunk-LJXMYKZJ.js → chunk-GXQYEIYM.js} +7 -5
- package/dist/{chunk-VNU26RCO.js → chunk-H5EQOSTC.js} +43 -33
- package/dist/{chunk-W7VWI2YH.js → chunk-H7KERB6Q.js} +7 -5
- package/dist/{chunk-OUBGGKDU.js → chunk-HGDBM3A5.js} +5 -3
- package/dist/{chunk-JENSEMXF.js → chunk-HI7ADE4E.js} +1 -1
- package/dist/{chunk-CXJ6FUKN.js → chunk-HNPKCRCE.js} +1010 -330
- package/dist/{chunk-FPJPLKDW.js → chunk-HRHXTLUM.js} +40 -16
- package/dist/{chunk-57TDNMI3.js → chunk-HRYI22QU.js} +17 -15
- package/dist/{chunk-LO6P2VYG.js → chunk-HWNFFCGB.js} +5 -3
- package/dist/{chunk-XI2LCCYQ.js → chunk-HXFZX2BI.js} +12 -8
- package/dist/{chunk-H7KM7LZE.js → chunk-HYHV2P3G.js} +16 -13
- package/dist/{chunk-X3WY6MN3.js → chunk-IB66ZLDN.js} +10 -8
- package/dist/{chunk-3NFFJL5D.js → chunk-IJQHBK76.js} +1 -1
- package/dist/{chunk-LQJPN536.js → chunk-IK6LHW3E.js} +6 -4
- package/dist/{chunk-DCZWQLYT.js → chunk-IOHRX4KF.js} +26 -21
- package/dist/{chunk-2GF7OLF3.js → chunk-IRXZKKCG.js} +21 -15
- package/dist/{chunk-Z5IA3WDR.js → chunk-IUBBEU6O.js} +160 -81
- package/dist/{chunk-W62H2XSO.js → chunk-IWPO5AUT.js} +29 -26
- package/dist/{chunk-BEVTIBRH.js → chunk-J4K4C4T5.js} +31 -15
- package/dist/{chunk-WERM6KPJ.js → chunk-JCEYOSST.js} +14 -6
- package/dist/{chunk-HYU5VLGA.js → chunk-JCG2EBNB.js} +1 -1
- package/dist/{chunk-UNAGJYET.js → chunk-JFBVIMGY.js} +14 -12
- package/dist/chunk-JJ4SCGRJ.js +43 -0
- package/dist/{chunk-2Q5EDGEO.js → chunk-JLYH2QOE.js} +7 -5
- package/dist/{chunk-X4CXA2IL.js → chunk-JMH6TCZJ.js} +23 -21
- package/dist/{chunk-6PPOWY5E.js → chunk-JUHZBZPZ.js} +17 -13
- package/dist/{chunk-GUX3PTYM.js → chunk-JVMNEI7B.js} +3 -3
- package/dist/chunk-JYJMIAFS.js +44 -0
- package/dist/{chunk-34S2WGOB.js → chunk-KIY2WCN7.js} +7 -3
- package/dist/chunk-KVVNAUIG.js +66 -0
- package/dist/{chunk-M32BLWDH.js → chunk-KYO5HT4G.js} +14 -12
- package/dist/chunk-L27KUL5B.js +38 -0
- package/dist/chunk-L3PIN47C.js +18 -0
- package/dist/{chunk-IH2XURVQ.js → chunk-L6Z6TMIK.js} +5 -5
- package/dist/{chunk-E6ZIEVOI.js → chunk-LAGZBQHK.js} +16 -13
- package/dist/chunk-LBG4GMOR.js +68 -0
- package/dist/{chunk-UF4GLFBX.js → chunk-LDKP7OWQ.js} +33 -24
- package/dist/{chunk-ZQ7SKESZ.js → chunk-LELM7X5H.js} +13 -11
- package/dist/{chunk-INQHESFB.js → chunk-LIB6AUZS.js} +6 -4
- package/dist/{chunk-H5HBGNXU.js → chunk-LIQWFDOZ.js} +6 -4
- package/dist/{chunk-TYQBFTBR.js → chunk-LKUTBQ2Y.js} +8 -6
- package/dist/{chunk-7BR7IPOH.js → chunk-LOCJHNZI.js} +10 -8
- package/dist/{chunk-SQV37XO2.js → chunk-LTIXFLYE.js} +6 -6
- package/dist/{chunk-3NWDLGG6.js → chunk-M3RWF7MC.js} +33 -29
- package/dist/chunk-MA6UK7GX.js +42 -0
- package/dist/{chunk-ISUAAMGS.js → chunk-MCE74XMF.js} +25 -16
- package/dist/{chunk-EGQRREQH.js → chunk-MDTAZ6NE.js} +37 -24
- package/dist/{chunk-ZZK56BLP.js → chunk-MMOMKHAX.js} +6 -4
- package/dist/{chunk-P32RUW3B.js → chunk-MOWUP33K.js} +49 -15
- package/dist/{chunk-UOR2DTHH.js → chunk-MPATOMY5.js} +18 -14
- package/dist/{chunk-LNBQOP7D.js → chunk-MQFSEGTU.js} +23 -21
- package/dist/{chunk-2Q56PQPS.js → chunk-MT3FNSXO.js} +4 -4
- package/dist/{chunk-FZOJFH7Q.js → chunk-MUY5MAGM.js} +15 -12
- package/dist/{chunk-7DOR27HL.js → chunk-MVXMISNA.js} +9 -7
- package/dist/{chunk-CX4RZ2KS.js → chunk-MWN7CBVL.js} +5 -3
- package/dist/{chunk-BXYMYEJ4.js → chunk-MZWM73S2.js} +18 -17
- package/dist/chunk-NBZ7RKX3.js +46 -0
- package/dist/{chunk-EPCJQQWD.js → chunk-NC56V6KQ.js} +6 -4
- package/dist/{chunk-7UOMVMFG.js → chunk-NN6AXKFX.js} +17 -15
- package/dist/{chunk-BIGDQDHD.js → chunk-NOU5IBLM.js} +6 -4
- package/dist/{chunk-LFGTYX5U.js → chunk-NQDHRT2H.js} +20 -18
- package/dist/{chunk-KDNTAPLX.js → chunk-NTEPBOAF.js} +6 -4
- package/dist/{chunk-LYBNHMVZ.js → chunk-NTOPAOBY.js} +3 -3
- package/dist/{chunk-R44CYFPV.js → chunk-NX5IPHI3.js} +19 -16
- package/dist/{chunk-GCWRWSU7.js → chunk-O4ZWZZZT.js} +6 -4
- package/dist/chunk-OCU5S2XG.js +36 -0
- package/dist/{chunk-SU74NDMQ.js → chunk-OKSRK2LJ.js} +19 -17
- package/dist/{chunk-XD75VZIH.js → chunk-OSWOIFRQ.js} +9 -7
- package/dist/{chunk-PKBHS4AA.js → chunk-OSZTENIA.js} +54 -21
- package/dist/{chunk-NDCF4R6S.js → chunk-OTUBMKSG.js} +10 -8
- package/dist/{chunk-THDMSZ3R.js → chunk-OYKNPZCV.js} +2837 -693
- package/dist/{chunk-ZQ3ON2VQ.js → chunk-OYTSRNSZ.js} +8 -6
- package/dist/chunk-OYZ64UMQ.js +67 -0
- package/dist/{chunk-UF4AZOZB.js → chunk-PB3NCPRF.js} +10 -8
- package/dist/chunk-PIPJZIJE.js +47 -0
- package/dist/{chunk-2RLKFUUL.js → chunk-PIPYJTIL.js} +27 -24
- package/dist/{chunk-MZCGSXVR.js → chunk-PUMNCWHJ.js} +15 -13
- package/dist/{chunk-X5F3Q5LV.js → chunk-PZBNDFZ7.js} +35 -25
- package/dist/chunk-Q2ULHBCJ.js +59 -0
- package/dist/{chunk-ZJFRMSJT.js → chunk-Q5QSWV2R.js} +14 -12
- package/dist/{chunk-Q2TECDIT.js → chunk-QFDPX6C4.js} +2886 -20703
- package/dist/{chunk-WG5U3F5V.js → chunk-QGBS4GMS.js} +14 -12
- package/dist/{chunk-BTGPE6CR.js → chunk-QIDSEHJA.js} +17 -15
- package/dist/{chunk-Q6DFNVRJ.js → chunk-QJ3AYXVO.js} +14 -12
- package/dist/{chunk-EBL2R3YG.js → chunk-QK6CGRKK.js} +6 -4
- package/dist/{chunk-S7FCV7S5.js → chunk-QOC3Q4UU.js} +1 -1
- package/dist/{chunk-JJF6HALY.js → chunk-QPLNB2BM.js} +5 -3
- package/dist/chunk-QVF4KYIO.js +71 -0
- package/dist/{chunk-6OJQOPUN.js → chunk-QXXEO4TF.js} +5 -3
- package/dist/{chunk-F3P7N7SF.js → chunk-QYFNVQLK.js} +1 -1
- package/dist/{chunk-6MUGR4LS.js → chunk-R6CJOMPC.js} +106 -29
- package/dist/{chunk-BDKC6H5P.js → chunk-ROWZYQOI.js} +9 -7
- package/dist/{chunk-2MMCFP5C.js → chunk-RQAMZVWW.js} +10 -8
- package/dist/chunk-RQSUFGU2.js +55 -0
- package/dist/{chunk-SDKLKB6I.js → chunk-RRKM3GJA.js} +38 -28
- package/dist/{chunk-OHNCWBKF.js → chunk-RSHVSXPJ.js} +7 -5
- package/dist/chunk-RSKMV3VC.js +22 -0
- package/dist/{chunk-U76OWS3Q.js → chunk-RU5W7JJQ.js} +25 -23
- package/dist/{chunk-63YRMR6J.js → chunk-RYY554OA.js} +7 -5
- package/dist/{chunk-5NMKONLP.js → chunk-SGYQORAD.js} +7 -3
- package/dist/{chunk-JA5FI3QV.js → chunk-SLGUSFOD.js} +3 -3
- package/dist/{chunk-M3NANSDZ.js → chunk-SUAHNYNQ.js} +17 -15
- package/dist/{chunk-QAXW2N3B.js → chunk-SUYC5NP6.js} +34 -34
- package/dist/{chunk-FFTRTL6R.js → chunk-SWSGRRNO.js} +6 -4
- package/dist/{chunk-UWOJLHFT.js → chunk-SYLXQNPC.js} +38 -24
- package/dist/chunk-T24TBI7F.js +54 -0
- package/dist/chunk-T2HXLDY3.js +55 -0
- package/dist/{chunk-O4GXGGBX.js → chunk-T5NH5L7A.js} +16 -13
- package/dist/{chunk-KXITGYLF.js → chunk-TAR6T2RE.js} +4 -2
- package/dist/chunk-TBQHBOFF.js +324 -0
- package/dist/{chunk-LKOR5UET.js → chunk-TKE6ZJMM.js} +26 -24
- package/dist/chunk-TKEXS74L.js +52 -0
- package/dist/{chunk-J3IOLXWM.js → chunk-TXYMNKGM.js} +16 -14
- package/dist/{chunk-IDKCWSM5.js → chunk-U2JTTRKS.js} +401 -115
- package/dist/{chunk-TNR75OXT.js → chunk-U37ZOYJJ.js} +11 -8
- package/dist/{chunk-7MJSQTL5.js → chunk-U57VLY6X.js} +23 -21
- package/dist/{chunk-BHT7QK4G.js → chunk-U66RQUFC.js} +6 -4
- package/dist/chunk-UCFNHK5L.js +50 -0
- package/dist/{chunk-IFKEI4SA.js → chunk-UI6KNLSO.js} +31 -11
- package/dist/{chunk-7GJS6DNX.js → chunk-UKRJ2ISN.js} +13 -3
- package/dist/chunk-UWJOM457.js +232 -0
- package/dist/{chunk-D73UEXYW.js → chunk-UXO25YBN.js} +3 -3
- package/dist/chunk-VE2T5URA.js +51 -0
- package/dist/{chunk-C3RY6KU6.js → chunk-W4EG25TI.js} +513 -172
- package/dist/{chunk-O66DM6DJ.js → chunk-WAAPMZWO.js} +6 -4
- package/dist/{chunk-R7NYHMUU.js → chunk-WECCLSYY.js} +4884 -3669
- package/dist/chunk-WQDJGNJQ.js +45 -0
- package/dist/{chunk-UWMJKX5U.js → chunk-WWSCJBF6.js} +14 -12
- package/dist/{chunk-N3XIYPU3.js → chunk-X7HFXXTZ.js} +16 -13
- package/dist/chunk-X7XVMYIL.js +5 -0
- package/dist/{chunk-NR2UJWOC.js → chunk-XERIHPBF.js} +12 -9
- package/dist/{chunk-JRBFANFE.js → chunk-XKNISZ6N.js} +21 -18
- package/dist/{chunk-PPD7HTDP.js → chunk-XNH5ZWIA.js} +20 -18
- package/dist/{chunk-7IOWA5D5.js → chunk-XNW3EDCY.js} +13 -3
- package/dist/{chunk-2LGRMVCA.js → chunk-XPXOKHNZ.js} +13 -11
- package/dist/{chunk-ZJXLNDH4.js → chunk-XXRBAJ36.js} +14 -12
- package/dist/{chunk-EHA7RMZ3.js → chunk-YA2IJJ6N.js} +8 -6
- package/dist/{chunk-LGBMTVNT.js → chunk-YB5AKYVQ.js} +7 -5
- package/dist/{chunk-JB5LINEM.js → chunk-YDDLVBQ4.js} +3 -3
- package/dist/{chunk-PAQ2AS5E.js → chunk-YF6N45QN.js} +1 -1
- package/dist/{chunk-WMTRHUI5.js → chunk-YHWX5LPT.js} +23 -21
- package/dist/{chunk-KQGURXFU.js → chunk-YLZNTVZR.js} +36 -13
- package/dist/{chunk-NY2XSR5K.js → chunk-YUJTOALL.js} +118 -18
- package/dist/{chunk-VZALIKIF.js → chunk-Z5YDTIWQ.js} +19 -16
- package/dist/{chunk-LDLL7LB3.js → chunk-ZCU2UY47.js} +24 -22
- package/dist/{chunk-OWNCM4ZN.js → chunk-ZIAYNHHE.js} +197 -17
- package/dist/{chunk-WJF2CS6M.js → chunk-ZJ2W2RDE.js} +7 -5
- package/dist/{chunk-REWWDVQB.js → chunk-ZRQHSMPK.js} +6 -4
- package/dist/{chunk-O7XLYEFA.js → chunk-ZSD75FYI.js} +57 -23
- package/dist/chunk-ZSNNF26J.js +220 -0
- package/dist/{chunk-BQ4SQQC6.js → chunk-ZX6RAGE6.js} +11 -9
- package/dist/files.json +583 -515
- package/dist/packages/sdk/npm/index.js +6428 -4882
- package/dist/packages/ui/dist/assets/{elk-api-CIf-0gz5.js → elk-api--rH6Kdl4.js} +2 -2
- package/dist/packages/ui/dist/assets/index-Bf2immpE.css +1 -0
- package/dist/packages/ui/dist/assets/index-CH4nGIW3.js +62 -0
- package/dist/packages/ui/dist/index.html +2 -2
- package/package.json +6 -6
- package/dist/chunk-2SKB4O2E.js +0 -59
- package/dist/chunk-4U276ICE.js +0 -39
- package/dist/chunk-6H3Z5JHH.js +0 -64
- package/dist/chunk-AFZ3QA6W.js +0 -47
- package/dist/chunk-AVTBS4OW.js +0 -49
- package/dist/chunk-C4R4JLHE.js +0 -40
- package/dist/chunk-CBGGOQWU.js +0 -82
- package/dist/chunk-CMDXGQTS.js +0 -47
- package/dist/chunk-DLOBCJL6.js +0 -48
- package/dist/chunk-GIW4ZVDB.js +0 -39
- package/dist/chunk-IP74LCOQ.js +0 -57
- package/dist/chunk-IPHHDDC6.js +0 -45
- package/dist/chunk-KJXD4PNL.js +0 -50
- package/dist/chunk-KN5BXMWN.js +0 -44
- package/dist/chunk-MFHL5URL.js +0 -31
- package/dist/chunk-NXJ5URP6.js +0 -51
- package/dist/chunk-OMI6FPPN.js +0 -43
- package/dist/chunk-ONUPY3H6.js +0 -53
- package/dist/chunk-OTLDSZDV.js +0 -69
- package/dist/chunk-PSOFBQWB.js +0 -42
- package/dist/chunk-T4YPZIQN.js +0 -36
- package/dist/chunk-TUULXQRW.js +0 -420
- package/dist/chunk-WNKPRSGI.js +0 -36
- package/dist/packages/ui/dist/assets/index-CoK_Dl0D.js +0 -47
- package/dist/packages/ui/dist/assets/index-Dw20IRhQ.css +0 -1
- package/dist/{chunk-24XLDU72.js → chunk-PXMV2LLY.js} +3 -3
|
@@ -0,0 +1,925 @@
|
|
|
1
|
+
import { createRequire as __atticusCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __atticusFileURLToPath } from "node:url";
|
|
3
|
+
var require = __atticusCreateRequire(import.meta.url);
|
|
4
|
+
var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
|
|
5
|
+
var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
|
|
6
|
+
import {
|
|
7
|
+
keptFilesMayHaveChanged
|
|
8
|
+
} from "./chunk-CTJHEG6A.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/dist/fs.js
|
|
11
|
+
import { randomBytes } from "node:crypto";
|
|
12
|
+
import { link, mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
13
|
+
import { hostname } from "node:os";
|
|
14
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
15
|
+
async function writeFileAtomic(path, data) {
|
|
16
|
+
await mkdir(dirname(path), { recursive: true });
|
|
17
|
+
const tmp = `${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
|
|
18
|
+
try {
|
|
19
|
+
await writeFile(tmp, data, typeof data === "string" ? "utf8" : void 0);
|
|
20
|
+
await renameRetrying(tmp, path);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
await rm(tmp, { force: true });
|
|
23
|
+
throw e;
|
|
24
|
+
} finally {
|
|
25
|
+
keptFilesMayHaveChanged(path);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
var FileChangedError = class extends Error {
|
|
29
|
+
path;
|
|
30
|
+
constructor(path) {
|
|
31
|
+
super(`${path} changed since it was read (another edit, or a person's): nothing was written. Read it again and redo the change.`);
|
|
32
|
+
this.path = path;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var writing = /* @__PURE__ */ new Map();
|
|
36
|
+
function writeFileIfUnchanged(path, before, data) {
|
|
37
|
+
const key = resolve(path);
|
|
38
|
+
const prev = writing.get(key) ?? Promise.resolve();
|
|
39
|
+
const work = async () => {
|
|
40
|
+
const now = await readFile(path, "utf8").catch(() => void 0);
|
|
41
|
+
if (now !== before)
|
|
42
|
+
throw new FileChangedError(path);
|
|
43
|
+
await writeFileAtomic(path, data);
|
|
44
|
+
};
|
|
45
|
+
const next = prev.then(work, work);
|
|
46
|
+
const tail = next.catch(() => void 0);
|
|
47
|
+
writing.set(key, tail);
|
|
48
|
+
void tail.then(() => {
|
|
49
|
+
if (writing.get(key) === tail)
|
|
50
|
+
writing.delete(key);
|
|
51
|
+
});
|
|
52
|
+
return next;
|
|
53
|
+
}
|
|
54
|
+
var BUSY = /* @__PURE__ */ new Set(["EPERM", "EBUSY", "EACCES"]);
|
|
55
|
+
async function renameRetrying(from, to, tries = 9) {
|
|
56
|
+
for (let i = 0; ; i++) {
|
|
57
|
+
try {
|
|
58
|
+
await rename(from, to);
|
|
59
|
+
return;
|
|
60
|
+
} catch (e) {
|
|
61
|
+
const code = e.code ?? "";
|
|
62
|
+
if (!BUSY.has(code) || i >= tries - 1)
|
|
63
|
+
throw e;
|
|
64
|
+
await new Promise((r) => setTimeout(r, 20 * 2 ** i));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var LockHeldError = class extends Error {
|
|
69
|
+
held;
|
|
70
|
+
file;
|
|
71
|
+
constructor(held, file) {
|
|
72
|
+
super(`Another ${held.what} is running (process ${held.pid} on ${held.host}, since ${held.startedAt}). Wait for it to finish${file ? `; if nothing is running, delete ${file}` : ""}.`);
|
|
73
|
+
this.held = held;
|
|
74
|
+
this.file = file;
|
|
75
|
+
this.name = "LockHeldError";
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var heldHere = /* @__PURE__ */ new Set();
|
|
79
|
+
var lockFileOf = (root, name) => join(root, ".atticus", "locks", `${name}.json`);
|
|
80
|
+
function alive(pid) {
|
|
81
|
+
try {
|
|
82
|
+
process.kill(pid, 0);
|
|
83
|
+
return true;
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return e.code === "EPERM";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function readLock(root, name, o = {}) {
|
|
89
|
+
try {
|
|
90
|
+
const file = lockFileOf(root, name);
|
|
91
|
+
const info = JSON.parse(await readFile(file, "utf8"));
|
|
92
|
+
const here = info.host === hostname();
|
|
93
|
+
const age = (o.now ?? (() => /* @__PURE__ */ new Date()))().getTime() - Date.parse(info.startedAt);
|
|
94
|
+
const stale = here && (!alive(info.pid) || info.pid === process.pid && !heldHere.has(file)) || o.maxAgeMs !== void 0 && Number.isFinite(age) && age > o.maxAgeMs;
|
|
95
|
+
return { ...info, stale };
|
|
96
|
+
} catch {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async function acquireLock(root, name, what, now = () => /* @__PURE__ */ new Date(), o = {}) {
|
|
101
|
+
const file = lockFileOf(root, name);
|
|
102
|
+
await ensureLocalIgnore(root);
|
|
103
|
+
await mkdir(dirname(file), { recursive: true });
|
|
104
|
+
const info = {
|
|
105
|
+
pid: process.pid,
|
|
106
|
+
host: hostname(),
|
|
107
|
+
startedAt: now().toISOString(),
|
|
108
|
+
what
|
|
109
|
+
};
|
|
110
|
+
let interrupted;
|
|
111
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
112
|
+
try {
|
|
113
|
+
await writeFile(file, JSON.stringify(info), { encoding: "utf8", flag: "wx" });
|
|
114
|
+
heldHere.add(file);
|
|
115
|
+
const release = async () => {
|
|
116
|
+
const cur = await readLock(root, name);
|
|
117
|
+
if (cur && cur.pid === info.pid && cur.startedAt === info.startedAt)
|
|
118
|
+
await rm(file, { force: true });
|
|
119
|
+
heldHere.delete(file);
|
|
120
|
+
};
|
|
121
|
+
return interrupted ? { release, interrupted } : { release };
|
|
122
|
+
} catch (e) {
|
|
123
|
+
if (e.code !== "EEXIST")
|
|
124
|
+
throw e;
|
|
125
|
+
const held = await readLock(root, name, { ...o, now });
|
|
126
|
+
if (held && !held.stale)
|
|
127
|
+
throw new LockHeldError(held, file);
|
|
128
|
+
if (held) {
|
|
129
|
+
const { stale: _s, ...rest } = held;
|
|
130
|
+
interrupted = rest;
|
|
131
|
+
}
|
|
132
|
+
await rm(file, { force: true });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
throw new Error(`Couldn't take the ${name} lock at ${file}.`);
|
|
136
|
+
}
|
|
137
|
+
var sharedLockFileOf = (path) => `${path}.lock`;
|
|
138
|
+
var sharing = /* @__PURE__ */ new Map();
|
|
139
|
+
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
140
|
+
var QUICK_WRITE_LOCK = { maxAgeMs: 12e4 };
|
|
141
|
+
function withSharedFileLock(path, work, o = {}) {
|
|
142
|
+
const key = resolve(path);
|
|
143
|
+
const prev = sharing.get(key) ?? Promise.resolve();
|
|
144
|
+
const run = async () => {
|
|
145
|
+
const release = await takeSharedLock(key, o);
|
|
146
|
+
try {
|
|
147
|
+
return await work();
|
|
148
|
+
} finally {
|
|
149
|
+
await release();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const next = prev.then(run, run);
|
|
153
|
+
const tail = next.catch(() => void 0);
|
|
154
|
+
sharing.set(key, tail);
|
|
155
|
+
void tail.then(() => {
|
|
156
|
+
if (sharing.get(key) === tail)
|
|
157
|
+
sharing.delete(key);
|
|
158
|
+
});
|
|
159
|
+
return next;
|
|
160
|
+
}
|
|
161
|
+
async function takeSharedLock(path, o) {
|
|
162
|
+
const file = sharedLockFileOf(path);
|
|
163
|
+
const staleMs = o.staleMs ?? 1e4;
|
|
164
|
+
const waitMs = o.waitMs ?? 15e3;
|
|
165
|
+
const info = {
|
|
166
|
+
pid: process.pid,
|
|
167
|
+
host: hostname(),
|
|
168
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
169
|
+
what: o.what ?? `write of ${basename(path)}`,
|
|
170
|
+
token: randomBytes(8).toString("hex")
|
|
171
|
+
};
|
|
172
|
+
await mkdir(dirname(file), { recursive: true });
|
|
173
|
+
const start = Date.now();
|
|
174
|
+
let delay = 5;
|
|
175
|
+
for (; ; ) {
|
|
176
|
+
let code;
|
|
177
|
+
try {
|
|
178
|
+
await writeFile(file, JSON.stringify(info), { encoding: "utf8", flag: "wx" });
|
|
179
|
+
return () => releaseShared(file, info.token);
|
|
180
|
+
} catch (e) {
|
|
181
|
+
code = e.code ?? "";
|
|
182
|
+
if (code !== "EEXIST" && !BUSY.has(code))
|
|
183
|
+
throw e;
|
|
184
|
+
}
|
|
185
|
+
let held;
|
|
186
|
+
if (code === "EEXIST") {
|
|
187
|
+
const seen = await readFile(file, "utf8").catch(() => void 0);
|
|
188
|
+
if (seen === void 0)
|
|
189
|
+
continue;
|
|
190
|
+
held = parseLockInfo(seen);
|
|
191
|
+
if (await isStaleShared(file, held, staleMs, o.maxAgeMs)) {
|
|
192
|
+
await takeOver(file, seen, info.token);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (Date.now() - start > waitMs)
|
|
197
|
+
throw new LockHeldError(held ?? { pid: 0, host: "?", startedAt: "?", what: `write of ${basename(path)}` }, file);
|
|
198
|
+
await sleep(delay + Math.floor(Math.random() * delay));
|
|
199
|
+
delay = Math.min(delay * 2, 100);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function parseLockInfo(text) {
|
|
203
|
+
try {
|
|
204
|
+
const j = JSON.parse(text);
|
|
205
|
+
return typeof j.pid === "number" && typeof j.startedAt === "string" ? {
|
|
206
|
+
pid: j.pid,
|
|
207
|
+
host: String(j.host ?? ""),
|
|
208
|
+
startedAt: j.startedAt,
|
|
209
|
+
what: String(j.what ?? "")
|
|
210
|
+
} : void 0;
|
|
211
|
+
} catch {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
async function isStaleShared(file, held, staleMs, maxAgeMs) {
|
|
216
|
+
if (held && maxAgeMs !== void 0) {
|
|
217
|
+
const since2 = Date.parse(held.startedAt);
|
|
218
|
+
if (Number.isFinite(since2) && Date.now() - since2 > maxAgeMs)
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
if (held && held.host === hostname() && held.pid !== process.pid)
|
|
222
|
+
return !alive(held.pid);
|
|
223
|
+
const since = held ? Date.parse(held.startedAt) : await stat(file).then((s) => s.mtimeMs, () => NaN);
|
|
224
|
+
return Number.isFinite(since) && Date.now() - since > staleMs;
|
|
225
|
+
}
|
|
226
|
+
async function takeOver(file, seen, token) {
|
|
227
|
+
const aside = `${file}.${token}.stale`;
|
|
228
|
+
try {
|
|
229
|
+
await rename(file, aside);
|
|
230
|
+
} catch {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const moved = await readFile(aside, "utf8").catch(() => void 0);
|
|
234
|
+
if (moved !== void 0 && moved !== seen)
|
|
235
|
+
await link(aside, file).catch(() => void 0);
|
|
236
|
+
await rmRetrying(aside);
|
|
237
|
+
}
|
|
238
|
+
async function releaseShared(file, token) {
|
|
239
|
+
const now = await readFile(file, "utf8").catch(() => void 0);
|
|
240
|
+
if (now === void 0)
|
|
241
|
+
return;
|
|
242
|
+
try {
|
|
243
|
+
if (JSON.parse(now).token !== token)
|
|
244
|
+
return;
|
|
245
|
+
} catch {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
await rmRetrying(file);
|
|
249
|
+
}
|
|
250
|
+
async function rmRetrying(file, tries = 9) {
|
|
251
|
+
for (let i = 0; ; i++) {
|
|
252
|
+
try {
|
|
253
|
+
await rm(file, { force: true });
|
|
254
|
+
return;
|
|
255
|
+
} catch (e) {
|
|
256
|
+
const code = e.code ?? "";
|
|
257
|
+
if (!BUSY.has(code) || i >= tries - 1)
|
|
258
|
+
throw e;
|
|
259
|
+
await sleep(20 * 2 ** i);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
var LOCAL_ONLY = [
|
|
264
|
+
"me.yaml",
|
|
265
|
+
"logs/",
|
|
266
|
+
"locks/",
|
|
267
|
+
"backups/",
|
|
268
|
+
"history/",
|
|
269
|
+
"probe/",
|
|
270
|
+
"cache/",
|
|
271
|
+
// ADR 0161: where `atticus map --all` is in the estate, so running it again resumes.
|
|
272
|
+
"map-all/"
|
|
273
|
+
];
|
|
274
|
+
async function ensureLocalIgnore(root) {
|
|
275
|
+
const file = join(root, ".atticus", ".gitignore");
|
|
276
|
+
const text = await readFile(file, "utf8").catch(() => "");
|
|
277
|
+
const have = new Set(text.split(/\r?\n/).map((l) => l.trim()));
|
|
278
|
+
const missing = LOCAL_ONLY.filter((l) => !have.has(l));
|
|
279
|
+
if (!missing.length)
|
|
280
|
+
return;
|
|
281
|
+
const prefix = text && !text.endsWith("\n") ? `${text}
|
|
282
|
+
` : text;
|
|
283
|
+
await writeFileAtomic(file, `${prefix}${prefix ? "" : "# This machine's own files: never committed.\n"}${missing.join("\n")}
|
|
284
|
+
`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// packages/core/dist/log.js
|
|
288
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
289
|
+
import { homedir, userInfo } from "node:os";
|
|
290
|
+
import { join as join2 } from "node:path";
|
|
291
|
+
var ORDER = { debug: 10, info: 20, warn: 30, error: 40, off: 100 };
|
|
292
|
+
var LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
293
|
+
var LOG_KEEP = 3;
|
|
294
|
+
var logFileOf = (root) => join2(root, ".atticus", "logs", "atticus.log");
|
|
295
|
+
var SECRET_KEY = /(token|password|passwd|pwd|secret|api[-_]?key|private[-_]?key|credential|authorization|cookie|session)/i;
|
|
296
|
+
function redactText(s, o = {}) {
|
|
297
|
+
let out = s.replace(/([a-z][a-z0-9+.-]*:\/\/)[^/@\s:]+:[^/@\s]+@/gi, "$1***@").replace(/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 ***").replace(new RegExp(`(${SECRET_KEY.source})(["']?\\s*[:=]\\s*["']?)([^\\s"',;&]+)`, "gi"), "$1$3***").replace(/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}/g, "***").replace(/\b(?=[A-Za-z0-9+_-]*\d)(?=[A-Za-z0-9+_-]*[A-Z])(?=[A-Za-z0-9+_-]*[a-z])[A-Za-z0-9+_-]{32,}={0,2}/g, "***");
|
|
298
|
+
const home = o.home ?? safeHome();
|
|
299
|
+
if (home && home.length > 3)
|
|
300
|
+
out = out.split(home).join("~");
|
|
301
|
+
const user = o.user ?? safeUser();
|
|
302
|
+
if (user && user.length > 2)
|
|
303
|
+
out = out.replace(new RegExp(`([\\\\/])${escapeRe(user)}(?=[\\\\/])`, "g"), "$1<user>");
|
|
304
|
+
return out;
|
|
305
|
+
}
|
|
306
|
+
function redact(v, o = {}) {
|
|
307
|
+
if (typeof v === "string")
|
|
308
|
+
return redactText(v, o);
|
|
309
|
+
if (Array.isArray(v))
|
|
310
|
+
return v.map((x) => redact(x, o));
|
|
311
|
+
if (v && typeof v === "object") {
|
|
312
|
+
const out = {};
|
|
313
|
+
for (const [k, x] of Object.entries(v))
|
|
314
|
+
out[k] = SECRET_KEY.test(k) ? "***" : redact(x, o);
|
|
315
|
+
return out;
|
|
316
|
+
}
|
|
317
|
+
return v;
|
|
318
|
+
}
|
|
319
|
+
var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
320
|
+
function safeHome() {
|
|
321
|
+
try {
|
|
322
|
+
return homedir();
|
|
323
|
+
} catch {
|
|
324
|
+
return void 0;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function safeUser() {
|
|
328
|
+
try {
|
|
329
|
+
return userInfo().username;
|
|
330
|
+
} catch {
|
|
331
|
+
return void 0;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function rotate(file, max, keep) {
|
|
335
|
+
try {
|
|
336
|
+
if (statSync(file).size < max)
|
|
337
|
+
return;
|
|
338
|
+
} catch {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
rmSync(`${file}.${keep}`, { force: true });
|
|
342
|
+
for (let i = keep - 1; i >= 1; i--) {
|
|
343
|
+
try {
|
|
344
|
+
renameSync(`${file}.${i}`, `${file}.${i + 1}`);
|
|
345
|
+
} catch {
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
try {
|
|
349
|
+
renameSync(file, `${file}.1`);
|
|
350
|
+
} catch {
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function logLevelFrom(env = process.env) {
|
|
354
|
+
const v = (env.ATTICUS_LOG ?? "").toLowerCase();
|
|
355
|
+
return v in ORDER ? v : "info";
|
|
356
|
+
}
|
|
357
|
+
function createLog(root, o = {}) {
|
|
358
|
+
const file = logFileOf(root);
|
|
359
|
+
const level = o.level ?? logLevelFrom();
|
|
360
|
+
const now = o.now ?? (() => /* @__PURE__ */ new Date());
|
|
361
|
+
const write = (lvl, event, fields) => {
|
|
362
|
+
if (ORDER[lvl] < ORDER[level])
|
|
363
|
+
return;
|
|
364
|
+
try {
|
|
365
|
+
mkdirSync(join2(file, ".."), { recursive: true });
|
|
366
|
+
ignoreLocalSync(root);
|
|
367
|
+
rotate(file, o.maxBytes ?? LOG_MAX_BYTES, o.keep ?? LOG_KEEP);
|
|
368
|
+
const entry = redact({ at: now().toISOString(), level: lvl, event, ...fields });
|
|
369
|
+
appendFileSync(file, `${JSON.stringify(entry)}
|
|
370
|
+
`, "utf8");
|
|
371
|
+
} catch {
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
return {
|
|
375
|
+
file,
|
|
376
|
+
debug: (e, f = {}) => write("debug", e, f),
|
|
377
|
+
info: (e, f = {}) => write("info", e, f),
|
|
378
|
+
warn: (e, f = {}) => write("warn", e, f),
|
|
379
|
+
error: (e, err, f = {}) => write("error", e, {
|
|
380
|
+
...f,
|
|
381
|
+
error: err instanceof Error ? { name: err.name, message: err.message, stack: err.stack?.split("\n").slice(0, 25) } : { message: String(err) }
|
|
382
|
+
})
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function ignoreLocalSync(root) {
|
|
386
|
+
const f = join2(root, ".atticus", ".gitignore");
|
|
387
|
+
const text = existsSync(f) ? readFileSync(f, "utf8") : "";
|
|
388
|
+
const have = new Set(text.split(/\r?\n/).map((l) => l.trim()));
|
|
389
|
+
const missing = LOCAL_ONLY.filter((l) => !have.has(l));
|
|
390
|
+
if (!missing.length)
|
|
391
|
+
return;
|
|
392
|
+
const prefix = text && !text.endsWith("\n") ? `${text}
|
|
393
|
+
` : text;
|
|
394
|
+
const head = prefix ? "" : "# This machine's own files: never committed.\n";
|
|
395
|
+
writeFileSync(f, `${prefix}${head}${missing.join("\n")}
|
|
396
|
+
`, "utf8");
|
|
397
|
+
}
|
|
398
|
+
var NO_LOG = {
|
|
399
|
+
file: "",
|
|
400
|
+
debug: () => void 0,
|
|
401
|
+
info: () => void 0,
|
|
402
|
+
warn: () => void 0,
|
|
403
|
+
error: () => void 0
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// packages/core/dist/run-log.js
|
|
407
|
+
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
408
|
+
import { appendFileSync as appendFileSync2, closeSync, mkdirSync as mkdirSync2, openSync, readdirSync, readFileSync as readFileSync2, readSync, renameSync as renameSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
409
|
+
import { hostname as hostname2 } from "node:os";
|
|
410
|
+
import { join as join3 } from "node:path";
|
|
411
|
+
var RUN_LOG_KEEP = 50;
|
|
412
|
+
var RUN_LOG_MAX_BYTES = 2 * 1024 * 1024;
|
|
413
|
+
var RUN_LOG_LINE_MAX = 4e3;
|
|
414
|
+
var RUN_LOG_READ_MAX = 5e3;
|
|
415
|
+
var RUN_HEARTBEAT_MS = 3e4;
|
|
416
|
+
var RUN_SILENT_MS = 5 * 60 * 1e3;
|
|
417
|
+
var TERMINAL_RUN_ID = /^\d{8}-\d{6}-\d{1,10}-[0-9a-f]{4}$/;
|
|
418
|
+
var runLogsDirOf = (root) => join3(root, ".atticus", "logs", "runs");
|
|
419
|
+
var runningDirOf = (root) => join3(root, ".atticus", "logs", "running");
|
|
420
|
+
var RECORDED = {
|
|
421
|
+
map: true,
|
|
422
|
+
scan: true,
|
|
423
|
+
verify: true,
|
|
424
|
+
upgrade: true,
|
|
425
|
+
reconcile: true,
|
|
426
|
+
"run-ready": true,
|
|
427
|
+
workspace: /* @__PURE__ */ new Set(["sync", "bring-in", "open"]),
|
|
428
|
+
task: /* @__PURE__ */ new Set(["run", "run-ready"]),
|
|
429
|
+
knowledge: /* @__PURE__ */ new Set(["scan"]),
|
|
430
|
+
handoff: /* @__PURE__ */ new Set(["done"]),
|
|
431
|
+
index: /* @__PURE__ */ new Set(["rebuild", "embed"])
|
|
432
|
+
};
|
|
433
|
+
var NOT_RECORDED_FLAGS = /* @__PURE__ */ new Set(["help", "version", "check", "dry-run"]);
|
|
434
|
+
var QUICK = /* @__PURE__ */ new Set(["map render", "verify audit", "scan review"]);
|
|
435
|
+
function recordedCommand(positionals, flags) {
|
|
436
|
+
const [group, command] = positionals;
|
|
437
|
+
if (!group || flags.some((f) => NOT_RECORDED_FLAGS.has(f)))
|
|
438
|
+
return false;
|
|
439
|
+
if (command && QUICK.has(`${group} ${command}`))
|
|
440
|
+
return false;
|
|
441
|
+
const rule = RECORDED[group];
|
|
442
|
+
if (rule === true)
|
|
443
|
+
return true;
|
|
444
|
+
return !!rule && !!command && rule.has(command);
|
|
445
|
+
}
|
|
446
|
+
var ID_WORD = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/;
|
|
447
|
+
var MAX_WORDS = 8;
|
|
448
|
+
var safeWord = (w) => ID_WORD.test(w) && !w.includes("//") && redactText(w, { home: "", user: "" }) === w ? w : "\u2026";
|
|
449
|
+
function runTitle(positionals, flags) {
|
|
450
|
+
const command = positionals.slice(0, MAX_WORDS).map(safeWord);
|
|
451
|
+
const names = flags.filter((f) => /^[a-z][a-z0-9-]{0,40}$/.test(f)).map((f) => `--${f}`);
|
|
452
|
+
return { command, title: ["atticus", ...command, ...names].join(" ") };
|
|
453
|
+
}
|
|
454
|
+
function startedByOf(env = process.env) {
|
|
455
|
+
if (env.ATTICUS_ACP_SESSION)
|
|
456
|
+
return "copilot";
|
|
457
|
+
const said = env.ATTICUS_STARTED_BY;
|
|
458
|
+
if (said === "vscode" || said === "intellij" || said === "terminal")
|
|
459
|
+
return said;
|
|
460
|
+
if (env.TERM_PROGRAM === "vscode")
|
|
461
|
+
return "vscode";
|
|
462
|
+
if ((env.TERMINAL_EMULATOR ?? "").startsWith("JetBrains"))
|
|
463
|
+
return "intellij";
|
|
464
|
+
return "terminal";
|
|
465
|
+
}
|
|
466
|
+
var hostHash = () => {
|
|
467
|
+
try {
|
|
468
|
+
return createHash("sha256").update(hostname2()).digest("hex").slice(0, 12);
|
|
469
|
+
} catch {
|
|
470
|
+
return "unknown";
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
function procStartOf(pid) {
|
|
474
|
+
if (process.platform !== "linux")
|
|
475
|
+
return void 0;
|
|
476
|
+
try {
|
|
477
|
+
const stat2 = readFileSync2(`/proc/${pid}/stat`, "utf8");
|
|
478
|
+
const v = stat2.slice(stat2.lastIndexOf(")") + 2).split(" ")[19];
|
|
479
|
+
return v && /^\d+$/.test(v) ? v : void 0;
|
|
480
|
+
} catch {
|
|
481
|
+
return void 0;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
var pad = (n, w = 2) => String(n).padStart(w, "0");
|
|
485
|
+
var idAt = (d, pid) => `${d.getUTCFullYear()}${pad(d.getUTCMonth() + 1)}${pad(d.getUTCDate())}-${pad(d.getUTCHours())}${pad(d.getUTCMinutes())}${pad(d.getUTCSeconds())}-${pid}-${randomBytes2(2).toString("hex")}`;
|
|
486
|
+
var ANSI = /\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007]*\u0007/g;
|
|
487
|
+
function runLogLines(text, o = {}) {
|
|
488
|
+
return text.replace(ANSI, "").split(/\r?\n|\r/).map((l) => {
|
|
489
|
+
const r = redactText(l, o);
|
|
490
|
+
return r.length > RUN_LOG_LINE_MAX ? `${r.slice(0, RUN_LOG_LINE_MAX)}\u2026` : r;
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
var writeJson = (file, v) => {
|
|
494
|
+
const text = `${JSON.stringify(v, null, 2)}
|
|
495
|
+
`;
|
|
496
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
497
|
+
try {
|
|
498
|
+
writeFileSync2(tmp, text, "utf8");
|
|
499
|
+
renameSync2(tmp, file);
|
|
500
|
+
} catch {
|
|
501
|
+
rmSync2(tmp, { force: true });
|
|
502
|
+
writeFileSync2(file, text, "utf8");
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
function prune(root, keep, live) {
|
|
506
|
+
let names;
|
|
507
|
+
try {
|
|
508
|
+
names = readdirSync(runningDirOf(root)).filter((n) => n.endsWith(".json") && TERMINAL_RUN_ID.test(n.slice(0, -5))).sort();
|
|
509
|
+
} catch {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const removed = /* @__PURE__ */ new Set();
|
|
513
|
+
let over = names.length - keep;
|
|
514
|
+
for (const n of names) {
|
|
515
|
+
if (over <= 0)
|
|
516
|
+
break;
|
|
517
|
+
const id = n.slice(0, -5);
|
|
518
|
+
if (live(id))
|
|
519
|
+
continue;
|
|
520
|
+
rmSync2(join3(runningDirOf(root), n), { force: true });
|
|
521
|
+
rmSync2(join3(runLogsDirOf(root), `${id}.log`), { force: true });
|
|
522
|
+
removed.add(id);
|
|
523
|
+
over--;
|
|
524
|
+
}
|
|
525
|
+
try {
|
|
526
|
+
const kept = new Set(names.map((n) => n.slice(0, -5)).filter((id) => !removed.has(id)));
|
|
527
|
+
for (const n of readdirSync(runLogsDirOf(root)))
|
|
528
|
+
if (n.endsWith(".log") && TERMINAL_RUN_ID.test(n.slice(0, -4)) && !kept.has(n.slice(0, -4)))
|
|
529
|
+
rmSync2(join3(runLogsDirOf(root), n), { force: true });
|
|
530
|
+
} catch {
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function startTerminalRun(root, o) {
|
|
534
|
+
const now = o.now ?? (() => /* @__PURE__ */ new Date());
|
|
535
|
+
const pid = o.pid ?? process.pid;
|
|
536
|
+
const keep = Math.max(o.keep ?? RUN_LOG_KEEP, 1);
|
|
537
|
+
const maxBytes = Math.max(o.maxBytes ?? RUN_LOG_MAX_BYTES, 256);
|
|
538
|
+
const started = now();
|
|
539
|
+
const runId = idAt(started, pid);
|
|
540
|
+
const heartbeatMs = o.heartbeatMs ?? (o.hookProcess ? RUN_HEARTBEAT_MS : void 0);
|
|
541
|
+
const procStart = o.procStart ? o.procStart() : pid === process.pid ? procStartOf(pid) : void 0;
|
|
542
|
+
const { command, title } = runTitle(o.positionals, o.flags);
|
|
543
|
+
const rec = {
|
|
544
|
+
schemaVersion: 1,
|
|
545
|
+
runId,
|
|
546
|
+
pid,
|
|
547
|
+
host: hostHash(),
|
|
548
|
+
title,
|
|
549
|
+
command,
|
|
550
|
+
flags: o.flags.filter((f) => /^[a-z][a-z0-9-]{0,40}$/.test(f)),
|
|
551
|
+
startedBy: startedByOf(o.env),
|
|
552
|
+
startedAt: started.toISOString(),
|
|
553
|
+
state: "running",
|
|
554
|
+
lines: 0,
|
|
555
|
+
dropped: 0,
|
|
556
|
+
...procStart ? { procStart } : {},
|
|
557
|
+
...heartbeatMs ? { beatAt: started.toISOString() } : {}
|
|
558
|
+
};
|
|
559
|
+
const jsonFile = join3(runningDirOf(root), `${runId}.json`);
|
|
560
|
+
const logFile = join3(runLogsDirOf(root), `${runId}.log`);
|
|
561
|
+
try {
|
|
562
|
+
mkdirSync2(runningDirOf(root), { recursive: true });
|
|
563
|
+
mkdirSync2(runLogsDirOf(root), { recursive: true });
|
|
564
|
+
ignoreLocalSync(root);
|
|
565
|
+
const alive2 = o.alive ?? pidAlive;
|
|
566
|
+
prune(root, keep - 1, (id) => {
|
|
567
|
+
const r = readRecord(root, id);
|
|
568
|
+
return !!r && r.state === "running" && !goneRun(r, rec.host, alive2, now().getTime(), root);
|
|
569
|
+
});
|
|
570
|
+
writeFileSync2(logFile, "", "utf8");
|
|
571
|
+
writeJson(jsonFile, rec);
|
|
572
|
+
} catch {
|
|
573
|
+
return void 0;
|
|
574
|
+
}
|
|
575
|
+
let bytes = 0;
|
|
576
|
+
let inFile = 0;
|
|
577
|
+
let ended = false;
|
|
578
|
+
let broken = false;
|
|
579
|
+
const save = () => {
|
|
580
|
+
try {
|
|
581
|
+
if (heartbeatMs && !ended)
|
|
582
|
+
rec.beatAt = now().toISOString();
|
|
583
|
+
writeJson(jsonFile, { ...rec, lines: rec.dropped + inFile });
|
|
584
|
+
} catch {
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
const trim = () => {
|
|
588
|
+
const all = readFileSync2(logFile, "utf8").split("\n");
|
|
589
|
+
if (all.at(-1) === "")
|
|
590
|
+
all.pop();
|
|
591
|
+
let size = 0;
|
|
592
|
+
let at = all.length;
|
|
593
|
+
while (at > 0 && size + Buffer.byteLength(all[at - 1]) + 1 <= maxBytes / 2) {
|
|
594
|
+
size += Buffer.byteLength(all[at - 1]) + 1;
|
|
595
|
+
at--;
|
|
596
|
+
}
|
|
597
|
+
const kept = all.slice(at);
|
|
598
|
+
const tmp = `${logFile}.${process.pid}.tmp`;
|
|
599
|
+
const text = kept.length ? `${kept.join("\n")}
|
|
600
|
+
` : "";
|
|
601
|
+
try {
|
|
602
|
+
writeFileSync2(tmp, text, "utf8");
|
|
603
|
+
renameSync2(tmp, logFile);
|
|
604
|
+
} catch {
|
|
605
|
+
rmSync2(tmp, { force: true });
|
|
606
|
+
writeFileSync2(logFile, text, "utf8");
|
|
607
|
+
}
|
|
608
|
+
rec.dropped += at;
|
|
609
|
+
inFile = kept.length;
|
|
610
|
+
bytes = size;
|
|
611
|
+
save();
|
|
612
|
+
};
|
|
613
|
+
const unhook = [];
|
|
614
|
+
if (heartbeatMs) {
|
|
615
|
+
const beat = setInterval(() => {
|
|
616
|
+
if (!ended)
|
|
617
|
+
save();
|
|
618
|
+
}, heartbeatMs);
|
|
619
|
+
beat.unref?.();
|
|
620
|
+
unhook.push(() => clearInterval(beat));
|
|
621
|
+
}
|
|
622
|
+
const recorder = {
|
|
623
|
+
runId,
|
|
624
|
+
line(text) {
|
|
625
|
+
if (ended || broken)
|
|
626
|
+
return;
|
|
627
|
+
try {
|
|
628
|
+
for (const l of runLogLines(text, o.redact)) {
|
|
629
|
+
const s = `${l}
|
|
630
|
+
`;
|
|
631
|
+
const n = Buffer.byteLength(s);
|
|
632
|
+
if (bytes + n > maxBytes)
|
|
633
|
+
trim();
|
|
634
|
+
appendFileSync2(logFile, s, "utf8");
|
|
635
|
+
bytes += n;
|
|
636
|
+
inFile++;
|
|
637
|
+
}
|
|
638
|
+
} catch {
|
|
639
|
+
broken = true;
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
end(code, how) {
|
|
643
|
+
if (ended)
|
|
644
|
+
return;
|
|
645
|
+
ended = true;
|
|
646
|
+
for (const u of unhook)
|
|
647
|
+
u();
|
|
648
|
+
rec.state = how === "crash" ? "failed" : code === 0 ? "done" : code === 130 || code === 143 ? "cancelled" : "failed";
|
|
649
|
+
rec.exitCode = code;
|
|
650
|
+
rec.finishedAt = now().toISOString();
|
|
651
|
+
save();
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
if (o.hookProcess) {
|
|
655
|
+
const onExit = (code) => recorder.end(typeof code === "number" ? code : 1);
|
|
656
|
+
process.once("exit", onExit);
|
|
657
|
+
unhook.push(() => process.off("exit", onExit));
|
|
658
|
+
for (const [sig, code] of [
|
|
659
|
+
["SIGINT", 130],
|
|
660
|
+
["SIGTERM", 143]
|
|
661
|
+
]) {
|
|
662
|
+
const on = () => {
|
|
663
|
+
if (process.listenerCount(sig) > 1)
|
|
664
|
+
return;
|
|
665
|
+
recorder.end(code);
|
|
666
|
+
process.exit(code);
|
|
667
|
+
};
|
|
668
|
+
process.on(sig, on);
|
|
669
|
+
unhook.push(() => process.off(sig, on));
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return recorder;
|
|
673
|
+
}
|
|
674
|
+
function pidAlive(pid) {
|
|
675
|
+
try {
|
|
676
|
+
process.kill(pid, 0);
|
|
677
|
+
return true;
|
|
678
|
+
} catch (e) {
|
|
679
|
+
return e.code === "EPERM";
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
var DAY = 24 * 60 * 60 * 1e3;
|
|
683
|
+
var mtimeOf = (file) => {
|
|
684
|
+
try {
|
|
685
|
+
return statSync2(file).mtimeMs;
|
|
686
|
+
} catch {
|
|
687
|
+
return 0;
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
function goneRun(r, here, alive2, now, root, startOf = procStartOf) {
|
|
691
|
+
const age = now - Date.parse(r.startedAt);
|
|
692
|
+
if (r.host !== here)
|
|
693
|
+
return age > 2 * DAY;
|
|
694
|
+
if (!alive2(r.pid) || age > 7 * DAY)
|
|
695
|
+
return true;
|
|
696
|
+
const started = r.procStart ? startOf(r.pid) : void 0;
|
|
697
|
+
if (started !== void 0)
|
|
698
|
+
return started !== r.procStart;
|
|
699
|
+
if (r.beatAt) {
|
|
700
|
+
const last = Math.max(Date.parse(r.beatAt) || 0, mtimeOf(join3(runLogsDirOf(root), `${r.runId}.log`)));
|
|
701
|
+
return now - last > RUN_SILENT_MS;
|
|
702
|
+
}
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
function readRecord(root, runId) {
|
|
706
|
+
if (!TERMINAL_RUN_ID.test(runId))
|
|
707
|
+
return void 0;
|
|
708
|
+
try {
|
|
709
|
+
const r = JSON.parse(readFileSync2(join3(runningDirOf(root), `${runId}.json`), "utf8"));
|
|
710
|
+
if (r.schemaVersion !== 1 || r.runId !== runId || typeof r.title !== "string" || typeof r.startedAt !== "string" || typeof r.pid !== "number" || !["running", "done", "failed", "cancelled"].includes(r.state))
|
|
711
|
+
return void 0;
|
|
712
|
+
return {
|
|
713
|
+
...r,
|
|
714
|
+
command: Array.isArray(r.command) ? r.command.map(String) : [],
|
|
715
|
+
flags: Array.isArray(r.flags) ? r.flags.map(String) : [],
|
|
716
|
+
lines: Number(r.lines) || 0,
|
|
717
|
+
dropped: Number(r.dropped) || 0,
|
|
718
|
+
...typeof r.procStart === "string" ? { procStart: r.procStart } : {},
|
|
719
|
+
...typeof r.beatAt === "string" ? { beatAt: r.beatAt } : {}
|
|
720
|
+
};
|
|
721
|
+
} catch {
|
|
722
|
+
return void 0;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
function readTerminalRuns(root, o = {}) {
|
|
726
|
+
let names;
|
|
727
|
+
try {
|
|
728
|
+
names = readdirSync(runningDirOf(root));
|
|
729
|
+
} catch {
|
|
730
|
+
return [];
|
|
731
|
+
}
|
|
732
|
+
const here = hostHash();
|
|
733
|
+
const alive2 = o.alive ?? pidAlive;
|
|
734
|
+
const now = (o.now ?? (() => /* @__PURE__ */ new Date()))().getTime();
|
|
735
|
+
const out = [];
|
|
736
|
+
for (const n of names.sort().reverse()) {
|
|
737
|
+
if (!n.endsWith(".json"))
|
|
738
|
+
continue;
|
|
739
|
+
const r = readRecord(root, n.slice(0, -5));
|
|
740
|
+
if (!r)
|
|
741
|
+
continue;
|
|
742
|
+
if (r.state === "running") {
|
|
743
|
+
if (goneRun(r, here, alive2, now, root, o.startOf)) {
|
|
744
|
+
out.push({ ...r, stale: true });
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
out.push(r);
|
|
749
|
+
}
|
|
750
|
+
return out;
|
|
751
|
+
}
|
|
752
|
+
var readTerminalRun = (root, runId, o = {}) => TERMINAL_RUN_ID.test(runId) ? readTerminalRuns(root, o).find((r) => r.runId === runId) : void 0;
|
|
753
|
+
function readTerminalRunLines(root, runId, from, max = RUN_LOG_READ_MAX) {
|
|
754
|
+
const r = readRecord(root, runId);
|
|
755
|
+
if (!r)
|
|
756
|
+
return void 0;
|
|
757
|
+
let text;
|
|
758
|
+
try {
|
|
759
|
+
text = readFileSync2(join3(runLogsDirOf(root), `${runId}.log`), "utf8");
|
|
760
|
+
} catch {
|
|
761
|
+
text = "";
|
|
762
|
+
}
|
|
763
|
+
const all = text.split("\n");
|
|
764
|
+
all.pop();
|
|
765
|
+
const total = r.dropped + all.length;
|
|
766
|
+
const start = from === void 0 ? Math.max(total - max, r.dropped) : Math.max(Math.min(from, total), r.dropped);
|
|
767
|
+
const lines = all.slice(start - r.dropped, start - r.dropped + max);
|
|
768
|
+
return { from: start, lines, total };
|
|
769
|
+
}
|
|
770
|
+
function linesIn(buf, skip, max) {
|
|
771
|
+
const lines = [];
|
|
772
|
+
let at = 0;
|
|
773
|
+
let n = 0;
|
|
774
|
+
while (at < buf.length) {
|
|
775
|
+
const nl = buf.indexOf(10, at);
|
|
776
|
+
if (nl < 0)
|
|
777
|
+
break;
|
|
778
|
+
if (n >= skip) {
|
|
779
|
+
if (lines.length >= max)
|
|
780
|
+
return { lines, end: at, more: true };
|
|
781
|
+
lines.push(buf.toString("utf8", at, nl));
|
|
782
|
+
}
|
|
783
|
+
n++;
|
|
784
|
+
at = nl + 1;
|
|
785
|
+
}
|
|
786
|
+
return { lines, end: at, more: false };
|
|
787
|
+
}
|
|
788
|
+
function readFrom(file, from, size) {
|
|
789
|
+
const buf = Buffer.alloc(Math.max(size - from, 0));
|
|
790
|
+
if (!buf.length)
|
|
791
|
+
return buf;
|
|
792
|
+
const fd = openSync(file, "r");
|
|
793
|
+
try {
|
|
794
|
+
let got = 0;
|
|
795
|
+
while (got < buf.length) {
|
|
796
|
+
const n = readSync(fd, buf, got, buf.length - got, from + got);
|
|
797
|
+
if (n <= 0)
|
|
798
|
+
break;
|
|
799
|
+
got += n;
|
|
800
|
+
}
|
|
801
|
+
return got < buf.length ? buf.subarray(0, got) : buf;
|
|
802
|
+
} finally {
|
|
803
|
+
closeSync(fd);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
function tailTerminalRunLines(root, runId, at, max = RUN_LOG_READ_MAX) {
|
|
807
|
+
const file = join3(runLogsDirOf(root), `${runId}.log`);
|
|
808
|
+
for (let tries = 0; ; tries++) {
|
|
809
|
+
const r = readRecord(root, runId);
|
|
810
|
+
if (!r)
|
|
811
|
+
return void 0;
|
|
812
|
+
let size = 0;
|
|
813
|
+
let ino = 0;
|
|
814
|
+
try {
|
|
815
|
+
const st = statSync2(file);
|
|
816
|
+
size = st.size;
|
|
817
|
+
ino = st.ino;
|
|
818
|
+
} catch {
|
|
819
|
+
}
|
|
820
|
+
if (at && at.dropped === r.dropped && at.ino === ino && size >= at.bytes) {
|
|
821
|
+
let buf2;
|
|
822
|
+
try {
|
|
823
|
+
buf2 = readFrom(file, at.bytes, size);
|
|
824
|
+
} catch {
|
|
825
|
+
buf2 = Buffer.alloc(0);
|
|
826
|
+
}
|
|
827
|
+
const got2 = linesIn(buf2, 0, max);
|
|
828
|
+
return {
|
|
829
|
+
from: at.line,
|
|
830
|
+
lines: got2.lines,
|
|
831
|
+
at: {
|
|
832
|
+
line: at.line + got2.lines.length,
|
|
833
|
+
bytes: at.bytes + got2.end,
|
|
834
|
+
dropped: r.dropped,
|
|
835
|
+
ino
|
|
836
|
+
},
|
|
837
|
+
more: got2.more
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
let buf;
|
|
841
|
+
try {
|
|
842
|
+
buf = readFileSync2(file);
|
|
843
|
+
} catch {
|
|
844
|
+
buf = Buffer.alloc(0);
|
|
845
|
+
}
|
|
846
|
+
const again = readRecord(root, runId);
|
|
847
|
+
if (again && again.dropped !== r.dropped && tries < 1)
|
|
848
|
+
continue;
|
|
849
|
+
let count = 0;
|
|
850
|
+
for (let i = buf.indexOf(10); i >= 0; i = buf.indexOf(10, i + 1))
|
|
851
|
+
count++;
|
|
852
|
+
const total = r.dropped + count;
|
|
853
|
+
const start = at === void 0 ? Math.max(total - max, r.dropped) : Math.max(Math.min(at.line, total), r.dropped);
|
|
854
|
+
const got = linesIn(buf, start - r.dropped, max);
|
|
855
|
+
return {
|
|
856
|
+
from: start,
|
|
857
|
+
lines: got.lines,
|
|
858
|
+
at: { line: start + got.lines.length, bytes: got.end, dropped: r.dropped, ino },
|
|
859
|
+
more: got.more
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// packages/core/dist/printer.js
|
|
865
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
866
|
+
var printer = new AsyncLocalStorage();
|
|
867
|
+
function withPrinter(print, work) {
|
|
868
|
+
return printer.run(print, work);
|
|
869
|
+
}
|
|
870
|
+
function printToCurrent(line) {
|
|
871
|
+
const p = printer.getStore();
|
|
872
|
+
if (!p)
|
|
873
|
+
return;
|
|
874
|
+
try {
|
|
875
|
+
p(line);
|
|
876
|
+
} catch {
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export {
|
|
881
|
+
writeFileAtomic,
|
|
882
|
+
FileChangedError,
|
|
883
|
+
writeFileIfUnchanged,
|
|
884
|
+
renameRetrying,
|
|
885
|
+
LockHeldError,
|
|
886
|
+
lockFileOf,
|
|
887
|
+
readLock,
|
|
888
|
+
acquireLock,
|
|
889
|
+
sharedLockFileOf,
|
|
890
|
+
QUICK_WRITE_LOCK,
|
|
891
|
+
withSharedFileLock,
|
|
892
|
+
LOCAL_ONLY,
|
|
893
|
+
ensureLocalIgnore,
|
|
894
|
+
LOG_MAX_BYTES,
|
|
895
|
+
LOG_KEEP,
|
|
896
|
+
logFileOf,
|
|
897
|
+
redactText,
|
|
898
|
+
redact,
|
|
899
|
+
logLevelFrom,
|
|
900
|
+
createLog,
|
|
901
|
+
ignoreLocalSync,
|
|
902
|
+
NO_LOG,
|
|
903
|
+
RUN_LOG_KEEP,
|
|
904
|
+
RUN_LOG_MAX_BYTES,
|
|
905
|
+
RUN_LOG_LINE_MAX,
|
|
906
|
+
RUN_LOG_READ_MAX,
|
|
907
|
+
RUN_HEARTBEAT_MS,
|
|
908
|
+
RUN_SILENT_MS,
|
|
909
|
+
TERMINAL_RUN_ID,
|
|
910
|
+
runLogsDirOf,
|
|
911
|
+
runningDirOf,
|
|
912
|
+
recordedCommand,
|
|
913
|
+
runTitle,
|
|
914
|
+
startedByOf,
|
|
915
|
+
procStartOf,
|
|
916
|
+
runLogLines,
|
|
917
|
+
startTerminalRun,
|
|
918
|
+
pidAlive,
|
|
919
|
+
readTerminalRuns,
|
|
920
|
+
readTerminalRun,
|
|
921
|
+
readTerminalRunLines,
|
|
922
|
+
tailTerminalRunLines,
|
|
923
|
+
withPrinter,
|
|
924
|
+
printToCurrent
|
|
925
|
+
};
|