@maycombhq/atticus 2.0.0-beta.2 → 2.0.0-beta.21

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.
Files changed (273) hide show
  1. package/dist/bin.js +8 -4
  2. package/dist/chunk-265LWMOA.js +91 -0
  3. package/dist/chunk-26WBY34Y.js +37 -0
  4. package/dist/{chunk-UBBC2XSG.js → chunk-26Z7OGQW.js} +518 -93
  5. package/dist/chunk-2D7PWSOK.js +172 -0
  6. package/dist/{chunk-JCZIKA4C.js → chunk-2HH3UCZM.js} +4 -4
  7. package/dist/{chunk-GDLULHTC.js → chunk-2HTEMYTB.js} +12 -26
  8. package/dist/chunk-2UCRFXFZ.js +130 -0
  9. package/dist/{chunk-MVZVGYXH.js → chunk-2V2ZPQQU.js} +81 -13
  10. package/dist/{chunk-BOHJZTEQ.js → chunk-36RY7ZXM.js} +130 -71
  11. package/dist/{chunk-I3E7CX4H.js → chunk-37WE3LS2.js} +3 -3
  12. package/dist/{chunk-IPKHE5D6.js → chunk-3AQ2R5NL.js} +1520 -871
  13. package/dist/chunk-3G6S7LAA.js +43 -0
  14. package/dist/chunk-3J5I7ZOU.js +58 -0
  15. package/dist/{chunk-65NYPGRC.js → chunk-3LZ6P5EP.js} +1 -1
  16. package/dist/chunk-3SSTNB4E.js +191 -0
  17. package/dist/chunk-3TD6S4TC.js +49 -0
  18. package/dist/{chunk-3C7EYRFZ.js → chunk-3UTYPHN3.js} +1 -1
  19. package/dist/{chunk-G2B4ZQGH.js → chunk-3WON4G3M.js} +2 -2
  20. package/dist/{chunk-S3QNRWYR.js → chunk-42EPP7OB.js} +12 -12
  21. package/dist/chunk-455SYIIE.js +113 -0
  22. package/dist/{chunk-YISXLPHN.js → chunk-4B6BT75O.js} +166 -23
  23. package/dist/{chunk-C6EKFH7J.js → chunk-4CLK2RJO.js} +7 -7
  24. package/dist/chunk-4CYTJ5TZ.js +38 -0
  25. package/dist/{chunk-EYWIDJFU.js → chunk-4D62IZII.js} +5 -5
  26. package/dist/chunk-4FOAYLI4.js +328 -0
  27. package/dist/{chunk-7JUKDRSZ.js → chunk-4KNOJC6J.js} +294 -215
  28. package/dist/{chunk-YMZ3TNYB.js → chunk-4PYC2UGC.js} +2 -2
  29. package/dist/{chunk-27NKUS3X.js → chunk-4SLBCEPD.js} +2104 -726
  30. package/dist/chunk-4TKVU2I2.js +122 -0
  31. package/dist/{chunk-RUVFXE2L.js → chunk-4WXRPQDE.js} +448 -47
  32. package/dist/{chunk-7ZUIMTOU.js → chunk-5CMPVC3N.js} +24 -24
  33. package/dist/chunk-5G7ILBUG.js +66 -0
  34. package/dist/{chunk-HFQCFSJR.js → chunk-5PV7S2ZP.js} +3 -3
  35. package/dist/{chunk-FITWGOJ2.js → chunk-5QUOPNLN.js} +4 -4
  36. package/dist/{chunk-Z6LF7HQN.js → chunk-5TDRBOAV.js} +5 -5
  37. package/dist/{chunk-T6AIP7H5.js → chunk-5WERBKLE.js} +199 -63
  38. package/dist/{chunk-XPCM366L.js → chunk-62DLJSLV.js} +8 -8
  39. package/dist/{chunk-L24C55VN.js → chunk-64AADMTW.js} +99 -25
  40. package/dist/{chunk-K65BJIMT.js → chunk-67BP7HXL.js} +17 -17
  41. package/dist/chunk-6DQYZU2W.js +379 -0
  42. package/dist/{chunk-EDS2L2LD.js → chunk-6EXDI5GI.js} +52 -26
  43. package/dist/chunk-6FNAKCET.js +38 -0
  44. package/dist/{chunk-6IU67AEK.js → chunk-75ASLHBT.js} +21 -15
  45. package/dist/{chunk-A3GY6SOA.js → chunk-75ZOZFGH.js} +18 -18
  46. package/dist/{chunk-MGYZM27B.js → chunk-77O633L5.js} +49 -23
  47. package/dist/{chunk-GQ4N4WKF.js → chunk-7AB6OWTV.js} +3 -3
  48. package/dist/{chunk-M766ZJ6W.js → chunk-7CZHUZBL.js} +25 -25
  49. package/dist/{chunk-A7UPUQFY.js → chunk-7FHNFCHK.js} +643 -124
  50. package/dist/chunk-7FUIVIBG.js +415 -0
  51. package/dist/{chunk-6QSERWXH.js → chunk-7QPCGTPS.js} +21 -21
  52. package/dist/{chunk-LR3R6Z2A.js → chunk-A2G72UI4.js} +7 -7
  53. package/dist/{chunk-I4JRCD6M.js → chunk-AE4P57KK.js} +23 -17
  54. package/dist/{chunk-AVJDSJ2F.js → chunk-AHW3RY3X.js} +7 -7
  55. package/dist/chunk-AM6FP6JW.js +43 -0
  56. package/dist/{chunk-CSZ4C5N6.js → chunk-AOCWFA7T.js} +93 -10
  57. package/dist/{chunk-EPTBZ3GP.js → chunk-API5TOUB.js} +1 -1
  58. package/dist/{chunk-652QWTLZ.js → chunk-AZDITBCT.js} +3 -3
  59. package/dist/{chunk-DPUYDDQG.js → chunk-BA2HUMDN.js} +25 -3
  60. package/dist/chunk-BA3U7ALS.js +99 -0
  61. package/dist/{chunk-HVUPKCGJ.js → chunk-BC6KKZ67.js} +5 -5
  62. package/dist/{chunk-CKSITVS4.js → chunk-BEPCKDCP.js} +2554 -722
  63. package/dist/{chunk-3ALD2W2A.js → chunk-BPPU3PW7.js} +4 -4
  64. package/dist/{chunk-QRAOANID.js → chunk-BVWWPBKD.js} +21 -21
  65. package/dist/{chunk-ZDPAS56H.js → chunk-BXBCMGIQ.js} +7 -1
  66. package/dist/chunk-BXZ4PKIT.js +233 -0
  67. package/dist/chunk-C7CEK3KW.js +247 -0
  68. package/dist/chunk-CFH3QH26.js +29 -0
  69. package/dist/chunk-CG6CULP6.js +170 -0
  70. package/dist/chunk-CLD4RVTA.js +45 -0
  71. package/dist/{chunk-DKJA76CJ.js → chunk-CNPY4NTZ.js} +13 -13
  72. package/dist/chunk-CNU5Q2D5.js +575 -0
  73. package/dist/{chunk-T2UYZSCQ.js → chunk-COYN3UAN.js} +126 -23
  74. package/dist/{chunk-23W7VWKR.js → chunk-CPK7QSBG.js} +1360 -113
  75. package/dist/{chunk-4AK7IBVP.js → chunk-D2WSW4GU.js} +1 -1
  76. package/dist/{chunk-ABWHYWNI.js → chunk-D57MFJPP.js} +3 -3
  77. package/dist/chunk-D5KV5PSK.js +45 -0
  78. package/dist/chunk-D5MASS4I.js +48 -0
  79. package/dist/{chunk-7EOBHUMC.js → chunk-DCWN3HFV.js} +2 -2
  80. package/dist/{chunk-QSXK2RGH.js → chunk-DDJPM5YX.js} +2 -2
  81. package/dist/chunk-DN4A2Q2O.js +57 -0
  82. package/dist/{chunk-IHMLFRVV.js → chunk-DUPZPDCJ.js} +58 -16
  83. package/dist/{chunk-PRPPGYZG.js → chunk-E2VXBSIR.js} +4 -4
  84. package/dist/chunk-E57AOFYN.js +32 -0
  85. package/dist/{chunk-UGLN7QHV.js → chunk-ECLXZWAG.js} +12 -12
  86. package/dist/{chunk-5WG5YP4T.js → chunk-EDZ45WIR.js} +14 -14
  87. package/dist/chunk-EFCQSMXB.js +37 -0
  88. package/dist/{chunk-2ANOROX3.js → chunk-EZIN5E5B.js} +8 -8
  89. package/dist/{chunk-BWZ77RQT.js → chunk-F6H2RJ3N.js} +1 -1
  90. package/dist/{chunk-OLQJTJJU.js → chunk-FAJDKNSD.js} +7 -3
  91. package/dist/chunk-FGAGWYZB.js +47 -0
  92. package/dist/{chunk-4WBVUHXN.js → chunk-FLVZFTLQ.js} +18 -18
  93. package/dist/chunk-FQ6WH6PB.js +140 -0
  94. package/dist/{chunk-T6XQL73F.js → chunk-FRHD22WM.js} +61 -23
  95. package/dist/{chunk-XAKWMCXI.js → chunk-FVMPFCDS.js} +4 -4
  96. package/dist/{chunk-B2WLAWNJ.js → chunk-FY3QIRTL.js} +3 -3
  97. package/dist/{chunk-CPA6HPVR.js → chunk-FYBF5MB2.js} +15 -11
  98. package/dist/{chunk-V2YTAIQO.js → chunk-G5YJBNDZ.js} +21 -6
  99. package/dist/chunk-G6IQYM25.js +339 -0
  100. package/dist/chunk-G6X4YL4D.js +161 -0
  101. package/dist/{chunk-SJRGMG6A.js → chunk-GC2VK3JT.js} +25 -25
  102. package/dist/{chunk-SP2I63OO.js → chunk-GCS3FZOB.js} +77 -3
  103. package/dist/{chunk-6TACQN3N.js → chunk-GDZB57IU.js} +5 -5
  104. package/dist/chunk-GIFMBCTW.js +221 -0
  105. package/dist/{chunk-YY6ZQQBP.js → chunk-GK4PYVEC.js} +18 -8
  106. package/dist/{chunk-TDD55CJH.js → chunk-GNWAOVFQ.js} +6 -5
  107. package/dist/chunk-GS76RXQE.js +226 -0
  108. package/dist/{chunk-YYQN46FY.js → chunk-GSGIZ2OO.js} +23 -23
  109. package/dist/chunk-GUYL7RMK.js +60 -0
  110. package/dist/chunk-GX74YWR7.js +321 -0
  111. package/dist/chunk-HE3HRDNZ.js +122 -0
  112. package/dist/{chunk-AIOQPLA5.js → chunk-HGHRSF3E.js} +30 -12
  113. package/dist/{chunk-2RMYG36Q.js → chunk-HK3VOHIE.js} +198 -336
  114. package/dist/{chunk-QZSX3F7C.js → chunk-HS4BGB4G.js} +24 -22
  115. package/dist/{chunk-XY3P7JW7.js → chunk-HSZMPH5T.js} +834 -149
  116. package/dist/{chunk-L6SGQIR3.js → chunk-HWD4JPU7.js} +4 -2
  117. package/dist/{chunk-PCVDV3UZ.js → chunk-HXXP2NTE.js} +6 -6
  118. package/dist/{chunk-AA6YULYB.js → chunk-I2A3Z5AK.js} +7 -7
  119. package/dist/{chunk-N7IXEHK3.js → chunk-ICHDSWEY.js} +7 -7
  120. package/dist/chunk-IFFRGC3N.js +31 -0
  121. package/dist/{chunk-4BN53TG3.js → chunk-IFHDV6KQ.js} +31 -23
  122. package/dist/chunk-J2O4LFVI.js +80 -0
  123. package/dist/chunk-J5AAZ6OJ.js +161 -0
  124. package/dist/{chunk-ZMFPW66A.js → chunk-JAABT3DA.js} +3 -3
  125. package/dist/chunk-JITJP64K.js +34 -0
  126. package/dist/chunk-JKIGL3XQ.js +162 -0
  127. package/dist/chunk-JRVNXLZP.js +615 -0
  128. package/dist/chunk-JRXHON4E.js +41 -0
  129. package/dist/{chunk-DHPACDG7.js → chunk-JS6WMC3J.js} +8 -8
  130. package/dist/chunk-JU4QNJSR.js +62 -0
  131. package/dist/{chunk-PAMPPUR6.js → chunk-JYMIB5XY.js} +1697 -172
  132. package/dist/{chunk-RRTKKSLQ.js → chunk-JYTIHTIK.js} +8 -6
  133. package/dist/{chunk-3HI6Z55Y.js → chunk-K332XW7K.js} +324 -39
  134. package/dist/{chunk-GLUX4EEP.js → chunk-K6JB6XTX.js} +9 -9
  135. package/dist/chunk-KDAHXQIE.js +294 -0
  136. package/dist/chunk-KYZMRSPS.js +93 -0
  137. package/dist/chunk-L4CESDPB.js +22 -0
  138. package/dist/{chunk-NXFPS2LR.js → chunk-LEBR5NHW.js} +14 -14
  139. package/dist/chunk-LIJJCBQI.js +223 -0
  140. package/dist/{chunk-DE76JROX.js → chunk-LIRVU3HW.js} +16 -16
  141. package/dist/{chunk-JMSCMUCA.js → chunk-LN77DXBM.js} +145 -21
  142. package/dist/{chunk-JIITQXFB.js → chunk-LNWEWYCM.js} +2969 -788
  143. package/dist/{chunk-TANFV3MZ.js → chunk-LO3BLMVG.js} +3 -3
  144. package/dist/chunk-LPV6T362.js +250 -0
  145. package/dist/{chunk-2VHF7OXM.js → chunk-LQH4P45K.js} +1 -1
  146. package/dist/chunk-LU4MQVAL.js +41 -0
  147. package/dist/chunk-LWDNKE4X.js +273 -0
  148. package/dist/chunk-M4H2UG4R.js +218 -0
  149. package/dist/{chunk-6BVONWJ7.js → chunk-M6D2U3YM.js} +3 -3
  150. package/dist/chunk-MD7KUEJ3.js +514 -0
  151. package/dist/{chunk-66YVAGGM.js → chunk-MMZUN7ZO.js} +20 -20
  152. package/dist/chunk-MZGRDONP.js +916 -0
  153. package/dist/chunk-N3RUGTGV.js +39 -0
  154. package/dist/{chunk-JGZCG5VM.js → chunk-NCB6656Z.js} +7 -7
  155. package/dist/{chunk-4NDAAFQT.js → chunk-NRQ65LTQ.js} +7 -5
  156. package/dist/{chunk-UNM6ZOKP.js → chunk-NTAVOWYD.js} +145 -18
  157. package/dist/{chunk-3USYZGRF.js → chunk-NYOABJNK.js} +36 -27
  158. package/dist/{chunk-WVPJSRRJ.js → chunk-O4IKAIZ2.js} +24 -20
  159. package/dist/{chunk-D3PO4DOZ.js → chunk-ODMBPDDV.js} +51 -14
  160. package/dist/chunk-OKUB6RJA.js +533 -0
  161. package/dist/chunk-OMPENNWY.js +39 -0
  162. package/dist/chunk-OPQZISG3.js +25 -0
  163. package/dist/{chunk-5GGOLAKC.js → chunk-OV57AHCG.js} +26 -26
  164. package/dist/chunk-OZJ3JLYI.js +58 -0
  165. package/dist/{chunk-KEM4SDDP.js → chunk-P2VBXX7N.js} +11 -10
  166. package/dist/{chunk-S2A7YC3Q.js → chunk-PAINMSID.js} +10150 -1720
  167. package/dist/chunk-PKJAV25S.js +43 -0
  168. package/dist/{chunk-EBEW3XXQ.js → chunk-PNQLCRSS.js} +4 -4
  169. package/dist/{chunk-WY6PP6AA.js → chunk-PQH56YF6.js} +37 -5
  170. package/dist/chunk-PRTBPXYA.js +50 -0
  171. package/dist/{chunk-YEDDOYSC.js → chunk-PRW3HXM3.js} +2 -2
  172. package/dist/chunk-PRZ7KMWL.js +42 -0
  173. package/dist/{chunk-6M5NK3K3.js → chunk-PTQ3ZALZ.js} +42 -4
  174. package/dist/{chunk-5GDRCDQB.js → chunk-PUEWDYGP.js} +2 -2
  175. package/dist/chunk-Q26LDIUV.js +236 -0
  176. package/dist/{chunk-CR3MTH32.js → chunk-Q46QDDMF.js} +77 -7
  177. package/dist/chunk-QBNWF5ZU.js +19 -0
  178. package/dist/chunk-QE527XRY.js +342 -0
  179. package/dist/{chunk-CNUKCS2T.js → chunk-QHJJMZLX.js} +1518 -54
  180. package/dist/chunk-QJCJOMW3.js +425 -0
  181. package/dist/{chunk-VYDBJ73M.js → chunk-QKMRFNMA.js} +15 -15
  182. package/dist/chunk-QOOEYDNJ.js +317 -0
  183. package/dist/chunk-QSIDVFB7.js +45 -0
  184. package/dist/{chunk-R77KLRB3.js → chunk-RA33EYS4.js} +19 -18
  185. package/dist/{chunk-DFBCSHVT.js → chunk-RALY3E5U.js} +4 -4
  186. package/dist/{chunk-ZCJDOK2S.js → chunk-S2RY3BOD.js} +35 -21
  187. package/dist/chunk-S5LSDXV4.js +40 -0
  188. package/dist/chunk-SB5GRUFM.js +54 -0
  189. package/dist/chunk-SH27FYPF.js +150 -0
  190. package/dist/chunk-T74WQQGS.js +40 -0
  191. package/dist/{chunk-O3WI5KWW.js → chunk-TGVVUKTG.js} +2 -2
  192. package/dist/chunk-THN26IEF.js +48 -0
  193. package/dist/chunk-TJH2EUAZ.js +47 -0
  194. package/dist/{chunk-ZNCEKR4J.js → chunk-TQ4TG57V.js} +12 -8
  195. package/dist/{chunk-7FBGJFEE.js → chunk-TQTRWENN.js} +12 -12
  196. package/dist/{chunk-TYAID7B7.js → chunk-TSM6T6GQ.js} +23 -23
  197. package/dist/{chunk-DPZHZQKE.js → chunk-TW3KOSQK.js} +43 -10
  198. package/dist/{chunk-MC3H7736.js → chunk-TWQRPM76.js} +37 -4
  199. package/dist/chunk-TYD6I4CZ.js +109 -0
  200. package/dist/chunk-U3NBK4EU.js +420 -0
  201. package/dist/{chunk-6JCPI55B.js → chunk-UDXWIPCB.js} +47 -7
  202. package/dist/{chunk-MMOSZPWJ.js → chunk-UEVZZZU2.js} +4 -4
  203. package/dist/{chunk-JBTK5OP2.js → chunk-UF4UHCIG.js} +2 -2
  204. package/dist/{chunk-6JUBZBMW.js → chunk-UFE36WJH.js} +4 -4
  205. package/dist/{chunk-ONLS5QA5.js → chunk-URIKUID7.js} +12 -12
  206. package/dist/chunk-UYLBRRFK.js +1106 -0
  207. package/dist/chunk-UZACEG2C.js +515 -0
  208. package/dist/{chunk-7SW2QWLU.js → chunk-VAMHOHUU.js} +12 -12
  209. package/dist/{chunk-RZPYKDWS.js → chunk-VUVGX5L2.js} +1 -1
  210. package/dist/{chunk-Q4D5X7QB.js → chunk-VYOCPTUB.js} +44 -24
  211. package/dist/{chunk-CAQZUNOH.js → chunk-WAZEXEJH.js} +567 -3
  212. package/dist/chunk-WCEF7H6L.js +221 -0
  213. package/dist/{chunk-2DIQQJCB.js → chunk-WEOMJHPV.js} +12 -12
  214. package/dist/{chunk-FHH4I4ZV.js → chunk-WFU77T3A.js} +12 -6
  215. package/dist/chunk-WIWTJMMR.js +292 -0
  216. package/dist/{chunk-2BFCZ3RK.js → chunk-WNTIOBOG.js} +18 -18
  217. package/dist/{chunk-7WD63HU2.js → chunk-X2CUXTWU.js} +6 -6
  218. package/dist/chunk-X7EMBM5X.js +34 -0
  219. package/dist/chunk-XEQCQO66.js +33 -0
  220. package/dist/{chunk-F7HYOUFF.js → chunk-XG4WJHLQ.js} +20 -4
  221. package/dist/{chunk-EFHQ3TWP.js → chunk-XOL3GFW2.js} +171 -31
  222. package/dist/{chunk-NE2W3OO7.js → chunk-XQ3YZ4QW.js} +22 -22
  223. package/dist/{chunk-CEXSU4S6.js → chunk-Y6K3CJBU.js} +723 -85
  224. package/dist/{chunk-4RS5KZQD.js → chunk-YAH5IQAL.js} +5 -5
  225. package/dist/{chunk-64EQYWCA.js → chunk-YBOVNMHC.js} +51 -14
  226. package/dist/chunk-YF5DZCPN.js +1212 -0
  227. package/dist/chunk-YIGBJNH4.js +37 -0
  228. package/dist/{chunk-BKVWTZ6A.js → chunk-YJ3TBOTK.js} +25 -25
  229. package/dist/{chunk-Q5AMFEWD.js → chunk-YKTE2RU3.js} +2 -2
  230. package/dist/{chunk-7EKXJZ2Y.js → chunk-YO2PKTXT.js} +296 -37
  231. package/dist/{chunk-6J5OKA4Y.js → chunk-YTTNTQOX.js} +15 -15
  232. package/dist/{chunk-OT2O76OS.js → chunk-YWAKDNMH.js} +183 -33
  233. package/dist/{chunk-R6XF6UR3.js → chunk-YZDZOEV4.js} +4 -4
  234. package/dist/chunk-Z3QFH7YG.js +17 -0
  235. package/dist/{chunk-W5BVQF44.js → chunk-Z6VLC5X4.js} +17 -17
  236. package/dist/{chunk-HLJAXMM4.js → chunk-ZFQMMU5Y.js} +2 -2
  237. package/dist/{chunk-W3BQAZ3Q.js → chunk-ZKYRDV7A.js} +12 -12
  238. package/dist/{chunk-ZMAINWBW.js → chunk-ZLS6PU2O.js} +3 -3
  239. package/dist/{chunk-ZVM6AKKM.js → chunk-ZOSD4FXV.js} +3 -3
  240. package/dist/chunk-ZPDDEVQX.js +47 -0
  241. package/dist/{chunk-TXLH6WHQ.js → chunk-ZQLRCA2V.js} +11 -11
  242. package/dist/{chunk-HITVBIJS.js → chunk-ZX7235KR.js} +128 -54
  243. package/dist/{chunk-GT4I4ZWM.js → chunk-ZZFHLRQW.js} +18 -16
  244. package/dist/files.json +636 -364
  245. package/dist/packages/naysayer/constitution/constitution.yaml +19 -0
  246. package/dist/packages/sdk/npm/index.js +5614 -2343
  247. package/dist/packages/ui/dist/assets/{elk-api-tma0MCuh.js → elk-api-CowTnhEJ.js} +2 -2
  248. package/dist/packages/ui/dist/assets/index-Dw20IRhQ.css +1 -0
  249. package/dist/packages/ui/dist/assets/index-z2wv0d5d.js +47 -0
  250. package/dist/packages/ui/dist/index.html +2 -2
  251. package/package.json +4 -4
  252. package/dist/chunk-2BF2EYJV.js +0 -174
  253. package/dist/chunk-42EVSKME.js +0 -37
  254. package/dist/chunk-4BKGMUIK.js +0 -53
  255. package/dist/chunk-5KLGBXG5.js +0 -48
  256. package/dist/chunk-6BNC6EQ4.js +0 -41
  257. package/dist/chunk-6D2CQ5II.js +0 -41
  258. package/dist/chunk-7AVHLZGD.js +0 -45
  259. package/dist/chunk-D46WUV3T.js +0 -33
  260. package/dist/chunk-E36QOJMD.js +0 -47
  261. package/dist/chunk-FQXYPF7E.js +0 -147
  262. package/dist/chunk-GBRFVT63.js +0 -45
  263. package/dist/chunk-ICY36XCH.js +0 -34
  264. package/dist/chunk-J4K3KVLD.js +0 -131
  265. package/dist/chunk-JZU3H6UQ.js +0 -54
  266. package/dist/chunk-NN2ZQEB4.js +0 -38
  267. package/dist/chunk-PCOCACY3.js +0 -385
  268. package/dist/chunk-RTEYOSJY.js +0 -29
  269. package/dist/chunk-RVH5SUW5.js +0 -69
  270. package/dist/chunk-VN3DP4LQ.js +0 -43
  271. package/dist/chunk-XPTOBS2D.js +0 -48
  272. package/dist/packages/ui/dist/assets/index-B54fm9FQ.js +0 -29
  273. package/dist/packages/ui/dist/assets/index-DD_hufQz.css +0 -1
