@maycombhq/atticus 2.0.0-beta.10 → 2.0.0-beta.12
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 +3 -3
- package/dist/{chunk-AY2IUF4K.js → chunk-22GLUHGE.js} +659 -73
- package/dist/{chunk-CIUHAHM6.js → chunk-2A24BNRZ.js} +8 -8
- package/dist/{chunk-2RX7PI2Y.js → chunk-2ELFEKOO.js} +4 -4
- package/dist/{chunk-QKEFZRHS.js → chunk-2P6IHSRO.js} +17 -17
- package/dist/chunk-2Q2YBAR5.js +40 -0
- package/dist/{chunk-7DUDLVFJ.js → chunk-2VQLFNBO.js} +20 -20
- package/dist/{chunk-E3Z67HRK.js → chunk-3256EDLL.js} +4 -4
- package/dist/{chunk-OIU657QQ.js → chunk-34BCKMBS.js} +4 -4
- package/dist/{chunk-UR7RMZ3R.js → chunk-34NWVIBC.js} +2 -2
- package/dist/{chunk-6VBXAGJX.js → chunk-36KD4OGC.js} +14 -14
- package/dist/{chunk-I7IWQIEB.js → chunk-3CFBU2O6.js} +4 -4
- package/dist/{chunk-OSGQW2Z6.js → chunk-3JLTN3Y7.js} +8 -8
- package/dist/{chunk-FOGG4AUR.js → chunk-3M7QBKKG.js} +25 -7
- package/dist/{chunk-UF7TAFJM.js → chunk-3RP34PYV.js} +18 -18
- package/dist/{chunk-YLAJAI2W.js → chunk-3ZKLWM5Y.js} +11 -11
- package/dist/{chunk-LTQANUDH.js → chunk-47HPZ34V.js} +25 -25
- package/dist/chunk-4BPROPGG.js +45 -0
- package/dist/{chunk-Y4BRGOJR.js → chunk-4G56W6H7.js} +13 -10
- package/dist/{chunk-YXJ4XOHF.js → chunk-4HIQ2FTI.js} +4 -4
- package/dist/{chunk-AJJK7GLO.js → chunk-4HTILEXW.js} +3 -3
- package/dist/{chunk-OJLRFGBP.js → chunk-4Q2PGM5T.js} +78 -15
- package/dist/{chunk-GR6YKM55.js → chunk-4RDW2X43.js} +108 -14
- package/dist/{chunk-23M2LUYM.js → chunk-4VOG5H2K.js} +1 -1
- package/dist/chunk-5CSZTVXH.js +34 -0
- package/dist/{chunk-65C57N7P.js → chunk-5FFMJMVH.js} +19 -19
- package/dist/{chunk-XNYNEEBR.js → chunk-5GGGAI5C.js} +18 -18
- package/dist/{chunk-IUD3ME4E.js → chunk-5H46QFSL.js} +4 -4
- package/dist/{chunk-KIHOIVST.js → chunk-5ION6STH.js} +3 -3
- package/dist/chunk-5M3CLAOV.js +39 -0
- package/dist/chunk-5OACMWWI.js +886 -0
- package/dist/{chunk-2HMWX4T6.js → chunk-6ENDKY52.js} +11 -11
- package/dist/{chunk-OS7PQ35Z.js → chunk-6FG7QKJC.js} +22 -22
- package/dist/{chunk-FEZE6NIA.js → chunk-6JV3YHRR.js} +18 -18
- package/dist/{chunk-WGZWR4RF.js → chunk-6ROZRBWH.js} +5 -5
- package/dist/{chunk-WARBF2KY.js → chunk-6S27MUQQ.js} +10 -6
- package/dist/{chunk-TZDSDDSV.js → chunk-72DY5NCN.js} +2 -2
- package/dist/chunk-76QVBNEM.js +37 -0
- package/dist/{chunk-N4QZJJVB.js → chunk-77UOXZVM.js} +5 -5
- package/dist/{chunk-LVGBKKSM.js → chunk-7AXMUE2U.js} +15 -15
- package/dist/{chunk-FJCFYKVO.js → chunk-7TEQF64E.js} +196 -76
- package/dist/{chunk-IDGSU7JF.js → chunk-7TH6I6TL.js} +9 -9
- package/dist/{chunk-ZONE6E3Z.js → chunk-7UKETVPW.js} +2 -2
- package/dist/{chunk-XKS6THI5.js → chunk-7VNEDDCC.js} +2 -2
- package/dist/{chunk-BMHGA7WD.js → chunk-A5GY2EWH.js} +12 -12
- package/dist/{chunk-E3JYO547.js → chunk-AEZ3EICK.js} +20 -20
- package/dist/{chunk-7F2RUWPU.js → chunk-ARLH2ZMD.js} +1 -1
- package/dist/{chunk-VKMTFIWS.js → chunk-AYVLEB55.js} +18 -18
- package/dist/chunk-B6X5PJSA.js +320 -0
- package/dist/{chunk-JMSEEBN4.js → chunk-BRCDEGNE.js} +1 -1
- package/dist/{chunk-67J3VZBA.js → chunk-BSVTNNUK.js} +5 -5
- package/dist/{chunk-3GTZ2OON.js → chunk-BTOGAUWX.js} +20 -11
- package/dist/{chunk-4SVJNVEE.js → chunk-BXBCMGIQ.js} +2 -0
- package/dist/chunk-BXP2Q4TD.js +48 -0
- package/dist/{chunk-XPEEICAO.js → chunk-BZRWJUB4.js} +15 -15
- package/dist/{chunk-MH5OCRUM.js → chunk-CH6LUQLD.js} +2 -2
- package/dist/{chunk-T6USVBEJ.js → chunk-CIIRPLI6.js} +5 -5
- package/dist/chunk-CJXM6SG4.js +339 -0
- package/dist/{chunk-5XDNUJ4P.js → chunk-CQD26SMZ.js} +4 -2
- package/dist/{chunk-7TGYNOXD.js → chunk-CW5SEPUT.js} +7 -7
- package/dist/{chunk-5KTOPOEP.js → chunk-CWSZP2LU.js} +25 -25
- package/dist/chunk-CXK27ZUY.js +32 -0
- package/dist/{chunk-YGKYFMSL.js → chunk-CXY4YDXS.js} +3 -3
- package/dist/{chunk-R64GLVBO.js → chunk-DDZZXVQ5.js} +10 -10
- package/dist/{chunk-7YYEKTYF.js → chunk-DGZXJO5I.js} +8 -8
- package/dist/{chunk-IV7BCWWN.js → chunk-DONCF2XC.js} +3 -3
- package/dist/{chunk-RRVT4MPS.js → chunk-DPNCAFMB.js} +18 -18
- package/dist/{chunk-UBWCUP3G.js → chunk-DQKNOHUZ.js} +2 -2
- package/dist/{chunk-NGPU2ARF.js → chunk-DW4BM73R.js} +1 -1
- package/dist/{chunk-PEF5OEMB.js → chunk-DWN7RSNQ.js} +4 -4
- package/dist/{chunk-KC5DROFC.js → chunk-DWYPYVPJ.js} +14 -14
- package/dist/{chunk-B7434AE2.js → chunk-E73QLYK7.js} +24 -3
- package/dist/{chunk-EX6ZXS5K.js → chunk-EE3UNC44.js} +4 -4
- package/dist/chunk-EJDZEK22.js +53 -0
- package/dist/{chunk-ISNZYKAS.js → chunk-ENZWVTTN.js} +21 -21
- package/dist/{chunk-ROTY5J2L.js → chunk-EREL3TQG.js} +1 -1
- package/dist/{chunk-ZZXF6OOJ.js → chunk-ESGIBN3S.js} +2 -2
- package/dist/{chunk-YGR6OCHQ.js → chunk-EU7VTBAI.js} +8 -14
- package/dist/chunk-F5GA6G3U.js +48 -0
- package/dist/{chunk-JAA53T23.js → chunk-F6FGIYPT.js} +20 -20
- package/dist/{chunk-NPCD54I7.js → chunk-FAET4BB6.js} +8 -5
- package/dist/{chunk-YPBQNJHA.js → chunk-FBFSTYAB.js} +8 -8
- package/dist/{chunk-OEI7LVRP.js → chunk-FEBYMFZA.js} +24 -24
- package/dist/chunk-FMV6IZ3P.js +54 -0
- package/dist/{chunk-F7UQR4ZX.js → chunk-FQ6IBYFC.js} +3 -3
- package/dist/{chunk-J5LHDJU4.js → chunk-FSJMFPA3.js} +7 -7
- package/dist/chunk-GFZ5MIQG.js +47 -0
- package/dist/{chunk-LK44ULGI.js → chunk-GHSVJNVL.js} +104 -11
- package/dist/{chunk-LRS573EX.js → chunk-GKPOCUQR.js} +12 -7
- package/dist/{chunk-LDKUC2QJ.js → chunk-GLSNVC67.js} +17 -17
- package/dist/{chunk-47QE246J.js → chunk-GMDOXWIS.js} +5 -5
- package/dist/{chunk-5MI2SEV5.js → chunk-GN5ZLSLD.js} +3 -3
- package/dist/{chunk-JQ7XQPQS.js → chunk-GUNBOZ75.js} +4 -4
- package/dist/{chunk-HHUFVJF7.js → chunk-GYS64N6F.js} +6 -6
- package/dist/{chunk-AKJTKMXU.js → chunk-HIQWJ6JZ.js} +5 -5
- package/dist/{chunk-6GNS32SI.js → chunk-HJ52XDST.js} +4 -4
- package/dist/{chunk-2KDSXJFJ.js → chunk-HJUEQERG.js} +34 -7
- package/dist/chunk-HKGQUOQ3.js +88 -0
- package/dist/chunk-HP32HUWR.js +41 -0
- package/dist/{chunk-R4TBNKKC.js → chunk-HY2VVVFZ.js} +1249 -610
- package/dist/{chunk-G5SFOH7P.js → chunk-I2PNEG3M.js} +38 -23
- package/dist/{chunk-Y5PZHS4K.js → chunk-INCECZ2E.js} +5 -5
- package/dist/{chunk-RK6MKKKP.js → chunk-ISXNWUG7.js} +1 -1
- package/dist/{chunk-73VPWF5R.js → chunk-ITJ7ST5E.js} +4 -4
- package/dist/{chunk-5IALSMZ2.js → chunk-J3VAFDEX.js} +14 -14
- package/dist/chunk-JGLZUQVN.js +29 -0
- package/dist/{chunk-5XN76FTF.js → chunk-JLIEAQP4.js} +5 -5
- package/dist/{chunk-MGVYVW7Q.js → chunk-JQG4VO47.js} +1 -1
- package/dist/chunk-JXXQHETS.js +130 -0
- package/dist/{chunk-APSVL2AI.js → chunk-KNGESBFW.js} +15 -15
- package/dist/{chunk-7UKVYFQ2.js → chunk-KUYA2E7M.js} +8 -8
- package/dist/{chunk-WLIIQ2A4.js → chunk-KY2ZHTBJ.js} +7 -7
- package/dist/{chunk-YPIEYQF4.js → chunk-L4UIKAWD.js} +6 -6
- package/dist/chunk-LDUJ6NIT.js +247 -0
- package/dist/{chunk-5YIBJXGB.js → chunk-LTLR4JZJ.js} +10 -10
- package/dist/{chunk-IZNSAEBX.js → chunk-MFRPLAOH.js} +2 -2
- package/dist/{chunk-6GWHKMQR.js → chunk-MH7UBG47.js} +4 -4
- package/dist/{chunk-4GZXS6S2.js → chunk-MLAACAES.js} +278 -17
- package/dist/{chunk-D3PO4DOZ.js → chunk-MMB2OHUY.js} +4 -2
- package/dist/{chunk-DDAHCPGA.js → chunk-MNCQ2GL7.js} +12 -12
- package/dist/{chunk-UYYN2IUZ.js → chunk-MNUZX67F.js} +6 -6
- package/dist/{chunk-YFSSNGLR.js → chunk-MQHYCS6A.js} +32 -29
- package/dist/{chunk-MKRBG5EF.js → chunk-MRLCNXXR.js} +1 -1
- package/dist/{chunk-BUYJL3GJ.js → chunk-NBQO75XT.js} +1 -1
- package/dist/{chunk-GXJVY6WT.js → chunk-NCONDPHH.js} +5 -5
- package/dist/{chunk-ZP4FJHR4.js → chunk-NHS55U7T.js} +18 -18
- package/dist/{chunk-CRE4BJHM.js → chunk-NL6XQZSV.js} +23 -23
- package/dist/{chunk-YVLMBAYE.js → chunk-NSJ6ZR2A.js} +3 -3
- package/dist/{chunk-XRO65C7V.js → chunk-NTNJNRHW.js} +8 -6
- package/dist/{chunk-FTV6I76U.js → chunk-NTTXTLCQ.js} +25 -25
- package/dist/chunk-NWL7XEQ4.js +37 -0
- package/dist/{chunk-CNKGYDMG.js → chunk-NWXY3B4R.js} +23 -23
- package/dist/{chunk-52R2YXP5.js → chunk-O5W4ECUY.js} +16 -16
- package/dist/{chunk-OGRWQ562.js → chunk-O6ILVBYB.js} +2 -2
- package/dist/{chunk-BJPMKJTL.js → chunk-OJAJXU65.js} +102 -2
- package/dist/{chunk-FZL2HNWP.js → chunk-OMH3I5BH.js} +3 -3
- package/dist/{chunk-MF7QH4AX.js → chunk-P6UJ22XR.js} +5 -5
- package/dist/{chunk-HE4ZQXZM.js → chunk-P76AW3PA.js} +309 -15
- package/dist/{chunk-GZ4TKR3Q.js → chunk-PCCPXWJC.js} +48 -139
- package/dist/{chunk-6TJCUYC5.js → chunk-PGFRXGHA.js} +3 -3
- package/dist/{chunk-NIXVDQVO.js → chunk-PJRMMWU4.js} +2 -2
- package/dist/{chunk-X4W4XXWP.js → chunk-PKJ3K3GM.js} +5 -5
- package/dist/{chunk-KM2FBM3T.js → chunk-PVW2N63M.js} +302 -55
- package/dist/{chunk-Y7KBQ4BD.js → chunk-Q55UP5EZ.js} +22 -22
- package/dist/{chunk-7URGP4DD.js → chunk-QAFMLBPF.js} +12 -12
- package/dist/{chunk-KIAI6PWL.js → chunk-QEZSA2O7.js} +17 -17
- package/dist/{chunk-PKCMRPPB.js → chunk-QJ3OX7OC.js} +33 -27
- package/dist/{chunk-6EDQE7GO.js → chunk-QL4VNY4U.js} +2 -2
- package/dist/{chunk-6JLPXDWN.js → chunk-QR65C3DV.js} +5 -5
- package/dist/{chunk-ILFKECGI.js → chunk-QXGOEP44.js} +4 -4
- package/dist/chunk-QY7RGTUP.js +326 -0
- package/dist/{chunk-PGKHJYOB.js → chunk-RA64IK43.js} +1 -1
- package/dist/{chunk-XB5RFZHH.js → chunk-RLJDYLID.js} +12 -12
- package/dist/{chunk-AWECWW5Y.js → chunk-RMLUZYEA.js} +13 -11
- package/dist/chunk-RSVBX6A3.js +54 -0
- package/dist/chunk-RZWZO2JQ.js +42 -0
- package/dist/chunk-S5LSDXV4.js +40 -0
- package/dist/{chunk-TM7LC37P.js → chunk-SAC6FNKR.js} +181 -117
- package/dist/{chunk-DPHCFZ7W.js → chunk-SCBU46AJ.js} +3 -3
- package/dist/{chunk-EZIUFEN6.js → chunk-SGNHNN3G.js} +12 -12
- package/dist/{chunk-XKZHAD6Y.js → chunk-SHAAGH3T.js} +15 -15
- package/dist/chunk-SK5OYWIY.js +122 -0
- package/dist/{chunk-FR7JPYBD.js → chunk-SNSFQ47W.js} +12 -12
- package/dist/{chunk-FV5YFR6I.js → chunk-SSL6JMPA.js} +9 -9
- package/dist/{chunk-XEG3FE2R.js → chunk-TA2ZNDYD.js} +1 -1
- package/dist/{chunk-JF2NSTFO.js → chunk-TEHH47TG.js} +3 -3
- package/dist/{chunk-W5OYJMBT.js → chunk-TEZSZ24W.js} +5 -5
- package/dist/{chunk-SS66Q4VE.js → chunk-TH526O6E.js} +12 -12
- package/dist/{chunk-R6B6XAKK.js → chunk-TIAPEYWI.js} +4 -4
- package/dist/chunk-TLCRIAU3.js +44 -0
- package/dist/{chunk-FMKKVWZD.js → chunk-TQYBXDVH.js} +2 -2
- package/dist/chunk-TV4CGNEY.js +43 -0
- package/dist/{chunk-QICFHVRW.js → chunk-TVSNWIAM.js} +8 -6
- package/dist/{chunk-CHC5FKTU.js → chunk-TWHZU36X.js} +1 -1
- package/dist/{chunk-BMCKL3VQ.js → chunk-TXV2AYZB.js} +24 -24
- package/dist/{chunk-577AJVRS.js → chunk-U25OX22K.js} +2039 -289
- package/dist/{chunk-7EKESFWV.js → chunk-U4NNG3ES.js} +11 -11
- package/dist/{chunk-XQ3YIV5R.js → chunk-U5T4A2QV.js} +6 -6
- package/dist/{chunk-2XM6PYQQ.js → chunk-UT5OA7KA.js} +43 -11
- package/dist/{chunk-BXIX7S7O.js → chunk-V3VCUSQ6.js} +15 -15
- package/dist/{chunk-4QUQEBFT.js → chunk-V5XV3JSP.js} +6 -6
- package/dist/{chunk-F7YL2RZ4.js → chunk-VF4VOPMB.js} +23 -23
- package/dist/{chunk-3QAKDIEU.js → chunk-VLDM4QZM.js} +23 -23
- package/dist/chunk-VP5H6DII.js +34 -0
- package/dist/{chunk-N3NBWIYQ.js → chunk-VRYQJZFL.js} +10 -9
- package/dist/{chunk-FQSRHTTC.js → chunk-VS6FS472.js} +15 -15
- package/dist/{chunk-YMOJD5BO.js → chunk-VTMIRRIZ.js} +3 -3
- package/dist/{chunk-4PJADZRR.js → chunk-VXSJKWB7.js} +16 -16
- package/dist/{chunk-MTAUZW2Z.js → chunk-WE5VMPUP.js} +216 -106
- package/dist/{chunk-ZE3P35DA.js → chunk-WEG7DY5K.js} +9 -9
- package/dist/{chunk-V2TH46ZY.js → chunk-WIF7A6JU.js} +12 -12
- package/dist/{chunk-GFXLPJWY.js → chunk-WM4N2L4T.js} +2 -2
- package/dist/{chunk-XIWYUQZQ.js → chunk-X64BFQ3R.js} +9 -9
- package/dist/{chunk-QWVBEK4P.js → chunk-XJRC3ZDI.js} +13 -13
- package/dist/{chunk-F2FOQLJ7.js → chunk-XVIVWG7B.js} +6 -6
- package/dist/{chunk-XTVDAHH2.js → chunk-Y3ZKT6IF.js} +5 -5
- package/dist/{chunk-62YMDXY6.js → chunk-YURIUFKF.js} +16 -16
- package/dist/{chunk-HKTUIMH4.js → chunk-YY2WGL6S.js} +3 -3
- package/dist/{chunk-BDEKREZH.js → chunk-Z2BA4NNR.js} +3 -3
- package/dist/{chunk-MTEBM4Y4.js → chunk-Z47YGBUY.js} +19 -12
- package/dist/chunk-Z4JSRKNR.js +41 -0
- package/dist/{chunk-G2E5MNYP.js → chunk-Z53ZB34U.js} +7 -7
- package/dist/{chunk-NNUASOAA.js → chunk-ZBOPIYOY.js} +12 -12
- package/dist/{chunk-7GB4ZRE2.js → chunk-ZBQCLKTH.js} +12 -12
- package/dist/chunk-ZGI7DNJ6.js +38 -0
- package/dist/{chunk-P3TKKBAH.js → chunk-ZPT4QX3J.js} +4 -4
- package/dist/chunk-ZS47PQ3O.js +41 -0
- package/dist/{chunk-PIVKU64W.js → chunk-ZTIMXVV5.js} +2 -2
- package/dist/{chunk-T4RTWMJD.js → chunk-ZYASEL7K.js} +5 -5
- package/dist/files.json +469 -417
- package/dist/packages/sdk/npm/index.js +2309 -1983
- package/dist/packages/ui/dist/assets/{elk-api-Mo5w5xCa.js → elk-api-D2NcYpUJ.js} +2 -2
- package/dist/packages/ui/dist/assets/{index-Bp3XhPHX.css → index-C0JEkXyN.css} +1 -1
- package/dist/packages/ui/dist/assets/index-CT7skl01.js +29 -0
- package/dist/packages/ui/dist/index.html +2 -2
- package/package.json +4 -4
- package/dist/chunk-26PLPSQW.js +0 -48
- package/dist/chunk-2G4DFUWJ.js +0 -43
- package/dist/chunk-2M6WXO73.js +0 -38
- package/dist/chunk-5F3RJCHB.js +0 -45
- package/dist/chunk-B2VSVN4P.js +0 -34
- package/dist/chunk-B3O52AUQ.js +0 -275
- package/dist/chunk-CITDNDIZ.js +0 -53
- package/dist/chunk-DAQBIK5G.js +0 -47
- package/dist/chunk-DZRQDNPT.js +0 -34
- package/dist/chunk-FLOEZA6K.js +0 -29
- package/dist/chunk-FNHSVBRA.js +0 -48
- package/dist/chunk-FPGVOSOG.js +0 -41
- package/dist/chunk-FZ2E5LGK.js +0 -54
- package/dist/chunk-HB6XSGI6.js +0 -131
- package/dist/chunk-HUZQDKQK.js +0 -48
- package/dist/chunk-L4VJ4ETL.js +0 -41
- package/dist/chunk-XPCWQXTY.js +0 -37
- package/dist/chunk-YIEOFHOL.js +0 -30
- package/dist/packages/ui/dist/assets/index-DM212ZbV.js +0 -29
|
@@ -0,0 +1,886 @@
|
|
|
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
|
+
mapCommand,
|
|
8
|
+
mapStateOf
|
|
9
|
+
} from "./chunk-7TEQF64E.js";
|
|
10
|
+
import {
|
|
11
|
+
factsRepos,
|
|
12
|
+
verifyCommand
|
|
13
|
+
} from "./chunk-BTOGAUWX.js";
|
|
14
|
+
import {
|
|
15
|
+
plannedTopUp,
|
|
16
|
+
recordRulesNow,
|
|
17
|
+
ruleSetsOfFiles
|
|
18
|
+
} from "./chunk-QY7RGTUP.js";
|
|
19
|
+
import "./chunk-ZS47PQ3O.js";
|
|
20
|
+
import {
|
|
21
|
+
estateFreshness
|
|
22
|
+
} from "./chunk-I2PNEG3M.js";
|
|
23
|
+
import {
|
|
24
|
+
onboardingQueue
|
|
25
|
+
} from "./chunk-SK5OYWIY.js";
|
|
26
|
+
import "./chunk-3CFBU2O6.js";
|
|
27
|
+
import "./chunk-HJUEQERG.js";
|
|
28
|
+
import "./chunk-B6X5PJSA.js";
|
|
29
|
+
import {
|
|
30
|
+
checkoutOf,
|
|
31
|
+
conventionsAt,
|
|
32
|
+
excludesOf,
|
|
33
|
+
headOf,
|
|
34
|
+
loadReadPlan,
|
|
35
|
+
readPlanProgress
|
|
36
|
+
} from "./chunk-P76AW3PA.js";
|
|
37
|
+
import "./chunk-7VNEDDCC.js";
|
|
38
|
+
import "./chunk-6S27MUQQ.js";
|
|
39
|
+
import "./chunk-EU7VTBAI.js";
|
|
40
|
+
import "./chunk-NCONDPHH.js";
|
|
41
|
+
import {
|
|
42
|
+
isMetarepo,
|
|
43
|
+
notMetarepo
|
|
44
|
+
} from "./chunk-3G4YI4ZU.js";
|
|
45
|
+
import {
|
|
46
|
+
assistantTier,
|
|
47
|
+
readProbes,
|
|
48
|
+
rulesLacking
|
|
49
|
+
} from "./chunk-GHSVJNVL.js";
|
|
50
|
+
import "./chunk-VOGCSYOI.js";
|
|
51
|
+
import {
|
|
52
|
+
estateRepos,
|
|
53
|
+
productionRepos
|
|
54
|
+
} from "./chunk-22GLUHGE.js";
|
|
55
|
+
import "./chunk-QR65C3DV.js";
|
|
56
|
+
import {
|
|
57
|
+
dirSource,
|
|
58
|
+
sameCommit,
|
|
59
|
+
sessionTokensFor
|
|
60
|
+
} from "./chunk-MLAACAES.js";
|
|
61
|
+
import "./chunk-HY2VVVFZ.js";
|
|
62
|
+
import "./chunk-PJRMMWU4.js";
|
|
63
|
+
import "./chunk-34NWVIBC.js";
|
|
64
|
+
import "./chunk-TWHZU36X.js";
|
|
65
|
+
import "./chunk-ARLH2ZMD.js";
|
|
66
|
+
import "./chunk-RA64IK43.js";
|
|
67
|
+
import "./chunk-MRLCNXXR.js";
|
|
68
|
+
import {
|
|
69
|
+
currentPromptLimit
|
|
70
|
+
} from "./chunk-CQD26SMZ.js";
|
|
71
|
+
import {
|
|
72
|
+
factsDirOf,
|
|
73
|
+
factsRelOf,
|
|
74
|
+
headFromFiles,
|
|
75
|
+
listQuestions,
|
|
76
|
+
loadOrgPack,
|
|
77
|
+
orgPackDirOf,
|
|
78
|
+
parseFacts,
|
|
79
|
+
require_dist
|
|
80
|
+
} from "./chunk-U25OX22K.js";
|
|
81
|
+
import {
|
|
82
|
+
ensureLocalIgnore,
|
|
83
|
+
writeFileAtomic
|
|
84
|
+
} from "./chunk-MMB2OHUY.js";
|
|
85
|
+
import {
|
|
86
|
+
__toESM
|
|
87
|
+
} from "./chunk-TV45EUGM.js";
|
|
88
|
+
|
|
89
|
+
// packages/cli/dist/map-all.js
|
|
90
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
91
|
+
import { existsSync } from "node:fs";
|
|
92
|
+
import { readFile, stat } from "node:fs/promises";
|
|
93
|
+
import { join } from "node:path";
|
|
94
|
+
var MAP_ALL_STATE_REL = ".atticus/map-all/state.json";
|
|
95
|
+
var statePath = (root) => join(root, ".atticus", "map-all", "state.json");
|
|
96
|
+
var REMIND_MS = 10 * 6e4;
|
|
97
|
+
var IDLE_MINUTES = 15;
|
|
98
|
+
var POLL_MS = 3e3;
|
|
99
|
+
var RETRIES = 3;
|
|
100
|
+
var plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
101
|
+
var tokensText = (n) => n.toLocaleString("en-US");
|
|
102
|
+
var firstLine = (e) => String(e?.message ?? e).split("\n")[0];
|
|
103
|
+
async function readMapAllState(root) {
|
|
104
|
+
const text = await readFile(statePath(root), "utf8").catch(() => void 0);
|
|
105
|
+
if (!text)
|
|
106
|
+
return void 0;
|
|
107
|
+
try {
|
|
108
|
+
const s = JSON.parse(text);
|
|
109
|
+
return s.schemaVersion === 1 && s.repos && typeof s.repos === "object" ? s : void 0;
|
|
110
|
+
} catch {
|
|
111
|
+
return void 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function saveState(root, s, now) {
|
|
115
|
+
s.updatedAt = new Date(now).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
116
|
+
await ensureLocalIgnore(root);
|
|
117
|
+
await writeFileAtomic(statePath(root), `${JSON.stringify(s, null, 2)}
|
|
118
|
+
`);
|
|
119
|
+
}
|
|
120
|
+
function modelModeAllowed(op) {
|
|
121
|
+
const rt = op.runtime;
|
|
122
|
+
return rt.ai !== "off" && rt.modes.allowed.includes("model") && !!rt.adapters.model && rt.adapters.model.type !== "mock";
|
|
123
|
+
}
|
|
124
|
+
async function limitFor(root, op, given) {
|
|
125
|
+
const flag = given ?? currentPromptLimit();
|
|
126
|
+
if (flag !== void 0)
|
|
127
|
+
return { limit: flag, from: "flag" };
|
|
128
|
+
const maxInput = op.runtime.adapters.model?.settings.maxInput;
|
|
129
|
+
if (typeof maxInput === "number")
|
|
130
|
+
return { limit: maxInput, from: "runtime.yaml" };
|
|
131
|
+
const tier = assistantTier(op.runtime, { probes: (await readProbes(root)).results });
|
|
132
|
+
if (tier.maxTokensFrom === "probe" && tier.maxTokens !== void 0)
|
|
133
|
+
return { limit: tier.maxTokens, from: "probe" };
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
function captured() {
|
|
137
|
+
const lines = [];
|
|
138
|
+
const errs = [];
|
|
139
|
+
return { lines, errs, out: (l) => lines.push(l), err: (l) => errs.push(l) };
|
|
140
|
+
}
|
|
141
|
+
function jsonOf(lines) {
|
|
142
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
143
|
+
const l = lines[i].trimStart();
|
|
144
|
+
if (!l.startsWith("{"))
|
|
145
|
+
continue;
|
|
146
|
+
try {
|
|
147
|
+
return JSON.parse(lines.slice(i).join("\n"));
|
|
148
|
+
} catch {
|
|
149
|
+
try {
|
|
150
|
+
return JSON.parse(l);
|
|
151
|
+
} catch {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
async function commitOf(root, repo, f) {
|
|
159
|
+
if (f?.head)
|
|
160
|
+
return f.head;
|
|
161
|
+
const dir = await checkoutOf(root, repo).catch(() => void 0);
|
|
162
|
+
if (!dir || !existsSync(dir))
|
|
163
|
+
return void 0;
|
|
164
|
+
return await headFromFiles(dir) ?? await headOf(dir);
|
|
165
|
+
}
|
|
166
|
+
async function partsOf(root, repo, commit, limit, git) {
|
|
167
|
+
const io = captured();
|
|
168
|
+
const code = await mapCommand(root, repo, { estimate: true, json: true, commit, maxTokens: limit }, io, git ? { git } : {});
|
|
169
|
+
const r = code === 0 ? jsonOf(io.lines) : void 0;
|
|
170
|
+
if (!r)
|
|
171
|
+
return io.errs[0] ?? `atticus map ${repo} --estimate didn't plan it`;
|
|
172
|
+
const planned = r.parts.parts;
|
|
173
|
+
const batches = r.batches ?? void 0;
|
|
174
|
+
if (!planned.length)
|
|
175
|
+
return {
|
|
176
|
+
parts: [{ part: 1, total: 1, paths: [], files: r.files, tokens: r.tokens }],
|
|
177
|
+
total: 1,
|
|
178
|
+
tokens: r.tokens,
|
|
179
|
+
...batches !== void 0 ? { batches } : {}
|
|
180
|
+
};
|
|
181
|
+
const states = r.parts.plan?.parts ?? [];
|
|
182
|
+
const parts = planned.map((p, i) => ({ part: i + 1, total: planned.length, ...p })).filter((p) => states.find((s) => s.part === p.part)?.state !== "done");
|
|
183
|
+
return {
|
|
184
|
+
parts,
|
|
185
|
+
total: planned.length,
|
|
186
|
+
tokens: parts.reduce((n, p) => n + p.tokens, 0),
|
|
187
|
+
...batches !== void 0 ? { batches } : {}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async function rulesPartsOf(root, repo, commit, limit, o = {}) {
|
|
191
|
+
const dir = await checkoutOf(root, repo).catch(() => void 0);
|
|
192
|
+
if (!dir)
|
|
193
|
+
return "no clone to read: atticus workspace sync clones it";
|
|
194
|
+
const p = await plannedTopUp(root, repo, {
|
|
195
|
+
commit,
|
|
196
|
+
source: dirSource(dir),
|
|
197
|
+
exclude: await excludesOf(root, repo),
|
|
198
|
+
conventions: await conventionsAt(root),
|
|
199
|
+
session: sessionTokensFor(limit),
|
|
200
|
+
...o.save ? {} : { dryRun: true }
|
|
201
|
+
});
|
|
202
|
+
if ("error" in p)
|
|
203
|
+
return p.error;
|
|
204
|
+
const sessions = p.topUp?.sessions ?? [];
|
|
205
|
+
const parts = sessions.map((x, i) => ({
|
|
206
|
+
part: i + 1,
|
|
207
|
+
total: sessions.length,
|
|
208
|
+
paths: x.paths,
|
|
209
|
+
files: x.files,
|
|
210
|
+
tokens: x.tokens,
|
|
211
|
+
done: !!x.done
|
|
212
|
+
})).filter((x) => !x.done).map(({ done: _d, ...x }) => x);
|
|
213
|
+
return { parts, total: sessions.length, sets: ruleSetsOfFiles(sessions) };
|
|
214
|
+
}
|
|
215
|
+
async function planEstate(root, op, o, c, state) {
|
|
216
|
+
const all = estateRepos(op).map((r) => r.id);
|
|
217
|
+
const production = new Set(productionRepos(op).map((r) => r.id));
|
|
218
|
+
if (o.repos) {
|
|
219
|
+
const unknown = o.repos.filter((r) => !all.includes(r));
|
|
220
|
+
if (unknown.length)
|
|
221
|
+
return `No repo ${unknown.join(", ")} in the manifests (org-pack/profiles/*/repos.manifest.yaml).`;
|
|
222
|
+
}
|
|
223
|
+
const ids = o.repos ? all.filter((r) => o.repos.includes(r)) : all;
|
|
224
|
+
const fresh = await estateFreshness(root, { repos: ids, ...c.git ? { git: c.git } : {} });
|
|
225
|
+
const byId = new Map(fresh.repos.map((r) => [r.repo, r]));
|
|
226
|
+
const skipped = [];
|
|
227
|
+
const todo = [];
|
|
228
|
+
for (const repo of ids) {
|
|
229
|
+
const f = byId.get(repo);
|
|
230
|
+
const commit = await commitOf(root, repo, f);
|
|
231
|
+
if (!commit || f?.state === "no-checkout") {
|
|
232
|
+
skipped.push({ repo, why: "no clone to read: atticus workspace sync clones it" });
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const state2 = f?.state ?? "not-read";
|
|
236
|
+
if (o.gaps) {
|
|
237
|
+
if (state2 === "not-read")
|
|
238
|
+
skipped.push({ repo, why: "not read yet: the gaps pass follows a read" });
|
|
239
|
+
else if (state2 === "stale" || state2 === "unknown-commit")
|
|
240
|
+
skipped.push({
|
|
241
|
+
repo,
|
|
242
|
+
why: "its clone moved past its facts: atticus map --all --stale reads what changed first"
|
|
243
|
+
});
|
|
244
|
+
else if (isDone(repo, commit))
|
|
245
|
+
skipped.push({ repo, why: "its gaps pass is done at this commit" });
|
|
246
|
+
else
|
|
247
|
+
todo.push({ repo, kind: "gaps", commit, why: "the second pass on what its read left" });
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (state2 === "stale" || state2 === "unknown-commit") {
|
|
251
|
+
todo.push({
|
|
252
|
+
repo,
|
|
253
|
+
kind: "reread",
|
|
254
|
+
commit,
|
|
255
|
+
why: state2 === "stale" ? `its clone moved past its facts: ${plural(f.reread, "fact")} to read again, ${plural(f.toRead, "file")} to read` : "the clone lacks the commit its facts were read at: read whole again",
|
|
256
|
+
started: true
|
|
257
|
+
});
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (state2 === "rules-changed") {
|
|
261
|
+
const progress = await readPlanProgress(root, repo, { commit });
|
|
262
|
+
todo.push(progress && !progress.stale && progress.next ? {
|
|
263
|
+
repo,
|
|
264
|
+
kind: "read",
|
|
265
|
+
commit,
|
|
266
|
+
why: `its read is under way: ${progress.done} of ${progress.total} parts read`,
|
|
267
|
+
started: true
|
|
268
|
+
} : { repo, kind: "rules", commit, why: "", started: true });
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (state2 === "moved") {
|
|
272
|
+
todo.push({
|
|
273
|
+
repo,
|
|
274
|
+
kind: "carry",
|
|
275
|
+
commit,
|
|
276
|
+
why: "its clone moved, but nothing its facts cite changed: verify carries them",
|
|
277
|
+
started: true
|
|
278
|
+
});
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (o.stale) {
|
|
282
|
+
skipped.push({
|
|
283
|
+
repo,
|
|
284
|
+
why: state2 === "fresh" ? "fresh" : "not read yet (atticus map --all reads it)"
|
|
285
|
+
});
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (state2 === "fresh") {
|
|
289
|
+
const progress = await readPlanProgress(root, repo, { commit });
|
|
290
|
+
if (progress && !progress.stale && progress.next) {
|
|
291
|
+
todo.push({
|
|
292
|
+
repo,
|
|
293
|
+
kind: "read",
|
|
294
|
+
commit,
|
|
295
|
+
why: `its read is under way: ${progress.done} of ${progress.total} parts read`,
|
|
296
|
+
started: true
|
|
297
|
+
});
|
|
298
|
+
} else
|
|
299
|
+
skipped.push({ repo, why: "read and fresh" });
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
todo.push({ repo, kind: "read", commit, why: "not read yet" });
|
|
303
|
+
}
|
|
304
|
+
const prod = todo.filter((t) => production.has(t.repo));
|
|
305
|
+
const q = await onboardingQueue(root, prod.map((t) => ({ repo: t.repo, ...t.started ? { started: true } : {} })));
|
|
306
|
+
const ordered = [
|
|
307
|
+
...q.queue.map((x) => prod.find((t) => t.repo === x.repo)),
|
|
308
|
+
...todo.filter((t) => !production.has(t.repo))
|
|
309
|
+
];
|
|
310
|
+
const items = [];
|
|
311
|
+
for (const t of ordered) {
|
|
312
|
+
const base = {
|
|
313
|
+
repo: t.repo,
|
|
314
|
+
kind: t.kind,
|
|
315
|
+
commit: t.commit,
|
|
316
|
+
why: t.why,
|
|
317
|
+
...production.has(t.repo) ? {} : { prototype: true }
|
|
318
|
+
};
|
|
319
|
+
if (t.kind === "carry") {
|
|
320
|
+
items.push({ ...base, parts: [], total: 0, tokens: 0 });
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
if (t.kind === "rules") {
|
|
324
|
+
const p2 = await rulesPartsOf(root, t.repo, t.commit, c.limit);
|
|
325
|
+
if (typeof p2 === "string") {
|
|
326
|
+
skipped.push({ repo: t.repo, why: p2 });
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
items.push({
|
|
330
|
+
...base,
|
|
331
|
+
why: p2.sets.length ? `read before these reading rules: ${p2.sets.join(", ")}` : "read before the reading rules there are now, but no file of it is one they apply to: recorded as read under them",
|
|
332
|
+
sets: p2.sets,
|
|
333
|
+
parts: p2.parts,
|
|
334
|
+
total: p2.total,
|
|
335
|
+
tokens: p2.parts.reduce((n, x) => n + x.tokens, 0)
|
|
336
|
+
});
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
if (t.kind === "gaps") {
|
|
340
|
+
items.push({
|
|
341
|
+
...base,
|
|
342
|
+
parts: [{ part: 1, total: 1, paths: [], files: 0, tokens: 0 }],
|
|
343
|
+
total: 1,
|
|
344
|
+
tokens: 0
|
|
345
|
+
});
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
const p = await partsOf(root, t.repo, t.commit, c.limit, c.git);
|
|
349
|
+
if (typeof p === "string") {
|
|
350
|
+
skipped.push({ repo: t.repo, why: p });
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (c.mode === "model" && p.batches === void 0) {
|
|
354
|
+
skipped.push({
|
|
355
|
+
repo: t.repo,
|
|
356
|
+
why: `a model of ${c.limit} tokens leaves too little room for its files beside the instructions`
|
|
357
|
+
});
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (!p.parts.length) {
|
|
361
|
+
skipped.push({ repo: t.repo, why: "every part of its read plan is read" });
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
items.push({ ...base, ...p });
|
|
365
|
+
}
|
|
366
|
+
return { limit: c.limit, limitFrom: c.limitFrom, mode: c.mode, items, skipped };
|
|
367
|
+
function isDone(repo, commit) {
|
|
368
|
+
const r = state?.repos[repo];
|
|
369
|
+
return !!r?.done && r.kind === "gaps" && sameCommit(r.commit, commit);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function planLines(plan) {
|
|
373
|
+
const out = [];
|
|
374
|
+
const reading = plan.items.filter((i) => i.kind !== "carry");
|
|
375
|
+
const parts = reading.reduce((n, i) => n + i.parts.length, 0);
|
|
376
|
+
const planned = reading.reduce((n, i) => n + Math.max(i.total, i.parts.length), 0);
|
|
377
|
+
const tokens = reading.reduce((n, i) => n + i.tokens, 0);
|
|
378
|
+
out.push(`The estate at ${tokensText(plan.limit)} tokens a prompt (${plan.limitFrom === "flag" ? "--max-tokens" : plan.limitFrom === "probe" ? "the limit atticus probe measured" : "runtime.yaml's maxInput"}), ${plan.mode === "model" ? "read by runtime.yaml's model, unattended" : "read by Copilot Chat in agent mode: you paste one line per part"}:`);
|
|
379
|
+
plan.items.forEach((i, n) => {
|
|
380
|
+
const head = ` ${n + 1}. ${i.repo}${i.prototype ? " (prototype: read, never joined)" : ""}`;
|
|
381
|
+
if (i.kind === "carry" || i.kind === "rules" && !i.parts.length)
|
|
382
|
+
return out.push(`${head}: ${i.why}.`);
|
|
383
|
+
if (i.kind === "rules")
|
|
384
|
+
out.push(`${head}: top-up for the reading rules added since it was read (${(i.sets ?? []).join(", ")}); ${plural(i.parts.length, "part")}${i.parts.length < i.total ? ` of ${i.total}` : ""}, about ${tokensText(i.tokens)} tokens.`);
|
|
385
|
+
if (i.kind === "rules") {
|
|
386
|
+
if (i.total > 1)
|
|
387
|
+
for (const p of i.parts)
|
|
388
|
+
out.push(` part ${p.part} of ${p.total} (about ${tokensText(p.tokens)} tokens, ${plural(p.files, "file")}): ${p.paths.join(", ")}`);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (i.kind === "gaps")
|
|
392
|
+
return out.push(`${head}: ${i.why}, planned when it starts.`);
|
|
393
|
+
out.push(`${head}: ${i.kind === "reread" ? "re-read" : "read"}, ${i.why}; ${plural(i.parts.length, "part")}${i.parts.length < i.total ? ` of ${i.total}` : ""}, about ${tokensText(i.tokens)} tokens${plan.mode === "model" && i.batches !== void 0 ? `, ${plural(i.batches, "prompt")}` : ""}.`);
|
|
394
|
+
if (i.total > 1)
|
|
395
|
+
for (const p of i.parts)
|
|
396
|
+
out.push(` part ${p.part} of ${p.total} (about ${tokensText(p.tokens)} tokens, ${plural(p.files, "file")}): ${p.paths.join(", ")}`);
|
|
397
|
+
});
|
|
398
|
+
for (const s of plan.skipped)
|
|
399
|
+
out.push(` - ${s.repo}: skipped, ${s.why}.`);
|
|
400
|
+
out.push(plan.items.length ? `In all: ${plural(plan.items.length, "repo")}, ${plural(parts, "part")} to read${planned > parts ? ` (of ${planned} planned; ${planned - parts} ${planned - parts === 1 ? "is" : "are"} read already)` : ""}, about ${tokensText(tokens)} tokens (estimated from the source, not metered). Then atticus verify --all --write joins the estate once.` : "Nothing to read: every repo is read and fresh, or skipped as said.");
|
|
401
|
+
return out;
|
|
402
|
+
}
|
|
403
|
+
var mtime = async (p) => (await stat(p).catch(() => void 0))?.mtimeMs;
|
|
404
|
+
async function snapOf(root, repo) {
|
|
405
|
+
const dir = factsDirOf(root);
|
|
406
|
+
const [facts, reviewed, verify] = await Promise.all([
|
|
407
|
+
mtime(join(dir, `${repo}.jsonl`)),
|
|
408
|
+
mtime(join(dir, `${repo}.reviewed.jsonl`)),
|
|
409
|
+
mtime(join(dir, `${repo}.verify.yaml`))
|
|
410
|
+
]);
|
|
411
|
+
return {
|
|
412
|
+
...facts !== void 0 ? { facts } : {},
|
|
413
|
+
...reviewed !== void 0 ? { reviewed } : {},
|
|
414
|
+
...verify !== void 0 ? { verify } : {}
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
var sameSnap = (a, b) => a.facts === b.facts && a.reviewed === b.reviewed && a.verify === b.verify;
|
|
418
|
+
async function factsAt(root, repo, commit) {
|
|
419
|
+
const text = await readFile(join(factsDirOf(root), `${repo}.jsonl`), "utf8").catch(() => "");
|
|
420
|
+
if (!text.trim())
|
|
421
|
+
return 0;
|
|
422
|
+
const p = parseFacts(text);
|
|
423
|
+
return p.ok ? p.facts.filter((f) => sameCommit(f.commit, commit)).length : 0;
|
|
424
|
+
}
|
|
425
|
+
async function settled(root, repo, commit, s, since) {
|
|
426
|
+
if (s.verify === void 0 || s.verify === since.verify)
|
|
427
|
+
return false;
|
|
428
|
+
if (s.verify < (s.facts ?? 0) || s.verify < (s.reviewed ?? 0))
|
|
429
|
+
return false;
|
|
430
|
+
const text = await readFile(join(factsDirOf(root), `${repo}.verify.yaml`), "utf8").catch(() => "");
|
|
431
|
+
try {
|
|
432
|
+
const v = (0, import_yaml.parse)(text) ?? {};
|
|
433
|
+
return v.rejected === 0 && (!v.commit || sameCommit(v.commit, commit));
|
|
434
|
+
} catch {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
async function covered(root, item, part, first, now) {
|
|
439
|
+
if (item.kind === "rules") {
|
|
440
|
+
const plan = await loadReadPlan(root, item.repo);
|
|
441
|
+
if (!plan?.topUp)
|
|
442
|
+
return rulesLacking(plan?.rules).length === 0;
|
|
443
|
+
return !!plan.topUp.sessions[part.part - 1]?.done;
|
|
444
|
+
}
|
|
445
|
+
if (item.total > 1) {
|
|
446
|
+
const p = await readPlanProgress(root, item.repo);
|
|
447
|
+
return p?.parts.find((x) => x.part === part.part)?.state === "done";
|
|
448
|
+
}
|
|
449
|
+
const moved = now.facts !== first.facts || now.reviewed !== first.reviewed;
|
|
450
|
+
if (item.kind === "read")
|
|
451
|
+
return moved || now.reviewed !== void 0 || await factsAt(root, item.repo, item.commit) > 0;
|
|
452
|
+
return moved;
|
|
453
|
+
}
|
|
454
|
+
var CapReached = class extends Error {
|
|
455
|
+
};
|
|
456
|
+
function capped(inner, o, spent) {
|
|
457
|
+
const over = () => o.maxParts !== void 0 && spent.prompts >= o.maxParts || o.budgetTokens !== void 0 && spent.tokens >= o.budgetTokens;
|
|
458
|
+
const estimated = /* @__PURE__ */ new Map();
|
|
459
|
+
return {
|
|
460
|
+
kind: inner.kind,
|
|
461
|
+
prepare: async (r) => {
|
|
462
|
+
if (over())
|
|
463
|
+
throw new CapReached();
|
|
464
|
+
spent.prompts++;
|
|
465
|
+
const run = await inner.prepare(r);
|
|
466
|
+
const est = r.pack.manifest.totalTokens;
|
|
467
|
+
estimated.set(run.runId, est);
|
|
468
|
+
spent.tokens += est;
|
|
469
|
+
return run;
|
|
470
|
+
},
|
|
471
|
+
run: async (id, signal) => {
|
|
472
|
+
const run = await inner.run(id, signal);
|
|
473
|
+
const u = run.usage;
|
|
474
|
+
if (u)
|
|
475
|
+
spent.tokens += u.inputTokens + u.outputTokens - (estimated.get(id) ?? 0);
|
|
476
|
+
estimated.delete(id);
|
|
477
|
+
return run;
|
|
478
|
+
},
|
|
479
|
+
result: (id) => inner.result(id)
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
async function mapAllCommand(root, o, io, deps = {}) {
|
|
483
|
+
if (!isMetarepo(root)) {
|
|
484
|
+
io.err(notMetarepo(root));
|
|
485
|
+
return 2;
|
|
486
|
+
}
|
|
487
|
+
const clock = deps.clock ?? {
|
|
488
|
+
now: () => Date.now(),
|
|
489
|
+
sleep: (ms) => new Promise((r) => setTimeout(r, ms))
|
|
490
|
+
};
|
|
491
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
492
|
+
const lim = await limitFor(root, op, o.maxTokens);
|
|
493
|
+
if (!lim) {
|
|
494
|
+
io.err("Atticus doesn't know your model's limit, and a part planned too big overflows the reader: pass --max-tokens <n> (the context window of the model Copilot Chat uses, in tokens), or set maxInput under adapters.model in runtime.yaml.");
|
|
495
|
+
return 2;
|
|
496
|
+
}
|
|
497
|
+
const limit = lim.limit;
|
|
498
|
+
const allowed = modelModeAllowed(op);
|
|
499
|
+
const mode = o.mode ?? (allowed ? "model" : "copilot");
|
|
500
|
+
if (mode === "model" && !allowed && !deps.runtime) {
|
|
501
|
+
io.err("runtime.yaml doesn't allow model mode with a provider here: map the estate through Copilot (atticus map --all without --mode model).");
|
|
502
|
+
return 2;
|
|
503
|
+
}
|
|
504
|
+
if (mode === "model" && o.gaps) {
|
|
505
|
+
io.err("The gaps pass is a session for an assistant that opens files: run atticus map --all --gaps --mode hand-off and paste each line into Copilot Chat.");
|
|
506
|
+
return 2;
|
|
507
|
+
}
|
|
508
|
+
let state = await readMapAllState(root);
|
|
509
|
+
if (state && (state.gaps !== !!o.gaps || state.mode !== mode))
|
|
510
|
+
state = void 0;
|
|
511
|
+
const plan = await planEstate(root, op, o, { limit: lim.limit, limitFrom: lim.from, mode, ...deps.git ? { git: deps.git } : {} }, state);
|
|
512
|
+
if (typeof plan === "string") {
|
|
513
|
+
io.err(plan);
|
|
514
|
+
return 2;
|
|
515
|
+
}
|
|
516
|
+
if (o.dryRun) {
|
|
517
|
+
if (o.json)
|
|
518
|
+
io.out(JSON.stringify(plan, null, 2));
|
|
519
|
+
else
|
|
520
|
+
for (const l of planLines(plan))
|
|
521
|
+
io.out(l);
|
|
522
|
+
return 0;
|
|
523
|
+
}
|
|
524
|
+
for (const l of planLines(plan))
|
|
525
|
+
io.out(l);
|
|
526
|
+
const st = state ?? {
|
|
527
|
+
schemaVersion: 1,
|
|
528
|
+
updatedAt: "",
|
|
529
|
+
mode,
|
|
530
|
+
gaps: !!o.gaps,
|
|
531
|
+
repos: {}
|
|
532
|
+
};
|
|
533
|
+
const save = () => saveState(root, st, clock.now());
|
|
534
|
+
await save();
|
|
535
|
+
const totals = {
|
|
536
|
+
parts: 0,
|
|
537
|
+
repos: /* @__PURE__ */ new Set(),
|
|
538
|
+
rejected: /* @__PURE__ */ new Map(),
|
|
539
|
+
added: 0,
|
|
540
|
+
removed: 0,
|
|
541
|
+
ends: [],
|
|
542
|
+
spent: { prompts: 0, tokens: 0 }
|
|
543
|
+
};
|
|
544
|
+
const stopped = () => deps.signal?.aborted === true;
|
|
545
|
+
const repoState = (item) => {
|
|
546
|
+
const r = st.repos[item.repo];
|
|
547
|
+
if (r && sameCommit(r.commit, item.commit) && r.kind === item.kind)
|
|
548
|
+
return r;
|
|
549
|
+
return st.repos[item.repo] = { commit: item.commit, kind: item.kind, parts: {} };
|
|
550
|
+
};
|
|
551
|
+
const partState = (item, part) => repoState(item).parts[String(part)] ??= { retries: 0 };
|
|
552
|
+
const verifyStep = async (item) => {
|
|
553
|
+
const c = captured();
|
|
554
|
+
await verifyCommand(root, item.repo, { commit: item.commit, write: true, json: true }, c);
|
|
555
|
+
const v = jsonOf(c.lines);
|
|
556
|
+
if (!v) {
|
|
557
|
+
io.out(`${item.repo}: verify didn't run: ${c.errs[0] ?? "no report"}`);
|
|
558
|
+
return void 0;
|
|
559
|
+
}
|
|
560
|
+
const links = v.written?.links;
|
|
561
|
+
totals.rejected.set(item.repo, v.rejected);
|
|
562
|
+
if (links) {
|
|
563
|
+
totals.added += links.added.length;
|
|
564
|
+
totals.removed += links.removed.length;
|
|
565
|
+
}
|
|
566
|
+
io.out(`${item.repo}: ${plural(v.accepted, "fact")} kept, ${v.rejected} rejected; coverage ${Math.round(v.coverage.ratio * 100)}% (${v.coverage.unknown.length} files no fact cites yet)${links ? `; links +${links.added.length} -${links.removed.length}` : ""}; ${plural(v.questions?.open ?? 0, "question")} open. ${v.rejected ? `Nothing written to the catalog until the rejected facts are fixed (${factsRelOf(root)}/${item.repo}.rejected.jsonl).` : v.written ? "Written to the catalog." : ""}`.trimEnd());
|
|
567
|
+
return v;
|
|
568
|
+
};
|
|
569
|
+
let quit = false;
|
|
570
|
+
let capHit = false;
|
|
571
|
+
let runtime;
|
|
572
|
+
const items = plan.items;
|
|
573
|
+
for (const [n, item] of items.entries()) {
|
|
574
|
+
if (quit || stopped())
|
|
575
|
+
break;
|
|
576
|
+
const where = `repo ${n + 1} of ${items.length}`;
|
|
577
|
+
if (item.kind === "rules" && !item.parts.length) {
|
|
578
|
+
io.out("");
|
|
579
|
+
io.out(`===== ${item.repo} (${where}): ${item.why} =====`);
|
|
580
|
+
await recordRulesNow(root, item.repo, item.commit);
|
|
581
|
+
repoState(item).done = true;
|
|
582
|
+
totals.repos.add(item.repo);
|
|
583
|
+
await save();
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
586
|
+
if (item.kind === "carry") {
|
|
587
|
+
io.out("");
|
|
588
|
+
io.out(`===== ${item.repo} (${where}): ${item.why} =====`);
|
|
589
|
+
const v = await verifyStep(item);
|
|
590
|
+
if (v && !v.rejected) {
|
|
591
|
+
repoState(item).done = true;
|
|
592
|
+
totals.repos.add(item.repo);
|
|
593
|
+
}
|
|
594
|
+
await save();
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if (mode === "model") {
|
|
598
|
+
runtime ??= deps.runtime ?? await deps.makeRuntime?.();
|
|
599
|
+
if (!runtime) {
|
|
600
|
+
io.err("No model runtime: model mode needs runtime.yaml's provider.");
|
|
601
|
+
return 2;
|
|
602
|
+
}
|
|
603
|
+
const r = await modelRead(item, where, capped(runtime, o, totals.spent));
|
|
604
|
+
if (r === "cap") {
|
|
605
|
+
capHit = true;
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
for (const part of item.parts) {
|
|
611
|
+
if (quit || stopped())
|
|
612
|
+
break;
|
|
613
|
+
const end = await copilotPart(item, part, where);
|
|
614
|
+
if (end === "quit") {
|
|
615
|
+
quit = true;
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
const interrupted = quit || stopped() || capHit;
|
|
621
|
+
if (interrupted) {
|
|
622
|
+
io.out("");
|
|
623
|
+
io.out(capHit ? `Stopped at the cap (${o.maxParts !== void 0 ? `--max-parts ${o.maxParts}` : ""}${o.maxParts !== void 0 && o.budgetTokens !== void 0 ? ", " : ""}${o.budgetTokens !== void 0 ? `--budget-tokens ${o.budgetTokens}` : ""}): ${plural(totals.spent.prompts, "prompt")} run. atticus map --all carries on from here.` : "Stopped. Where the estate stands is saved: atticus map --all carries on from here.");
|
|
624
|
+
} else if (totals.parts || totals.repos.size) {
|
|
625
|
+
io.out("");
|
|
626
|
+
io.out("Joining the estate: atticus verify --all --write.");
|
|
627
|
+
const repos = await factsRepos(root);
|
|
628
|
+
let passed = 0;
|
|
629
|
+
for (const repo of repos) {
|
|
630
|
+
const c = captured();
|
|
631
|
+
const code = await verifyCommand(root, repo, { write: true, json: true }, c);
|
|
632
|
+
const v = jsonOf(c.lines);
|
|
633
|
+
if (code === 0)
|
|
634
|
+
passed++;
|
|
635
|
+
if (v?.written?.links) {
|
|
636
|
+
totals.added += v.written.links.added.length;
|
|
637
|
+
totals.removed += v.written.links.removed.length;
|
|
638
|
+
}
|
|
639
|
+
if (v)
|
|
640
|
+
totals.rejected.set(repo, v.rejected);
|
|
641
|
+
}
|
|
642
|
+
io.out(`Verified ${plural(repos.length, "repo")}: ${passed} passed${repos.length - passed ? `, ${repos.length - passed} with something to fix` : ""}.`);
|
|
643
|
+
}
|
|
644
|
+
await save();
|
|
645
|
+
await summary(interrupted);
|
|
646
|
+
return 0;
|
|
647
|
+
async function copilotPart(item, part, where) {
|
|
648
|
+
const ps = partState(item, part.part);
|
|
649
|
+
const nth = item.parts.indexOf(part) + 1;
|
|
650
|
+
const label = item.total > 1 ? `part ${part.part} of ${item.total}${item.parts.length < item.total && nth > 0 ? `, ${nth} of the ${item.parts.length} to read` : ""}` : "one session";
|
|
651
|
+
const progress = item.total > 1 ? await readPlanProgress(root, item.repo) : void 0;
|
|
652
|
+
const first0 = item.kind === "rules" ? await rulesLine(item) : item.kind === "gaps" ? await gapsLine(item) : ps.retries > 0 || progress?.next && progress.next.part !== part.part ? await restLine(item, part) ?? `/atticus-map ${item.repo}` : `/atticus-map ${item.repo}`;
|
|
653
|
+
if (first0 === void 0) {
|
|
654
|
+
io.out(`${item.repo}: no gaps left; nothing to read.`);
|
|
655
|
+
return finishPart(item, part, ps);
|
|
656
|
+
}
|
|
657
|
+
if (first0 === "done")
|
|
658
|
+
return finishPart(item, part, ps);
|
|
659
|
+
let line = first0;
|
|
660
|
+
await block(item, part, label, where, line, ps.retries);
|
|
661
|
+
let first = await snapOf(root, item.repo);
|
|
662
|
+
let since = first;
|
|
663
|
+
let prev = first;
|
|
664
|
+
let lastChange = clock.now();
|
|
665
|
+
let lastRemind = clock.now();
|
|
666
|
+
const started = clock.now();
|
|
667
|
+
let stuckSaid = false;
|
|
668
|
+
const idleMs = (o.idleMinutes ?? IDLE_MINUTES) * 6e4;
|
|
669
|
+
for (; ; ) {
|
|
670
|
+
if (stopped()) {
|
|
671
|
+
ps.state = "incomplete";
|
|
672
|
+
await save();
|
|
673
|
+
return "quit";
|
|
674
|
+
}
|
|
675
|
+
const typed = deps.input?.take()?.trim().toLowerCase();
|
|
676
|
+
if (typed === "q") {
|
|
677
|
+
ps.state = "incomplete";
|
|
678
|
+
await save();
|
|
679
|
+
return "quit";
|
|
680
|
+
}
|
|
681
|
+
if (typed === "s") {
|
|
682
|
+
io.out(`Skipped ${item.repo} ${label}.`);
|
|
683
|
+
ps.state = "skipped";
|
|
684
|
+
await save();
|
|
685
|
+
totals.ends.push(endOf(item, part, "skipped"));
|
|
686
|
+
return "skipped";
|
|
687
|
+
}
|
|
688
|
+
if (typed === "r") {
|
|
689
|
+
const again = await retry(item, part, label, where);
|
|
690
|
+
if (again === "done")
|
|
691
|
+
return finishPart(item, part, ps);
|
|
692
|
+
first = await snapOf(root, item.repo);
|
|
693
|
+
since = first;
|
|
694
|
+
prev = first;
|
|
695
|
+
lastChange = clock.now();
|
|
696
|
+
stuckSaid = false;
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
const now = await snapOf(root, item.repo);
|
|
700
|
+
if (!sameSnap(now, prev)) {
|
|
701
|
+
lastChange = clock.now();
|
|
702
|
+
stuckSaid = false;
|
|
703
|
+
prev = now;
|
|
704
|
+
}
|
|
705
|
+
if (await settled(root, item.repo, item.commit, now, since) && await covered(root, item, part, first, now)) {
|
|
706
|
+
const v = await verifyStep(item);
|
|
707
|
+
if (v && !v.rejected && await covered(root, item, part, first, await snapOf(root, item.repo)))
|
|
708
|
+
return finishPart(item, part, ps);
|
|
709
|
+
io.out(`Not done yet: ${v?.rejected ? `${plural(v.rejected, "fact")} rejected for the reader to fix` : "the part isn't accounted for in the facts yet"}. Still waiting (s + Enter skips, r + Enter gives the prompt again for what's left).`);
|
|
710
|
+
since = await snapOf(root, item.repo);
|
|
711
|
+
prev = since;
|
|
712
|
+
}
|
|
713
|
+
if (!stuckSaid && clock.now() - lastChange >= idleMs) {
|
|
714
|
+
io.out(`Copilot seems to have stopped on ${item.repo} ${item.total > 1 ? `part ${part.part}` : "(its one session)"}. r + Enter: verify what it wrote and give the prompt again for what's left, in a NEW chat; s: skip; q: stop.`);
|
|
715
|
+
stuckSaid = true;
|
|
716
|
+
}
|
|
717
|
+
if (clock.now() - lastRemind >= (deps.remindMs ?? REMIND_MS)) {
|
|
718
|
+
io.out(`Still waiting on ${item.repo} ${label} (${Math.round((clock.now() - started) / 6e4)} minutes). The line to paste: ${line} (s + Enter skips, r + Enter retries what's left, q + Enter stops)`);
|
|
719
|
+
lastRemind = clock.now();
|
|
720
|
+
}
|
|
721
|
+
await clock.sleep(deps.pollMs ?? POLL_MS);
|
|
722
|
+
}
|
|
723
|
+
async function retry(item2, part2, label2, where2) {
|
|
724
|
+
ps.retries++;
|
|
725
|
+
await save();
|
|
726
|
+
const rest = item2.kind === "rules" ? await rulesLine(item2) : item2.kind === "gaps" ? await gapsLine(item2) : await restLine(item2, part2);
|
|
727
|
+
if (rest === "done" || rest === void 0 && item2.kind === "gaps")
|
|
728
|
+
return "done";
|
|
729
|
+
line = rest ?? `/atticus-map ${item2.repo}`;
|
|
730
|
+
await block(item2, part2, label2, where2, line, ps.retries);
|
|
731
|
+
if (ps.retries >= RETRIES) {
|
|
732
|
+
const smaller = Math.max(8e3, Math.floor(limit / 2 / 1e3) * 1e3);
|
|
733
|
+
io.out(`${item2.repo} ${label2} has been given again ${plural(ps.retries, "time")}: a smaller limit plans it in smaller parts, each a shorter chat. Stop (q), then atticus map --all --repos ${item2.repo} --max-tokens ${smaller}.`);
|
|
734
|
+
}
|
|
735
|
+
return "again";
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
async function finishPart(item, part, ps) {
|
|
739
|
+
ps.state = "done";
|
|
740
|
+
if (item.kind === "gaps" || part.part === item.total)
|
|
741
|
+
repoState(item).done = true;
|
|
742
|
+
totals.parts++;
|
|
743
|
+
totals.repos.add(item.repo);
|
|
744
|
+
await save();
|
|
745
|
+
return "done";
|
|
746
|
+
}
|
|
747
|
+
async function restLine(item, part) {
|
|
748
|
+
if (!existsSync(join(factsDirOf(root), `${item.repo}.jsonl`)))
|
|
749
|
+
return void 0;
|
|
750
|
+
const v = await verifyStep(item);
|
|
751
|
+
if (!v)
|
|
752
|
+
return void 0;
|
|
753
|
+
const parted = item.total > 1;
|
|
754
|
+
const c = captured();
|
|
755
|
+
const code = await mapCommand(root, item.repo, {
|
|
756
|
+
gaps: true,
|
|
757
|
+
json: true,
|
|
758
|
+
commit: item.commit,
|
|
759
|
+
maxTokens: limit,
|
|
760
|
+
...parted ? { part: part.part } : {}
|
|
761
|
+
}, c, deps.git ? { git: deps.git } : {});
|
|
762
|
+
const g = code === 0 ? jsonOf(c.lines) : void 0;
|
|
763
|
+
if (!g)
|
|
764
|
+
return void 0;
|
|
765
|
+
if (!g.sessions.length && !v.rejected)
|
|
766
|
+
return "done";
|
|
767
|
+
return `/atticus-map ${item.repo}${parted ? ` --part ${part.part}` : ""} --gaps`;
|
|
768
|
+
}
|
|
769
|
+
async function rulesLine(item) {
|
|
770
|
+
const p = await rulesPartsOf(root, item.repo, item.commit, limit, { save: true });
|
|
771
|
+
if (typeof p === "string" || !p.parts.length)
|
|
772
|
+
return "done";
|
|
773
|
+
return `/atticus-map ${item.repo} --rules`;
|
|
774
|
+
}
|
|
775
|
+
async function gapsLine(item) {
|
|
776
|
+
const plain = captured();
|
|
777
|
+
await verifyCommand(root, item.repo, { commit: item.commit, json: true }, plain);
|
|
778
|
+
const c = captured();
|
|
779
|
+
const code = await mapCommand(root, item.repo, { gaps: true, json: true, commit: item.commit, maxTokens: limit }, c, deps.git ? { git: deps.git } : {});
|
|
780
|
+
const g = code === 0 ? jsonOf(c.lines) : void 0;
|
|
781
|
+
if (!g) {
|
|
782
|
+
io.out(`${item.repo}: the gaps pass couldn't be planned: ${c.errs[0] ?? "no plan"}`);
|
|
783
|
+
return void 0;
|
|
784
|
+
}
|
|
785
|
+
return g.sessions.length ? `/atticus-map ${item.repo} --gaps` : void 0;
|
|
786
|
+
}
|
|
787
|
+
async function block(item, part, label, where, line, retries) {
|
|
788
|
+
io.out("");
|
|
789
|
+
io.out(`===== ${item.repo}, ${item.kind === "gaps" ? "the gaps pass" : item.kind === "rules" ? `the rules top-up${item.total > 1 ? `, ${label}` : ""}` : label} (${where})${retries ? `, given again (${retries})` : ""} =====`);
|
|
790
|
+
io.out(`In a NEW Copilot Chat (agent mode), run: ${line}`);
|
|
791
|
+
if (item.kind === "rules")
|
|
792
|
+
io.out(`That chat reads ${plural(part.files, "file")} again for the reading rules added since (${(item.sets ?? []).join(", ")}): ${part.paths.join(", ")} (about ${tokensText(part.tokens)} tokens).`);
|
|
793
|
+
else if (item.total > 1 && !line.includes("--gaps"))
|
|
794
|
+
io.out(`That chat reads part ${part.part}: ${part.paths.join(", ")} (about ${tokensText(part.tokens)} tokens); the estimate it runs names it.`);
|
|
795
|
+
else if (line.includes("--part"))
|
|
796
|
+
io.out(`That chat reads only what is left of part ${part.part}, as the prompt it writes lists.`);
|
|
797
|
+
const copied = await (deps.clipboard ?? (async () => false))(line);
|
|
798
|
+
io.out(copied ? "The line is on your clipboard." : "Copy the line above (no clipboard tool here).");
|
|
799
|
+
io.out("Waiting for the facts it writes. s + Enter skips this part, r + Enter verifies what is there and gives the line again for what's left, q + Enter (or Ctrl+C) stops; atticus map --all carries on.");
|
|
800
|
+
}
|
|
801
|
+
async function modelRead(item, where, rt) {
|
|
802
|
+
io.out("");
|
|
803
|
+
io.out(item.kind === "rules" ? `===== ${item.repo} (${where}): topping up on the model for the reading rules added since it was read (${(item.sets ?? []).join(", ")}) =====` : `===== ${item.repo} (${where}): ${item.kind === "reread" ? "re-reading what changed" : "reading"} on the model, ${plural(item.batches ?? 0, "prompt")} =====`);
|
|
804
|
+
for (let attempt = 1; attempt <= RETRIES; attempt++) {
|
|
805
|
+
if (stopped())
|
|
806
|
+
return "failed";
|
|
807
|
+
const before = await mapStateOf(root, item.repo);
|
|
808
|
+
const resume = !!before && !before.done && sameCommit(before.commit, item.commit);
|
|
809
|
+
let error;
|
|
810
|
+
try {
|
|
811
|
+
await mapCommand(root, item.repo, {
|
|
812
|
+
commit: item.commit,
|
|
813
|
+
maxTokens: limit,
|
|
814
|
+
...item.kind === "rules" ? { rules: true } : {},
|
|
815
|
+
...resume ? { next: true } : before && !before.done ? { force: true } : {}
|
|
816
|
+
}, io, { runtime: rt, ...deps.git ? { git: deps.git } : {} });
|
|
817
|
+
} catch (e) {
|
|
818
|
+
if (e instanceof CapReached) {
|
|
819
|
+
await save();
|
|
820
|
+
return "cap";
|
|
821
|
+
}
|
|
822
|
+
error = firstLine(e);
|
|
823
|
+
}
|
|
824
|
+
const after = await mapStateOf(root, item.repo);
|
|
825
|
+
const unfinished = !!after && !after.done && sameCommit(after.commit, item.commit);
|
|
826
|
+
if (!error && !unfinished) {
|
|
827
|
+
await verifyStep(item);
|
|
828
|
+
const ps = partState(item, 1);
|
|
829
|
+
return finishPart(item, item.parts[0] ?? { part: 1, total: 1, paths: [], files: 0, tokens: 0 }, ps);
|
|
830
|
+
}
|
|
831
|
+
if (attempt < RETRIES) {
|
|
832
|
+
const wait = (deps.backoffMs ?? 5e3) * 2 ** (attempt - 1);
|
|
833
|
+
io.out(`${item.repo}: the model's read stopped (${error ?? "a prompt got no answer"}); trying what is left again in ${Math.round(wait / 1e3)}s (try ${attempt + 1} of ${RETRIES}).`);
|
|
834
|
+
await clock.sleep(wait);
|
|
835
|
+
} else {
|
|
836
|
+
io.out(`${item.repo}: the model's read failed ${RETRIES} times (${error ?? "a prompt got no answer"}); moving on.`);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
partState(item, 1).state = "failed";
|
|
840
|
+
totals.ends.push({
|
|
841
|
+
repo: item.repo,
|
|
842
|
+
end: "failed",
|
|
843
|
+
command: `atticus map --all --repos ${item.repo}`
|
|
844
|
+
});
|
|
845
|
+
await save();
|
|
846
|
+
return "failed";
|
|
847
|
+
}
|
|
848
|
+
function endOf(item, part, end) {
|
|
849
|
+
return {
|
|
850
|
+
repo: item.repo,
|
|
851
|
+
...item.total > 1 ? { part: part.part, total: item.total } : {},
|
|
852
|
+
end,
|
|
853
|
+
command: `atticus map --all --repos ${item.repo}${o.gaps ? " --gaps" : ""} (or /atticus-map ${item.repo}${o.gaps ? " --gaps" : ""} in a new chat)`
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
async function summary(interrupted2) {
|
|
857
|
+
for (const item of items)
|
|
858
|
+
for (const part of item.kind === "carry" ? [] : item.parts) {
|
|
859
|
+
const s = st.repos[item.repo]?.parts[String(part.part)];
|
|
860
|
+
if (s?.state === "done" || totals.ends.some((e) => e.repo === item.repo && (e.part ?? 1) === part.part))
|
|
861
|
+
continue;
|
|
862
|
+
if (mode === "model" && totals.ends.some((e) => e.repo === item.repo))
|
|
863
|
+
continue;
|
|
864
|
+
totals.ends.push(endOf(item, part, "incomplete"));
|
|
865
|
+
}
|
|
866
|
+
const open = (await listQuestions(root, { state: "open" }).catch(() => ({ questions: [] }))).questions.length;
|
|
867
|
+
const rejected = [...totals.rejected.values()].reduce((n, x) => n + x, 0);
|
|
868
|
+
io.out("");
|
|
869
|
+
io.out(`${interrupted2 ? "So far" : "Done"}: ${plural(totals.repos.size, "repo")} read, ${plural(totals.parts, "part")}${mode === "model" ? ` (${plural(totals.spent.prompts, "prompt")})` : ""}; ${plural(rejected, "fact")} rejected; links +${totals.added} -${totals.removed}; ${plural(open, "question")} open.`);
|
|
870
|
+
const left = totals.ends.filter((e) => e.end !== "done");
|
|
871
|
+
if (left.length) {
|
|
872
|
+
io.out("Not finished:");
|
|
873
|
+
for (const e of left)
|
|
874
|
+
io.out(` ${e.repo}${e.part ? ` part ${e.part} of ${e.total}` : ""}: ${e.end}; ${e.command}`);
|
|
875
|
+
}
|
|
876
|
+
io.out("Next: atticus questions list --mine (answer what the code couldn't settle), then atticus estate fresh.");
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
export {
|
|
880
|
+
MAP_ALL_STATE_REL,
|
|
881
|
+
limitFor,
|
|
882
|
+
mapAllCommand,
|
|
883
|
+
modelModeAllowed,
|
|
884
|
+
planEstate,
|
|
885
|
+
readMapAllState
|
|
886
|
+
};
|