@@ -4,30 +4,27 @@ var require = __atticusCreateRequire(import.meta.url);
4
4
  var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
5
5
  var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
6
6
  import {
7
- catalogRecords
8
- } from "./chunk-B2WLAWNJ.js";
7
+ QueryError,
8
+ askLookup,
9
+ graph,
10
+ impact,
11
+ openIndex,
12
+ translate
13
+ } from "./chunk-5WERBKLE.js";
9
14
  import {
10
15
  readRound,
11
16
  reviewedGates,
12
17
  roundsOf
13
- } from "./chunk-3HI6Z55Y.js";
18
+ } from "./chunk-K332XW7K.js";
14
19
  import {
15
20
  changeFolder,
16
21
  changeStore
17
- } from "./chunk-XY3P7JW7.js";
18
- import {
19
- QueryError,
20
- askLookup,
21
- graph,
22
- impact,
23
- openIndex,
24
- translate
25
- } from "./chunk-T6AIP7H5.js";
22
+ } from "./chunk-HSZMPH5T.js";
26
23
  import {
27
24
  baseClonePath,
28
25
  gitUser,
29
26
  loadRepos
30
- } from "./chunk-EFHQ3TWP.js";
27
+ } from "./chunk-XOL3GFW2.js";
31
28
  import {
32
29
  API_VERSION,
33
30
  DEFAULT_PORT,
@@ -36,7 +33,6 @@ import {
36
33
  RecordId,
37
34
  Severity,
38
35
  catalogDirOf,
39
- changesDirOf,
40
36
  factsDirOf,
41
37
  fastPathOf,
42
38
  inputsDirOf,
@@ -48,23 +44,14 @@ import {
48
44
  proposalsDirOf,
49
45
  questionOfLens,
50
46
  questionsDirOf,
51
- readRepoSpec,
52
- require_dist,
53
47
  runsDirOf,
54
- specRepos,
55
48
  specsDirOf,
56
49
  withSignal
57
- } from "./chunk-S2A7YC3Q.js";
50
+ } from "./chunk-PAINMSID.js";
58
51
  import {
52
+ FileChangedError,
59
53
  SCHEMA_VERSION
60
- } from "./chunk-D3PO4DOZ.js";
61
- import {
62
- __toESM
63
- } from "./chunk-TV45EUGM.js";
64
-
65
- // packages/cli/dist/ui-api-cites.js
66
- import { readdir, readFile as readFile3, stat as stat3 } from "node:fs/promises";
67
- import { isAbsolute, join as join4, relative as relative2, sep as sep3 } from "node:path";
54
+ } from "./chunk-ODMBPDDV.js";
68
55
 
69
56
  // packages/server/dist/http.js
70
57
  var HttpError = class extends Error {
@@ -148,6 +135,115 @@ function intParam(q, name, min, max) {
148
135
  }
149
136
  var strParam = (q, name) => q.get(name) || void 0;
150
137
 
138
+ // packages/server/dist/server.js
139
+ import { randomBytes, timingSafeEqual } from "node:crypto";
140
+ import { createServer } from "node:http";
141
+
142
+ // packages/server/dist/jobs.js
143
+ var JobManager = class {
144
+ publish;
145
+ now;
146
+ jobs = /* @__PURE__ */ new Map();
147
+ cancelledIds = /* @__PURE__ */ new Set();
148
+ aborts = /* @__PURE__ */ new Map();
149
+ seq = 0;
150
+ /** Round 41: every running job of a kind, in start order (a later one never hides an earlier). */
151
+ running = /* @__PURE__ */ new Map();
152
+ constructor(publish, now = () => /* @__PURE__ */ new Date()) {
153
+ this.publish = publish;
154
+ this.now = now;
155
+ }
156
+ /**
157
+ * A running job of a kind, if any: the earliest still running (one scan at a time: a second
158
+ * ask gets 409).
159
+ */
160
+ runningOf(kind) {
161
+ for (const id of this.running.get(kind) ?? []) {
162
+ const j = this.jobs.get(id);
163
+ if (j?.state === "running")
164
+ return j;
165
+ }
166
+ return void 0;
167
+ }
168
+ get(id) {
169
+ return this.jobs.get(id);
170
+ }
171
+ start(kind, work) {
172
+ const id = `job-${++this.seq}`;
173
+ const job = {
174
+ id,
175
+ kind,
176
+ state: "running",
177
+ progress: { done: 0, total: 0, message: "Starting" },
178
+ startedAt: this.now().toISOString(),
179
+ errors: []
180
+ };
181
+ this.jobs.set(id, job);
182
+ const ofKind = this.running.get(kind) ?? /* @__PURE__ */ new Set();
183
+ ofKind.add(id);
184
+ this.running.set(kind, ofKind);
185
+ const abort = new AbortController();
186
+ this.aborts.set(id, abort);
187
+ const cancelled = this.cancelledIds;
188
+ const control = {
189
+ progress: (done, total, message) => {
190
+ job.progress = { done, total, message };
191
+ this.publish({ type: "job.progress", jobId: id, done, total, message });
192
+ },
193
+ get cancelled() {
194
+ return cancelled.has(id);
195
+ }
196
+ };
197
+ void (async () => {
198
+ try {
199
+ const out = await withSignal(abort.signal, () => work(control));
200
+ if (out?.result)
201
+ job.result = out.result;
202
+ if (out?.errors?.length)
203
+ job.errors.push(...out.errors);
204
+ job.state = this.cancelledIds.has(id) ? "cancelled" : job.errors.length ? "failed" : "done";
205
+ } catch (e) {
206
+ if (this.cancelledIds.has(id))
207
+ job.state = "cancelled";
208
+ else {
209
+ job.errors.push(e instanceof Error ? e.message : String(e));
210
+ job.state = "failed";
211
+ }
212
+ }
213
+ this.aborts.delete(id);
214
+ job.finishedAt = this.now().toISOString();
215
+ ofKind.delete(id);
216
+ if (!ofKind.size && this.running.get(kind) === ofKind)
217
+ this.running.delete(kind);
218
+ this.publish({ type: "job.done", jobId: id, state: job.state });
219
+ })();
220
+ return job;
221
+ }
222
+ /** Ask a running job to stop; false when it already finished. */
223
+ cancel(id) {
224
+ const j = this.jobs.get(id);
225
+ if (!j || j.state !== "running")
226
+ return false;
227
+ this.cancelledIds.add(id);
228
+ this.aborts.get(id)?.abort();
229
+ return true;
230
+ }
231
+ /** Wait for a job to finish (tests and the CLI). */
232
+ async settle(id, timeoutMs = 6e4) {
233
+ const start = Date.now();
234
+ for (; ; ) {
235
+ const j = this.jobs.get(id);
236
+ if (!j)
237
+ throw new Error(`No job ${id}`);
238
+ if (j.state !== "running" && j.state !== "queued")
239
+ return j;
240
+ if (Date.now() - start > timeoutMs)
241
+ throw new Error(`Job ${id} did not finish`);
242
+ await new Promise((r) => setTimeout(r, 20));
243
+ }
244
+ }
245
+ };
246
+
151
247
  // packages/server/dist/routes.js
152
248
  import { readFile, stat } from "node:fs/promises";
153
249
  import { join } from "node:path";
@@ -232,6 +328,7 @@ function apiRoutes(r, ctx) {
232
328
  ...strParam(query, "status") ? { status: strParam(query, "status") } : {},
233
329
  ...strParam(query, "system") ? { system: strParam(query, "system") } : {},
234
330
  ...strParam(query, "q") ? { q: strParam(query, "q") } : {},
331
+ ...strParam(query, "confidence") ? { confidence: strParam(query, "confidence") } : {},
235
332
  ...strParam(query, "cursor") ? { cursor: strParam(query, "cursor") } : {},
236
333
  ...limit !== void 0 ? { limit } : {}
237
334
  };
@@ -289,7 +386,20 @@ function apiRoutes(r, ctx) {
289
386
  return { status: 200, body: await withIndex(root, (ix) => graph(ix, o)) };
290
387
  }).add("GET", "/api/impact/{id}", async ({ params, query }) => {
291
388
  const depth = intParam(query, "depth", 1, 10);
292
- const res = await withIndex(root, (ix) => impact(ix, params.id, depth));
389
+ const res = await withIndex(root, (ix) => {
390
+ const r2 = impact(ix, params.id, depth);
391
+ if (!r2)
392
+ return void 0;
393
+ return {
394
+ ...r2,
395
+ affected: r2.affected.map((a) => {
396
+ const rec = ix.find(a.id)[0];
397
+ const ai = (rec?.evidence ?? []).find((e) => e.source === "ai");
398
+ const flagged = Array.isArray(rec?.flags) && rec.flags.includes("joined-by-ai");
399
+ return flagged || ai ? { ...a, byAi: true, ...ai?.run ? { run: ai.run } : {} } : a;
400
+ })
401
+ };
402
+ });
293
403
  if (!res)
294
404
  throw notFound(`There is no record ${params.id} in the catalog.`);
295
405
  return { status: 200, body: res };
@@ -380,6 +490,8 @@ function apiRoutes(r, ctx) {
380
490
  return { status: 200, body };
381
491
  }).add("GET", "/api/findings", async ({ query }) => {
382
492
  const change = strParam(query, "change");
493
+ if (change !== void 0 && !RecordId.safeParse(change).success)
494
+ throw badRequest(`${change} isn't a change id.`);
383
495
  const gate = strParam(query, "gate");
384
496
  const state = strParam(query, "state");
385
497
  const lens = enumParam(query, "lens", Lens.options);
@@ -393,6 +505,8 @@ function apiRoutes(r, ctx) {
393
505
  body.push(f);
394
506
  return { status: 200, body };
395
507
  }).add("GET", "/api/findings/{changeId}/{findingId}", async ({ params }) => {
508
+ if (!RecordId.safeParse(params.changeId).success)
509
+ throw badRequest(`${params.changeId} isn't a change id.`);
396
510
  const f = (await latestFindings(root, params.changeId)).find((x) => x.id === params.findingId);
397
511
  if (!f)
398
512
  throw notFound(`Change ${params.changeId} has no finding ${params.findingId}.`);
@@ -435,107 +549,9 @@ function apiRoutes(r, ctx) {
435
549
  });
436
550
  }
437
551
 
438
- // packages/server/dist/server.js
439
- import { randomBytes, timingSafeEqual } from "node:crypto";
440
- import { createServer } from "node:http";
441
-
442
- // packages/server/dist/jobs.js
443
- var JobManager = class {
444
- publish;
445
- now;
446
- jobs = /* @__PURE__ */ new Map();
447
- cancelledIds = /* @__PURE__ */ new Set();
448
- aborts = /* @__PURE__ */ new Map();
449
- seq = 0;
450
- running = /* @__PURE__ */ new Map();
451
- constructor(publish, now = () => /* @__PURE__ */ new Date()) {
452
- this.publish = publish;
453
- this.now = now;
454
- }
455
- /** The running job of a kind, if any (one scan at a time: a second asks gets 409). */
456
- runningOf(kind) {
457
- const id = this.running.get(kind);
458
- return id ? this.jobs.get(id) : void 0;
459
- }
460
- get(id) {
461
- return this.jobs.get(id);
462
- }
463
- start(kind, work) {
464
- const id = `job-${++this.seq}`;
465
- const job = {
466
- id,
467
- kind,
468
- state: "running",
469
- progress: { done: 0, total: 0, message: "Starting" },
470
- startedAt: this.now().toISOString(),
471
- errors: []
472
- };
473
- this.jobs.set(id, job);
474
- this.running.set(kind, id);
475
- const abort = new AbortController();
476
- this.aborts.set(id, abort);
477
- const cancelled = this.cancelledIds;
478
- const control = {
479
- progress: (done, total, message) => {
480
- job.progress = { done, total, message };
481
- this.publish({ type: "job.progress", jobId: id, done, total, message });
482
- },
483
- get cancelled() {
484
- return cancelled.has(id);
485
- }
486
- };
487
- void (async () => {
488
- try {
489
- const out = await withSignal(abort.signal, () => work(control));
490
- if (out?.result)
491
- job.result = out.result;
492
- if (out?.errors?.length)
493
- job.errors.push(...out.errors);
494
- job.state = this.cancelledIds.has(id) ? "cancelled" : job.errors.length ? "failed" : "done";
495
- } catch (e) {
496
- if (this.cancelledIds.has(id))
497
- job.state = "cancelled";
498
- else {
499
- job.errors.push(e instanceof Error ? e.message : String(e));
500
- job.state = "failed";
501
- }
502
- }
503
- this.aborts.delete(id);
504
- job.finishedAt = this.now().toISOString();
505
- if (this.running.get(kind) === id)
506
- this.running.delete(kind);
507
- this.publish({ type: "job.done", jobId: id, state: job.state });
508
- })();
509
- return job;
510
- }
511
- /** Ask a running job to stop; false when it already finished. */
512
- cancel(id) {
513
- const j = this.jobs.get(id);
514
- if (!j || j.state !== "running")
515
- return false;
516
- this.cancelledIds.add(id);
517
- this.aborts.get(id)?.abort();
518
- return true;
519
- }
520
- /** Wait for a job to finish (tests and the CLI). */
521
- async settle(id, timeoutMs = 6e4) {
522
- const start = Date.now();
523
- for (; ; ) {
524
- const j = this.jobs.get(id);
525
- if (!j)
526
- throw new Error(`No job ${id}`);
527
- if (j.state !== "running" && j.state !== "queued")
528
- return j;
529
- if (Date.now() - start > timeoutMs)
530
- throw new Error(`Job ${id} did not finish`);
531
- await new Promise((r) => setTimeout(r, 20));
532
- }
533
- }
534
- };
535
-
536
552
  // packages/server/dist/static.js
537
553
  import { readFile as readFile2, stat as stat2 } from "node:fs/promises";
538
- import { extname, join as join2, normalize, sep } from "node:path";
554
+ import { extname, join as join2, normalize, resolve, sep } from "node:path";
539
555
  var TYPES = {
540
556
  ".html": "text/html; charset=utf-8",
541
557
  ".js": "text/javascript; charset=utf-8",
@@ -564,7 +580,8 @@ function appCsp(port, embed) {
564
580
  ].join("; ");
565
581
  }
566
582
  var escapeAttr = (s) => s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
567
- async function staticFile(dir, path, token) {
583
+ async function staticFile(givenDir, path, token) {
584
+ const dir = resolve(givenDir);
568
585
  let rel;
569
586
  try {
570
587
  rel = decodeURIComponent(path);
@@ -613,6 +630,14 @@ function watchMetarepo(o) {
613
630
  const delay = o.delayMs ?? 300;
614
631
  const maxPaths = o.maxPaths ?? 50;
615
632
  const watchers = /* @__PURE__ */ new Map();
633
+ const inodes = /* @__PURE__ */ new Map();
634
+ const inodeOf = (d) => {
635
+ try {
636
+ return statSync(d).ino;
637
+ } catch {
638
+ return void 0;
639
+ }
640
+ };
616
641
  const problems = [];
617
642
  const pending = /* @__PURE__ */ new Set();
618
643
  let timer;
@@ -673,21 +698,39 @@ function watchMetarepo(o) {
673
698
  note(name ? join3(dir, String(name)) : dir);
674
699
  });
675
700
  w.on("error", (e) => {
676
- problems.push(`${posix(relative(root, dir)) || "."}: ${e.message}`);
677
701
  w.close();
702
+ if (watchers.get(dir) !== w)
703
+ return;
704
+ problems.push(`${posix(relative(root, dir)) || "."}: ${e.message}`);
678
705
  watchers.delete(dir);
706
+ inodes.delete(dir);
679
707
  });
680
708
  watchers.set(dir, w);
709
+ const ino = inodeOf(dir);
710
+ if (ino !== void 0)
711
+ inodes.set(dir, ino);
712
+ const label = `${posix(relative(root, dir)) || "."}: `;
713
+ for (let i = problems.length - 1; i >= 0; i--)
714
+ if (problems[i].startsWith(label))
715
+ problems.splice(i, 1);
681
716
  } catch (e) {
682
717
  problems.push(`${posix(relative(root, dir)) || "."}: ${e.message}`);
683
718
  }
684
719
  };
685
720
  const attach = () => {
721
+ for (const [d, w] of watchers) {
722
+ const ino = inodeOf(d);
723
+ if (ino === void 0 || inodes.has(d) && inodes.get(d) !== ino) {
724
+ w.close();
725
+ watchers.delete(d);
726
+ inodes.delete(d);
727
+ }
728
+ }
729
+ follow(root, false);
730
+ follow(join3(root, ".atticus"), false);
686
731
  for (const d of folders())
687
732
  follow(d, true);
688
733
  };
689
- follow(root, false);
690
- follow(join3(root, ".atticus"), false);
691
734
  attach();
692
735
  return {
693
736
  get following() {
@@ -707,6 +750,8 @@ function watchMetarepo(o) {
707
750
 
708
751
  // packages/server/dist/ws.js
709
752
  import { createHash } from "node:crypto";
753
+ var MAX_CLIENT_FRAME = 64 * 1024;
754
+ var MAX_CLIENT_BUFFER = 256 * 1024;
710
755
  var GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
711
756
  function acceptKey(key) {
712
757
  return createHash("sha1").update(key + GUID).digest("base64");
@@ -758,8 +803,14 @@ var Socket = class {
758
803
  this.closed = true;
759
804
  this.onClose(this);
760
805
  }
761
- /** Client frames are masked; only control frames matter to us. */
806
+ /**
807
+ * Client frames are masked; only control frames matter to us. The page sends nothing but pings
808
+ * and a close, so a frame over MAX_CLIENT_FRAME, a buffer over MAX_CLIENT_BUFFER or an unmasked
809
+ * frame (RFC 6455 5.1) closes the connection rather than growing memory.
810
+ */
762
811
  read(d) {
812
+ if (this.buf.length + d.length > MAX_CLIENT_BUFFER)
813
+ return this.close();
763
814
  this.buf = Buffer.concat([this.buf, d]);
764
815
  while (this.buf.length >= 2) {
765
816
  const opcode = this.buf[0] & 15;
@@ -777,15 +828,15 @@ var Socket = class {
777
828
  len = Number(this.buf.readBigUInt64BE(2));
778
829
  off = 10;
779
830
  }
831
+ if (!masked || len > MAX_CLIENT_FRAME)
832
+ return this.close();
780
833
  const maskOff = off;
781
- if (masked)
782
- off += 4;
834
+ off += 4;
783
835
  if (this.buf.length < off + len)
784
836
  return;
785
837
  const payload = Buffer.from(this.buf.subarray(off, off + len));
786
- if (masked)
787
- for (let i = 0; i < payload.length; i++)
788
- payload[i] ^= this.buf[maskOff + i % 4];
838
+ for (let i = 0; i < payload.length; i++)
839
+ payload[i] ^= this.buf[maskOff + i % 4];
789
840
  this.buf = this.buf.subarray(off + len);
790
841
  if (opcode === 8)
791
842
  return this.close();
@@ -976,14 +1027,18 @@ async function startServer(o) {
976
1027
  send(res, out.status, out.body);
977
1028
  done(out.status);
978
1029
  } catch (e) {
979
- const err = e instanceof HttpError ? e : new HttpError(500, "Something went wrong", e instanceof Error ? e.message : String(e));
1030
+ const err = e instanceof HttpError ? e : e instanceof FileChangedError ? new HttpError(409, "The file changed meanwhile", e.message) : (
1031
+ // The message stays in the log (onRequest gets the error): an fs error names the
1032
+ // metarepo's absolute path, which the page has no use for.
1033
+ new HttpError(500, "Something went wrong", "The app's log (.atticus/logs/atticus.log) has the details.")
1034
+ );
980
1035
  send(res, err.status, problem(err), "application/problem+json");
981
1036
  done(err.status, err.status >= 500 && e instanceof Error ? e : void 0);
982
1037
  }
983
1038
  });
984
1039
  server.on("upgrade", (req, sock) => {
985
- const url = new URL(req.url ?? "/", "http://127.0.0.1");
986
1040
  try {
1041
+ const url = new URL(req.url ?? "/", "http://127.0.0.1");
987
1042
  if (url.pathname !== "/api/events")
988
1043
  throw new HttpError(404, "Not found");
989
1044
  guard(req, url, true);
@@ -999,9 +1054,9 @@ Connection: close\r
999
1054
  if (s)
1000
1055
  events.add(s);
1001
1056
  });
1002
- await new Promise((resolve, reject) => {
1057
+ await new Promise((resolve2, reject) => {
1003
1058
  server.once("error", reject);
1004
- server.listen(o.port ?? DEFAULT_PORT, host, () => resolve());
1059
+ server.listen(o.port ?? DEFAULT_PORT, host, () => resolve2());
1005
1060
  });
1006
1061
  port = server.address().port;
1007
1062
  const watcher = o.watch === false ? void 0 : watchMetarepo({ root: o.root, publish: (e) => events.publish(e) });
@@ -1015,213 +1070,20 @@ Connection: close\r
1015
1070
  get following() {
1016
1071
  return watcher?.following ?? [];
1017
1072
  },
1018
- close: () => new Promise((resolve) => {
1073
+ close: () => new Promise((resolve2) => {
1019
1074
  watcher?.close();
1020
1075
  events.closeAll();
1021
1076
  server.closeAllConnections?.();
1022
- server.close(() => resolve());
1077
+ server.close(() => resolve2());
1023
1078
  })
1024
1079
  };
1025
1080
  }
1026
1081
 
1027
- // packages/cli/dist/ui-api-cites.js
1028
- var import_yaml = __toESM(require_dist(), 1);
1029
- async function fingerprint(dirs) {
1030
- let count = 0;
1031
- let newest = 0;
1032
- const walk = async (d) => {
1033
- const entries = await readdir(d, { withFileTypes: true }).catch(() => []);
1034
- for (const e of entries) {
1035
- const p = join4(d, e.name);
1036
- if (e.isDirectory())
1037
- await walk(p);
1038
- else {
1039
- count++;
1040
- const s = await stat3(p).catch(() => void 0);
1041
- if (s && s.mtimeMs > newest)
1042
- newest = s.mtimeMs;
1043
- }
1044
- }
1045
- };
1046
- for (const d of dirs)
1047
- await walk(d);
1048
- return `${count}:${newest}`;
1049
- }
1050
- async function build(root) {
1051
- const index = /* @__PURE__ */ new Map();
1052
- const lineOf = (repo, path, line) => {
1053
- const files = index.get(repo) ?? /* @__PURE__ */ new Map();
1054
- index.set(repo, files);
1055
- const lines = files.get(path) ?? /* @__PURE__ */ new Map();
1056
- files.set(path, lines);
1057
- const l = lines.get(line) ?? { line, flows: [], records: [] };
1058
- lines.set(line, l);
1059
- return l;
1060
- };
1061
- for (const specRepo of await specRepos(root))
1062
- for (const f of (await readRepoSpec(root, specRepo, { cacheRoot: root })).flows) {
1063
- const parts = [
1064
- { step: 0, kind: f.trigger.kind, evidence: f.trigger.evidence },
1065
- ...f.steps.map((s, i) => ({
1066
- step: i + 1,
1067
- kind: s.kind,
1068
- ...s.confirmedBy ? { confirmedBy: s.confirmedBy } : {},
1069
- evidence: s.evidence
1070
- }))
1071
- ];
1072
- for (const part of parts)
1073
- for (const e of part.evidence) {
1074
- if (!e.path || e.line === void 0)
1075
- continue;
1076
- const l = lineOf(e.repo ?? specRepo, e.path, e.line);
1077
- if (l.flows.some((x) => x.flow === f.id && x.step === part.step))
1078
- continue;
1079
- l.flows.push({
1080
- repo: specRepo,
1081
- flow: f.id,
1082
- name: f.name,
1083
- step: part.step,
1084
- kind: part.kind,
1085
- ...part.confirmedBy ? { confirmedBy: part.confirmedBy } : {}
1086
- });
1087
- }
1088
- }
1089
- for (const r of await catalogRecords(root)) {
1090
- const name = r.name;
1091
- for (const e of r.evidence) {
1092
- if (!e.repo || !e.path || e.line === void 0)
1093
- continue;
1094
- const l = lineOf(e.repo, e.path, e.line);
1095
- if (l.records.some((x) => x.kind === r.kind && x.id === r.id))
1096
- continue;
1097
- l.records.push({
1098
- kind: r.kind,
1099
- id: r.id,
1100
- ...typeof name === "string" && name !== r.id ? { name } : {},
1101
- source: e.source
1102
- });
1103
- }
1104
- }
1105
- return index;
1106
- }
1107
- var DONE = /* @__PURE__ */ new Set(["released", "archived", "post-release-review"]);
1108
- async function inFlight(root) {
1109
- const out = /* @__PURE__ */ new Map();
1110
- const dir = changesDirOf(root);
1111
- for (const e of await readdir(dir, { withFileTypes: true }).catch(() => [])) {
1112
- if (!e.isDirectory() || e.name === "archive")
1113
- continue;
1114
- const yaml = await readFile3(join4(dir, e.name, "change.yaml"), "utf8").catch(() => "");
1115
- const state = (() => {
1116
- try {
1117
- return (0, import_yaml.parse)(yaml)?.state;
1118
- } catch {
1119
- return void 0;
1120
- }
1121
- })();
1122
- if (!yaml || typeof state === "string" && DONE.has(state))
1123
- continue;
1124
- for (const f of await readdir(join4(dir, e.name, "target-flows")).catch(() => []))
1125
- if (f.endsWith(".yaml")) {
1126
- const flow = f.slice(0, -".yaml".length);
1127
- out.set(flow, [...out.get(flow) ?? [], e.name]);
1128
- }
1129
- }
1130
- return out;
1131
- }
1132
- async function citeList(root, index, repo, path) {
1133
- const lines = [...index.get(repo)?.get(path)?.values() ?? []].sort((a, b) => a.line - b.line);
1134
- const flying = await inFlight(root);
1135
- const shown = lines.map((l) => ({
1136
- ...l,
1137
- flows: [...l.flows].sort((a, b) => a.flow.localeCompare(b.flow) || a.step - b.step).map((f) => flying.get(f.flow)?.length ? { ...f, changes: flying.get(f.flow) } : f)
1138
- }));
1139
- return { repo, path, lines: shown };
1140
- }
1141
- function fileInRepo(root, file) {
1142
- const rel = relative2(root, file);
1143
- if (!rel || rel.startsWith("..") || isAbsolute(rel))
1144
- return void 0;
1145
- const parts = rel.split(sep3);
1146
- if (parts[0] !== "workspace")
1147
- return { path: parts.join("/") };
1148
- const at = parts[1] === ".worktrees" ? 3 : parts[1] === ".branches" ? 2 : 1;
1149
- const repo = parts[at];
1150
- const rest = parts.slice(parts[1] === ".branches" ? 4 : at + 1);
1151
- if (!repo || !rest.length || !RecordId.safeParse(repo).success)
1152
- return void 0;
1153
- return { repo, path: rest.join("/") };
1154
- }
1155
- async function citesCli(root, o, io) {
1156
- let repo = o.repo;
1157
- let path = o.path;
1158
- const index = await build(root);
1159
- if (o.file) {
1160
- const at = fileInRepo(root, o.file);
1161
- if (!at) {
1162
- io.err(`${o.file} isn't in this metarepo or a repo's checkout in its workspace.`);
1163
- return 1;
1164
- }
1165
- path = at.path;
1166
- repo = at.repo ?? [...index.keys()].find((r) => index.get(r).has(at.path)) ?? void 0;
1167
- if (!repo) {
1168
- if (o.json)
1169
- io.out(JSON.stringify({ repo: "", path, lines: [] }, null, 2));
1170
- else
1171
- io.out(`Nothing in the specs or the catalog cites ${path}.`);
1172
- return 0;
1173
- }
1174
- }
1175
- if (!repo || !path || !RecordId.safeParse(repo).success) {
1176
- io.err("Say which file: atticus cites --repo <repo> --path <its path in the repo>, or --file <path on disk>.");
1177
- return 2;
1178
- }
1179
- const v = await citeList(root, index, repo, path);
1180
- if (o.json) {
1181
- io.out(JSON.stringify(v, null, 2));
1182
- return 0;
1183
- }
1184
- if (!v.lines.length) {
1185
- io.out(`Nothing in the specs or the catalog cites ${repo}/${path}.`);
1186
- return 0;
1187
- }
1188
- for (const l of v.lines) {
1189
- const flows = l.flows.map((f) => `${f.name} (step ${f.step})${f.changes?.length ? `, changed by ${f.changes.join(", ")}` : ""}`);
1190
- const records = l.records.map((r) => `${r.kind} ${r.name ?? r.id}`);
1191
- io.out(`Line ${l.line}: ${[...flows, ...records].join("; ")}`);
1192
- }
1193
- return 0;
1194
- }
1195
- function uiCiteRoutes(r, ctx) {
1196
- const root = ctx.root;
1197
- let cached;
1198
- const indexNow = async () => {
1199
- const print = await fingerprint([specsDirOf(root), catalogDirOf(root)]);
1200
- if (cached?.print !== print)
1201
- cached = { print, index: build(root) };
1202
- return cached.index;
1203
- };
1204
- void indexNow().catch(() => void 0);
1205
- r.add("GET", "/api/cites", async ({ query }) => {
1206
- const repo = query.get("repo");
1207
- const path = query.get("path");
1208
- if (!repo || !RecordId.safeParse(repo).success)
1209
- throw badRequest("Say which repo: ?repo=<the repo's id>.");
1210
- if (!path)
1211
- throw badRequest("Say which file: ?path=<its path in the repo>.");
1212
- return { status: 200, body: await citeList(root, await indexNow(), repo, path) };
1213
- });
1214
- return r;
1215
- }
1216
-
1217
1082
  export {
1218
1083
  HttpError,
1219
1084
  badRequest,
1220
1085
  notFound,
1221
1086
  conflict,
1222
1087
  strParam,
1223
- startServer,
1224
- fileInRepo,
1225
- citesCli,
1226
- uiCiteRoutes
1088
+ startServer
1227
1089
  };