sandforge 1.80.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +48 -0
  2. package/bin/sandforge-pipeline.mjs +12 -0
  3. package/bin/sandforge-users.mjs +12 -0
  4. package/lib/{chunk-J525F5KI.mjs → chunk-27Z76O2O.mjs} +1 -1
  5. package/lib/chunk-2JZGCCPG.mjs +9 -0
  6. package/lib/{chunk-ELFXJHU7.mjs → chunk-2UU42PTD.mjs} +1 -1
  7. package/lib/{chunk-N652NMZ4.mjs → chunk-32EUNQT6.mjs} +52 -52
  8. package/lib/chunk-3C2ZZIFN.mjs +7 -0
  9. package/lib/chunk-3CX7GPCR.mjs +7 -0
  10. package/lib/chunk-3HEMJTAP.mjs +925 -0
  11. package/lib/{chunk-BY2HJFFG.mjs → chunk-3HROD5RE.mjs} +1 -1
  12. package/lib/{chunk-OHWNPXWW.mjs → chunk-3MGMNK3Q.mjs} +1 -1
  13. package/lib/{chunk-PZPJKATS.mjs → chunk-3SKLBRPL.mjs} +8 -8
  14. package/lib/chunk-3XG25GTF.mjs +7 -0
  15. package/lib/chunk-42BFLWHR.mjs +7 -0
  16. package/lib/chunk-466F37VD.mjs +7 -0
  17. package/lib/chunk-47UHTN3Q.mjs +7 -0
  18. package/lib/chunk-4JKR4PTZ.mjs +8 -0
  19. package/lib/{chunk-COFG7Q6R.mjs → chunk-52EXDVPN.mjs} +1 -1
  20. package/lib/{chunk-SAR5622P.mjs → chunk-54HYHHVL.mjs} +1 -1
  21. package/lib/{chunk-RSWDYIHY.mjs → chunk-5GBO4KD5.mjs} +1 -1
  22. package/lib/chunk-5K2I2DMP.mjs +11 -0
  23. package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
  24. package/lib/{chunk-BV6VTP3J.mjs → chunk-6GQUZ4IP.mjs} +1 -1
  25. package/lib/chunk-6KP6WETK.mjs +9 -0
  26. package/lib/{chunk-MJVTDA5Q.mjs → chunk-6VSZNZHH.mjs} +1 -1
  27. package/lib/{chunk-XUWL6ZPC.mjs → chunk-7CVDVBEE.mjs} +1 -1
  28. package/lib/{chunk-UCD54V2M.mjs → chunk-7EYQYZJP.mjs} +1 -1
  29. package/lib/{chunk-5K5VLULK.mjs → chunk-7LKI7OAS.mjs} +1 -1
  30. package/lib/chunk-7PY3VQP3.mjs +7 -0
  31. package/lib/chunk-7SDZR6SR.mjs +7 -0
  32. package/lib/chunk-7WSLT5VX.mjs +8 -0
  33. package/lib/chunk-A32ISQ6M.mjs +28 -0
  34. package/lib/{chunk-M3ROUWDX.mjs → chunk-A65ADTCR.mjs} +1 -1
  35. package/lib/chunk-A7JJWOLT.mjs +7 -0
  36. package/lib/chunk-AUS6NFLZ.mjs +8 -0
  37. package/lib/chunk-BMTNTBBM.mjs +7 -0
  38. package/lib/{chunk-SOU4FRYN.mjs → chunk-BN33LVPQ.mjs} +1 -1
  39. package/lib/chunk-BNKT3R3F.mjs +7 -0
  40. package/lib/{chunk-K2FBZIXY.mjs → chunk-BWWQXU2B.mjs} +1 -1
  41. package/lib/{chunk-IC2C2GOF.mjs → chunk-BXZ73A5M.mjs} +1 -1
  42. package/lib/{chunk-WA7EYLAQ.mjs → chunk-C2N2TNEU.mjs} +1 -1
  43. package/lib/{chunk-BKDV4ENO.mjs → chunk-C3LNYAVJ.mjs} +1 -1
  44. package/lib/{chunk-XLXIPIEW.mjs → chunk-CBL42DUU.mjs} +1 -1
  45. package/lib/chunk-CCEH7L53.mjs +7 -0
  46. package/lib/chunk-CELEBWEZ.mjs +7 -0
  47. package/lib/chunk-CV47FDQW.mjs +7 -0
  48. package/lib/{chunk-2UZPIMUC.mjs → chunk-CZLJZQCS.mjs} +1 -1
  49. package/lib/chunk-DBBPDSFN.mjs +7 -0
  50. package/lib/chunk-DIL62SUN.mjs +7 -0
  51. package/lib/chunk-DIS254AN.mjs +7 -0
  52. package/lib/{chunk-BTWDMNN3.mjs → chunk-DJCGURW7.mjs} +1 -1
  53. package/lib/{chunk-F6GUDTOB.mjs → chunk-DT3T7FRD.mjs} +1 -1
  54. package/lib/{chunk-IGYH7GMA.mjs → chunk-DWMRIWV5.mjs} +1 -1
  55. package/lib/{chunk-YRQGKDHM.mjs → chunk-EEFUE2ES.mjs} +1 -1
  56. package/lib/{chunk-FGRG7ANU.mjs → chunk-EOFO3PHS.mjs} +1 -1
  57. package/lib/{chunk-KBJ5VERV.mjs → chunk-FA4ZKDCU.mjs} +1 -1
  58. package/lib/{chunk-WU3GLFZO.mjs → chunk-FKK5YBGZ.mjs} +1 -1
  59. package/lib/chunk-FOIWWK7G.mjs +156 -0
  60. package/lib/chunk-FZF23M6R.mjs +7 -0
  61. package/lib/chunk-G2JR3F63.mjs +7 -0
  62. package/lib/{chunk-JEERQRLW.mjs → chunk-GBGHJTPC.mjs} +1 -1
  63. package/lib/{chunk-3RZQZHEB.mjs → chunk-GCGHHN4K.mjs} +1 -1
  64. package/lib/{chunk-RPI7LRTW.mjs → chunk-GGNUACTY.mjs} +1 -1
  65. package/lib/{chunk-EMNC6YI4.mjs → chunk-GGUOIDWP.mjs} +1 -1
  66. package/lib/chunk-GHPR5UVV.mjs +7 -0
  67. package/lib/{chunk-X5JYBPXP.mjs → chunk-GJ6SZVHT.mjs} +1 -1
  68. package/lib/{chunk-W622GUAW.mjs → chunk-H4JUYUSL.mjs} +1 -1
  69. package/lib/{chunk-XAMBCQPU.mjs → chunk-H4OBZIX3.mjs} +1 -1
  70. package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
  71. package/lib/{chunk-L77FJZEP.mjs → chunk-HFUDCNU5.mjs} +1 -1
  72. package/lib/chunk-HIHCYMSL.mjs +7 -0
  73. package/lib/chunk-HKUWHVI7.mjs +9 -0
  74. package/lib/chunk-HQQVANWQ.mjs +20 -0
  75. package/lib/chunk-ICIYL45C.mjs +7 -0
  76. package/lib/chunk-IRZJU2PG.mjs +22 -0
  77. package/lib/chunk-ISSP2FZ5.mjs +7 -0
  78. package/lib/chunk-IVZJSDJD.mjs +7 -0
  79. package/lib/chunk-J24TIGSI.mjs +10 -0
  80. package/lib/{chunk-UNJA4J37.mjs → chunk-JESRFE2Z.mjs} +4 -4
  81. package/lib/chunk-JFNLKHY6.mjs +8 -0
  82. package/lib/chunk-JH27IKCO.mjs +9 -0
  83. package/lib/chunk-JJITOWZK.mjs +7 -0
  84. package/lib/{chunk-E5AHXLS6.mjs → chunk-JKT5YAQ2.mjs} +1 -1
  85. package/lib/{chunk-IWDREM66.mjs → chunk-JLZRZL5E.mjs} +1 -1
  86. package/lib/{chunk-FPKYYFM7.mjs → chunk-JPEVIXNH.mjs} +1 -1
  87. package/lib/chunk-JQZTMFO7.mjs +7 -0
  88. package/lib/chunk-KIMQQ6JQ.mjs +7 -0
  89. package/lib/{chunk-MILU7WFN.mjs → chunk-KJYEQHYP.mjs} +1 -1
  90. package/lib/chunk-KKOA62S4.mjs +474 -0
  91. package/lib/chunk-KP5G6FUC.mjs +7 -0
  92. package/lib/{chunk-JWTSEDIQ.mjs → chunk-L4INJ5TZ.mjs} +1 -1
  93. package/lib/{chunk-OLSGVAIL.mjs → chunk-LAUOSXMN.mjs} +53 -53
  94. package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
  95. package/lib/{chunk-KDGMAGQR.mjs → chunk-LHU6CPGE.mjs} +1 -1
  96. package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
  97. package/lib/chunk-LXDSRP2W.mjs +7 -0
  98. package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
  99. package/lib/{chunk-TTKXMDBN.mjs → chunk-MKTXJCXN.mjs} +4 -4
  100. package/lib/chunk-MUEQRIK7.mjs +9 -0
  101. package/lib/{chunk-IOIWJ3DJ.mjs → chunk-NLB3RGIY.mjs} +1 -1
  102. package/lib/{chunk-O2HDYYUV.mjs → chunk-NWOI25WY.mjs} +1 -1
  103. package/lib/chunk-O2PUGRNW.mjs +10 -0
  104. package/lib/chunk-O4BROUGM.mjs +7 -0
  105. package/lib/chunk-OETEC3P7.mjs +7 -0
  106. package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
  107. package/lib/chunk-P55MKIZX.mjs +37 -0
  108. package/lib/chunk-P63WJMXQ.mjs +7 -0
  109. package/lib/chunk-PBE44M2Y.mjs +7 -0
  110. package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
  111. package/lib/chunk-PE435FVH.mjs +15 -0
  112. package/lib/chunk-PPGDAUEQ.mjs +7 -0
  113. package/lib/{chunk-SE4QEZUG.mjs → chunk-PPHVWUFY.mjs} +1 -1
  114. package/lib/{chunk-CU2INBND.mjs → chunk-PR74GYVI.mjs} +1 -1
  115. package/lib/chunk-PWVDNN2C.mjs +7 -0
  116. package/lib/{chunk-6XYKJSGX.mjs → chunk-PYRZFUVU.mjs} +1 -1
  117. package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
  118. package/lib/{chunk-DYFALGRT.mjs → chunk-Q3DY7TO2.mjs} +1 -1
  119. package/lib/{chunk-BGUEWRK2.mjs → chunk-Q6SXNKV2.mjs} +1 -1
  120. package/lib/chunk-QAPVKPEC.mjs +7 -0
  121. package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
  122. package/lib/{chunk-TSLJUSLW.mjs → chunk-RCYEBY42.mjs} +1 -1
  123. package/lib/chunk-RLWB7F26.mjs +7 -0
  124. package/lib/{chunk-FXXLX4O6.mjs → chunk-RTWYLOCA.mjs} +1 -1
  125. package/lib/chunk-RYRMUPMY.mjs +7 -0
  126. package/lib/chunk-SAMWHL22.mjs +13 -0
  127. package/lib/{chunk-IZQZ6ZUF.mjs → chunk-SFGZFB4F.mjs} +1 -1
  128. package/lib/{chunk-FKG7Q3WH.mjs → chunk-SNEOKYV7.mjs} +1 -1
  129. package/lib/{chunk-3TJON4F3.mjs → chunk-STRMWSIQ.mjs} +1 -1
  130. package/lib/chunk-SZGGFST2.mjs +272 -0
  131. package/lib/{chunk-SOGQW4IG.mjs → chunk-T7WREYA5.mjs} +1 -1
  132. package/lib/{chunk-NTFIRZP6.mjs → chunk-TCBAE65A.mjs} +1 -1
  133. package/lib/{chunk-KYEDBS54.mjs → chunk-TEIBWMJM.mjs} +1 -1
  134. package/lib/{chunk-YKKRIEH4.mjs → chunk-TMA34QMA.mjs} +1 -1
  135. package/lib/chunk-TQ2TQHTT.mjs +9 -0
  136. package/lib/{chunk-HEKAZJRH.mjs → chunk-TWV4A5RK.mjs} +1 -1
  137. package/lib/{chunk-CEX3NEZL.mjs → chunk-UHFLKP26.mjs} +1 -1
  138. package/lib/chunk-UV74P4H2.mjs +7 -0
  139. package/lib/{chunk-WR4Q363I.mjs → chunk-V3R45ZWT.mjs} +1 -1
  140. package/lib/{chunk-GSKCGQIP.mjs → chunk-VPDEJGPS.mjs} +1 -1
  141. package/lib/{chunk-HLWMJF6Y.mjs → chunk-VQJMP3DC.mjs} +1 -1
  142. package/lib/chunk-VV3B6IC3.mjs +7 -0
  143. package/lib/{chunk-PJ5I73CK.mjs → chunk-VYOYXTCU.mjs} +1 -1
  144. package/lib/{chunk-NZC67CGR.mjs → chunk-VZT4E2OJ.mjs} +1 -1
  145. package/lib/{chunk-AEKONPF4.mjs → chunk-VZVICK7Q.mjs} +1 -1
  146. package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
  147. package/lib/chunk-WEMLDUQA.mjs +7 -0
  148. package/lib/{chunk-MYW5QNGI.mjs → chunk-WOOUISSO.mjs} +1 -1
  149. package/lib/{chunk-G35N4P7D.mjs → chunk-WSUKC2U3.mjs} +1 -1
  150. package/lib/{chunk-ZVAED4QV.mjs → chunk-WT3SCUHS.mjs} +1 -1
  151. package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
  152. package/lib/{chunk-DBB3EMIN.mjs → chunk-XFU3HRUV.mjs} +1 -1
  153. package/lib/chunk-XK5W7BVE.mjs +7 -0
  154. package/lib/{chunk-2GTBABKU.mjs → chunk-XO5FBOQF.mjs} +1 -1
  155. package/lib/{chunk-CHYDMRSV.mjs → chunk-XSKPYGMT.mjs} +1 -1
  156. package/lib/chunk-XU25YA46.mjs +9 -0
  157. package/lib/chunk-XZISAZA6.mjs +7 -0
  158. package/lib/chunk-Y4TDVDP2.mjs +13 -0
  159. package/lib/chunk-YAIIRFKJ.mjs +8 -0
  160. package/lib/{chunk-LKQ5RKIV.mjs → chunk-YAJQS3OL.mjs} +1 -1
  161. package/lib/{chunk-74Q6DORA.mjs → chunk-YGJF55VJ.mjs} +1 -1
  162. package/lib/chunk-YH4DYI6D.mjs +7 -0
  163. package/lib/chunk-YMDFF657.mjs +10 -0
  164. package/lib/{chunk-2BA2XKAY.mjs → chunk-YT22LMF7.mjs} +1 -1
  165. package/lib/{chunk-IG2MTQRP.mjs → chunk-Z42PHCVZ.mjs} +1 -1
  166. package/lib/{chunk-2NBYT7GR.mjs → chunk-ZHIZY3ZC.mjs} +1 -1
  167. package/lib/chunk-ZQO5PDX5.mjs +48 -0
  168. package/lib/chunk-ZRUDYB7O.mjs +7 -0
  169. package/lib/{chunk-BXU6WFMH.mjs → chunk-ZUBBEP75.mjs} +1 -1
  170. package/lib/chunk-ZUOPC4W2.mjs +7 -0
  171. package/lib/{chunk-GGD7ON3M.mjs → chunk-ZUTUYBNW.mjs} +1 -1
  172. package/lib/{chunk-MHMH6MTP.mjs → chunk-ZXFL2MSN.mjs} +1 -1
  173. package/lib/sandforge-autopilot.mjs +11 -11
  174. package/lib/sandforge-backup.mjs +63 -32
  175. package/lib/sandforge-checkpoint.mjs +1 -348
  176. package/lib/sandforge-cleanup.mjs +1 -1
  177. package/lib/sandforge-clone.mjs +1 -1
  178. package/lib/sandforge-compare.mjs +1 -1
  179. package/lib/sandforge-dataops.mjs +1 -1
  180. package/lib/sandforge-empty.mjs +11 -11
  181. package/lib/sandforge-env.mjs +186 -140
  182. package/lib/sandforge-frozen.mjs +1 -266
  183. package/lib/sandforge-mcp.mjs +33 -14
  184. package/lib/sandforge-monitor.mjs +1 -1
  185. package/lib/sandforge-pipeline.mjs +88 -0
  186. package/lib/sandforge-seed.mjs +1 -1
  187. package/lib/sandforge-sync.mjs +1 -1
  188. package/lib/sandforge-users.mjs +157 -0
  189. package/lib/sandforge.mjs +1 -22
  190. package/lib/sf/sandforge/autopilot.mjs +20 -0
  191. package/lib/sf/sandforge/backup.mjs +20 -0
  192. package/lib/sf/sandforge/checkpoint.mjs +20 -0
  193. package/lib/sf/sandforge/cleanup.mjs +20 -0
  194. package/lib/sf/sandforge/clone.mjs +20 -0
  195. package/lib/sf/sandforge/compare.mjs +20 -0
  196. package/lib/sf/sandforge/dataops.mjs +20 -0
  197. package/lib/sf/sandforge/empty.mjs +20 -0
  198. package/lib/sf/sandforge/env.mjs +20 -0
  199. package/lib/sf/sandforge/frozen.mjs +20 -0
  200. package/lib/sf/sandforge/hardis-commands.mjs +20 -0
  201. package/lib/sf/sandforge/index.mjs +20 -0
  202. package/lib/sf/sandforge/mcp.mjs +20 -0
  203. package/lib/sf/sandforge/monitor.mjs +20 -0
  204. package/lib/sf/sandforge/pipeline.mjs +20 -0
  205. package/lib/sf/sandforge/seed.mjs +20 -0
  206. package/lib/sf/sandforge/sync.mjs +20 -0
  207. package/lib/sf/sandforge/users.mjs +20 -0
  208. package/lib/sfHelpHook.mjs +7 -0
  209. package/lib/sfPlugin.mjs +11 -0
  210. package/oclif.manifest.json +1 -0
  211. package/package.json +18 -3
  212. package/lib/chunk-2CNCDM56.mjs +0 -7
  213. package/lib/chunk-3F6Q5E7I.mjs +0 -14
  214. package/lib/chunk-4VS2V6WU.mjs +0 -25
  215. package/lib/chunk-5P4PHJRL.mjs +0 -9
  216. package/lib/chunk-5TC3QB4U.mjs +0 -10
  217. package/lib/chunk-7ABODJ4G.mjs +0 -7
  218. package/lib/chunk-7EGQP6S4.mjs +0 -7
  219. package/lib/chunk-7FFGJWHN.mjs +0 -7
  220. package/lib/chunk-7YDNUBO5.mjs +0 -7
  221. package/lib/chunk-A527W53V.mjs +0 -7
  222. package/lib/chunk-ADOAS63R.mjs +0 -7
  223. package/lib/chunk-B5QQJ4SI.mjs +0 -7
  224. package/lib/chunk-CION3VMZ.mjs +0 -7
  225. package/lib/chunk-CSBS5U5I.mjs +0 -7
  226. package/lib/chunk-DB7RBE5D.mjs +0 -7
  227. package/lib/chunk-E5ZB3LU5.mjs +0 -7
  228. package/lib/chunk-EFR2Y7E4.mjs +0 -7
  229. package/lib/chunk-EHQ3FX6X.mjs +0 -7
  230. package/lib/chunk-EQNW3UC2.mjs +0 -7
  231. package/lib/chunk-F43REJDZ.mjs +0 -10
  232. package/lib/chunk-GSG7WZHM.mjs +0 -7
  233. package/lib/chunk-HOJYWTP7.mjs +0 -20
  234. package/lib/chunk-HS4YRX4J.mjs +0 -7
  235. package/lib/chunk-I7O6C2B5.mjs +0 -8
  236. package/lib/chunk-IFETCRWE.mjs +0 -10
  237. package/lib/chunk-IQXHJEYB.mjs +0 -7
  238. package/lib/chunk-JPUR2CFX.mjs +0 -10
  239. package/lib/chunk-K327QKMD.mjs +0 -7
  240. package/lib/chunk-KRCA6IPH.mjs +0 -8
  241. package/lib/chunk-LPBMBW3O.mjs +0 -13
  242. package/lib/chunk-LWW4U276.mjs +0 -7
  243. package/lib/chunk-MFG4MUIO.mjs +0 -9
  244. package/lib/chunk-MJU2PGZQ.mjs +0 -15
  245. package/lib/chunk-OAZRPP4I.mjs +0 -7
  246. package/lib/chunk-OO6CLPEH.mjs +0 -7
  247. package/lib/chunk-OPXCV2KL.mjs +0 -7
  248. package/lib/chunk-P33PSCXK.mjs +0 -7
  249. package/lib/chunk-Q3DM32KF.mjs +0 -11
  250. package/lib/chunk-QR3WELJQ.mjs +0 -7
  251. package/lib/chunk-QWT2C74M.mjs +0 -7
  252. package/lib/chunk-R3X3LV64.mjs +0 -14
  253. package/lib/chunk-RMBPOTD7.mjs +0 -7
  254. package/lib/chunk-SIHORWVK.mjs +0 -7
  255. package/lib/chunk-T62WNR54.mjs +0 -7
  256. package/lib/chunk-TTFDUKUS.mjs +0 -47
  257. package/lib/chunk-VE6XKGGD.mjs +0 -7
  258. package/lib/chunk-VGW4MXXZ.mjs +0 -7
  259. package/lib/chunk-VS7ZXUII.mjs +0 -824
  260. package/lib/chunk-VXQLDM4R.mjs +0 -7
  261. package/lib/chunk-VYXMVJL5.mjs +0 -7
  262. package/lib/chunk-W7U5E5ZL.mjs +0 -9
  263. package/lib/chunk-WXAQ7FK3.mjs +0 -115
  264. package/lib/chunk-YS4G22C2.mjs +0 -7
  265. package/lib/chunk-ZM6OJGIG.mjs +0 -7
  266. package/lib/chunk-ZUTYVST5.mjs +0 -7
@@ -1,10 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{W as S,X as I,Y as Ae,n as Ee,o as Ce,oa as re}from"./chunk-JPUR2CFX.mjs";import{t as v,u as Be}from"./chunk-LPBMBW3O.mjs";import{b as x}from"./chunk-GSKCGQIP.mjs";import{L as ve,N as V,O as Te,f as ye,ka as Ne}from"./chunk-VYXMVJL5.mjs";import{b as ne,f as Oe}from"./chunk-INIT2UKJ.mjs";import{k as we,l as ke,m as Se}from"./chunk-L77FJZEP.mjs";import{ca as K,da as Re}from"./chunk-A527W53V.mjs";import{b as P}from"./chunk-CA5NAXSU.mjs";import{b as be,e as ee,f as te,k as he,l as W}from"./chunk-7EANH5PY.mjs";function ot(e){return e.keptChanged+e.keptDependents+e.refused+(e.notVisible??0)}function Sn(e,t){return t?"cancelled":e.every(n=>ot(n)===0)?"success":e.some(n=>n.deleted>0)?"partial":"failure"}function En(e,t){return e!=="success"||!t||t.status==="success"?e:t.status==="cancelled"?"cancelled":"partial"}function Cn(e){return e.status}function An(e){return e.filter(t=>t.deleted+t.refused+(t.notReached??0)>0).map(t=>({...ye(t.objectApiName),deleted:t.deleted,failed:t.refused,...(t.notReached??0)>0?{notSent:t.notReached}:{}}))}function Bn(e,t,n,r=!1){let o=h=>e.objects.reduce((B,C)=>B+h(C),0),i=o(h=>h.deleted),a=o(h=>h.alreadyGone),m=o(h=>h.keptChanged+h.keptDependents),u=o(h=>h.refused),c=o(h=>h.notVisible??0);if(i+a===0&&(!r||e.status==="cancelled"||m+u+c===0))return;let g=r?void 0:n,y=o(h=>h.platformCopies??0),A=e.status==="cancelled"?Math.max(0,t+y-i-a-m-u-c):0;return{removedAt:e.finishedAt,deleted:(g?.deleted??0)+i,alreadyGone:(g?.alreadyGone??0)+a,kept:m,refused:u,...A>0?{notReached:A}:{},...c>0?{notVisible:c}:{}}}function vn(...e){let t=new Set,n=[];for(let r of e.flatMap(o=>o??[])){let o=`${r.first}|${r.last}|${r.userId.slice(0,15)}`;t.has(o)||(t.add(o),n.push(r))}return n.sort((r,o)=>Date.parse(r.first)-Date.parse(o.first))}var oe=5;function M(e,t,n=1/0){return[...new Set([...e,...t])].slice(0,n)}function D(e,t){return e===void 0&&t===void 0?void 0:(e??0)+(t??0)}function Tn(...e){let t=new Map;for(let n of e.flat()){let r=t.get(n.objectApiName);if(!r){t.set(n.objectApiName,{...n});continue}let o={notVisible:D(r.notVisible,n.notVisible),notReached:D(r.notReached,n.notReached),heldByAutomation:D(r.heldByAutomation,n.heldByAutomation),heldByAutomationAfterRun:D(r.heldByAutomationAfterRun,n.heldByAutomationAfterRun),heldByAutomationAlong:D(r.heldByAutomationAlong,n.heldByAutomationAlong),platformCopies:D(r.platformCopies,n.platformCopies)},i=M(r.automationHolders??[],n.automationHolders??[]),a=r.filesLeft||n.filesLeft?{count:(r.filesLeft?.count??0)+(n.filesLeft?.count??0),names:M(r.filesLeft?.names??[],n.filesLeft?.names??[],oe)}:void 0;t.set(n.objectApiName,{objectApiName:n.objectApiName,planned:r.planned+n.planned,deleted:r.deleted+n.deleted,alreadyGone:r.alreadyGone+n.alreadyGone,keptChanged:r.keptChanged+n.keptChanged,keptDependents:r.keptDependents+n.keptDependents,refused:r.refused+n.refused,...Object.fromEntries(Object.entries(o).filter(([,m])=>m!==void 0)),heldBy:M(r.heldBy,n.heldBy),...i.length>0?{automationHolders:i}:{},unchecked:M(r.unchecked,n.unchecked),reasons:M(r.reasons,n.reasons,oe),...a?{filesLeft:a}:{}})}return[...t.values()]}function Nn(...e){let t=new Map;for(let n of e.flat()){let r=t.get(n.objectApiName);if(!r){t.set(n.objectApiName,{...n,changedBy:{...n.changedBy}});continue}let o={...r.changedBy};for(let[a,m]of Object.entries(n.changedBy))o[a]=(o[a]??0)+m;let i=D(r.platformCopies,n.platformCopies);t.set(n.objectApiName,{objectApiName:n.objectApiName,planned:r.planned+n.planned,toDelete:r.toDelete+n.toDelete,alreadyGone:r.alreadyGone+n.alreadyGone,changedSince:r.changedSince+n.changedSince,keptChanged:r.keptChanged+n.keptChanged,changedBy:o,undeletable:r.undeletable+n.undeletable,notVisible:r.notVisible+n.notVisible,unread:r.unread+n.unread,...i!==void 0?{platformCopies:i}:{},reasons:M(r.reasons,n.reasons,oe)})}return[...t.values()]}import{AsyncLocalStorage as it}from"node:async_hooks";var je=new Set(["delete","hardDelete"]),de=1e4,Pe=5e4;function _n(e){switch(e){case"production":return;case"staging":return de;case"development":case"scratch":return Pe}}var xe=new it;function ie(){let e=xe.getStore();return e?.live?e:void 0}async function Pn(e,t){let n={approved:e.approved,live:!0};try{return await xe.run(n,t)}finally{n.live=!1}}var De=class{overrides=new Map;options;constructor(t){this.options=t??{}}check(t){let n=this.checkTier(t),{orgNameOf:r}=this.options;return!n.requiresConfirmation||!r?n:{...n,question:dt(t,r(t.orgId),this.options.questionWords)}}checkTier(t){switch(t.orgTier){case"production":return this.checkProduction(t);case"staging":return this.checkStaging(t);case"development":case"scratch":return this.checkDevelopment(t)}}setProductionOverride(t,n){this.overrides.set(t,n)}isProductionOverridden(t){return this.overrides.get(t)===!0}get canAskForConfirmation(){return this.options.requestConfirmation!==void 0||ie()!==void 0}async confirmIfNeeded(t,n){if(!t.allowed||!t.requiresConfirmation)return t.allowed;let r=ie();return r?r.approved:this.options.requestConfirmation?t.question===void 0?this.options.requestConfirmation(t.impactSummary,n):this.options.requestConfirmation(t.impactSummary,n,t.question):!0}declinedWithoutAsking(t,n){if(!(!t.allowed||!t.requiresConfirmation||ie())&&this.options.requestConfirmation)return this.options.declinesWithoutAsking?.(n)}async confirmRun(t){return this.options.requestRunConfirmation?await this.options.requestRunConfirmation(t)?"confirmed":"declined":"unavailable"}orgPhrase(t,n){let r=this.options.orgNameOf?.(t.orgId);return r?n.org(t.orgTier,r,!0):n.org(t.orgTier,t.orgId,!1)}checkProduction(t){let n=[],r=je.has(t.operation),o=this.isProductionOverridden(t.orgId);n.push(`Production operation: ${t.operation} on ${t.objectName} (${q(t.recordCount)} ${st(t)}${t.alsoWrites?`, plus ${t.alsoWrites}`:""})`);let i=this.options.questionWords??Ie;return t.operation==="deploy"?{allowed:!1,requiresConfirmation:!1,blockedReason:i.deployRefused(this.orgPhrase(t,i)),warnings:n,impactSummary:U(t)}:r&&!o?{allowed:!1,requiresConfirmation:!1,blockedReason:i.deleteRefused(t.operation==="hardDelete"?"hardDelete":"delete",this.orgPhrase(t,i)),warnings:n,impactSummary:U(t)}:(r&&o&&n.push("Production override is active \u2014 destructive operation permitted"),{allowed:!0,requiresConfirmation:!0,warnings:n,impactSummary:U(t)})}checkStaging(t){let n=[],r=je.has(t.operation),o=t.operation==="deploy",i=r||o||se(t.recordCount)>de;return r&&n.push(`Destructive operation (${t.operation}) on staging org \u2014 confirmation required`),o&&n.push("Metadata deployment on staging org \u2014 confirmation required"),se(t.recordCount)>de&&n.push(`Large volume operation: ${q(t.recordCount)} records on staging`),{allowed:!0,requiresConfirmation:i,warnings:n,impactSummary:U(t)}}checkDevelopment(t){let n=[];return se(t.recordCount)>Pe&&n.push(`Large volume operation: ${q(t.recordCount)} records on ${t.orgTier} org`),{allowed:!0,requiresConfirmation:!1,warnings:n,impactSummary:U(t)}}};function q(e){return e==="unknown"?"an unknown number of":typeof e=="number"?String(e):`at most ${e.atMost}`}function se(e){return e==="unknown"?0:typeof e=="number"?e:e.atMost}function st(e){return e.operation==="deploy"?"components":"records"}var xn="the related records the run adds",Ie={sentence:(e,t,n)=>{switch(e){case"insert":return`Insert ${t} into ${n}.`;case"update":return`Update ${t} in ${n}.`;case"upsert":return`Insert or update ${t} in ${n}.`;case"delete":return`Delete ${t} in ${n}.`;case"hardDelete":return`Permanently delete ${t} in ${n}.`;case"deploy":return`Deploy ${t} to ${n}.`}},counted:(e,t)=>t==="unknown"?`${e}s`:typeof t=="number"?`${t} ${e}${t===1?"":"s"}`:`at most ${t.atMost} ${e}s`,besides:(e,t)=>`${e}, plus ${t},`,org:(e,t,n)=>n?`the ${e} org "${t}"`:`the ${e} org ${t}`,deployRefused:e=>`SandForge deploys metadata only to a sandbox, a scratch org or a Developer Edition org, not to ${e}: bring the change there through your release process, as a change set or a deployment from source control.`,deleteRefused:(e,t)=>e==="hardDelete"?`Permanently deleting records is not allowed in ${t}.`:`Deleting records is not allowed in ${t}.`},at=new Set(["SeedData","SyncData","CloneData","AutopilotData"]);function dt(e,t,n=Ie){let r=e.operation==="deploy"?"component":"record",o=at.has(e.objectName)?"":` (${e.objectName})`,i=`${n.counted(r,e.recordCount)}${o}`,a=e.alsoWrites?n.besides(i,e.alsoWrites):i,m=t?n.org(e.orgTier,t,!0):n.org(e.orgTier,e.orgId,!1);return n.sentence(e.operation,a,m)}function U(e){if(e.operation==="deploy")return`DEPLOY ${q(e.recordCount)} component(s) (${e.objectName}) to ${e.orgTier} org ${e.orgId} [module: ${e.module}]`;let t=e.alsoWrites?`, plus ${e.alsoWrites},`:"";return`${e.operation.toUpperCase()} ${q(e.recordCount)} ${e.objectName} record(s)${t} on ${e.orgTier} org ${e.orgId} [module: ${e.module}]`}function J(e,t){return`${e} ${t}${e===1?"":"s"}`}var ct={cost:({records:e,objects:t,requests:n,seconds:r,megabytes:o,keepDays:i})=>`Checkpoint first: about ${J(e,"record")} of ${J(t,"object")}, ${J(n,"API request")}, ${r} s, ${o} MB on this machine, unencrypted, and none of the org's storage, `+(i===0?"kept until you delete it.":`kept ${J(i,"day")}.`),added:(e,t)=>`Added: ${e} \u2014 ${t}`,notHeld:(e,t)=>`Not in the checkpoint: ${e} \u2014 ${t}`,more:e=>`\u2026 and ${e} more`,unknown:"What an Apex trigger, or automation that could not be read, creates as the run writes is not known: a rewind leaves those records as they are."},ae=10;function ut(e){return e<=0?"0":Math.max(.1,Math.ceil(e/1048576*10-1e-9)/10).toFixed(1)}function In(e,t=ct){let{estimate:n}=e,r=[t.cost({records:n.records,objects:e.objects.length,requests:n.apiRequests,seconds:Math.ceil(n.seconds),megabytes:ut(n.bytes),keepDays:e.keepDays})],o=(i,a)=>{for(let{objectApiName:m,reason:u}of i.slice(0,ae))r.push(a(m,u));i.length>ae&&r.push(t.more(i.length-ae))};return o(e.added,t.added),o(e.notHeld,t.notHeld),r.push(t.unknown),r}import{randomUUID as lt}from"node:crypto";var ce="\0configStore:revision",ft="\0configStore";function mt(e){let t=e[ce]?.value;if(t!==void 0)try{let n=JSON.parse(t);return typeof n.writer=="string"&&typeof n.write=="number"?{writer:n.writer,write:n.write}:void 0}catch{return}}var Me=class{backend;logWarning;writer=lt();writes=0;written;constructor(t,n){this.backend=t,this.logWarning=n}initialize(){this.backend.getData()}get(t){let n=this.current()[t];if(n)try{return JSON.parse(n.value)}catch(r){let o=P(r);this.logWarning?.(`[ConfigStore] Failed to parse JSON for key "${t}": ${o}`);return}}set(t,n,r="general"){let o=JSON.stringify(n);this.update(i=>{let a=i[t];return a&&a.value===o&&a.category===r?!1:(i[t]={value:o,category:r},!0)})}delete(t){return this.update(n=>t in n?(delete n[t],!0):!1)}has(t){return t in this.current()}getByCategory(t){let n={};for(let[r,o]of Object.entries(this.current()))if(o.category===t)try{n[r]=JSON.parse(o.value)}catch(i){let a=P(i);this.logWarning?.(`[ConfigStore] Corrupted entry in category "${t}", key "${r}": ${a}`)}return n}getAllKeys(){return Object.keys(this.current()).filter(t=>t!==ce)}getKeysByPrefix(t){return this.getAllKeys().filter(n=>n.startsWith(t))}clearCategory(t){let n=0;return this.update(r=>{for(let[o,i]of Object.entries(r))i.category===t&&(delete r[o],n++);return n>0}),n}clearAll(){this.write({})}current(){let t=this.backend.getData(),n=mt(t);return this.written&&n?.writer===this.writer&&n.write<this.writes?this.written:t}update(t){let n={...this.current()},r=t(n);return r&&this.write(n),r}write(t){this.writes+=1,t[ce]={value:JSON.stringify({writer:this.writer,write:this.writes}),category:ft},this.backend.setData(t),this.written=t}};var pt=300,gt=1024,bt=160,ht=500,Ke=40,Rt=4,yt=3,Ot=3,wt=1,kt=1e3,St=1,$e=200,Et=60,Ct=50,At=Buffer.byteLength(`${JSON.stringify({Id:"0".repeat(18)})}
8
- `),Bt="IsDeleted = false",Ve=4;function vt(e){return e.access?.kind==="perObject"?e.access.requests:0}var Tt=1,Nt=200,jt=3,Dt=1,_t=1,Je=2,Pt=3,xt=2e3,It=100,ze=["Id","SystemModstamp"],Le=23,j=2.5,b=.35,Mt=1,$t=.9,O=.5,pe=.25,T=.86,Lt="ContentVersion",Ft="ContentDocument",ue=200,Fe=150,R={apiRequests:0,seconds:0};function d(e,t){return{apiRequests:e,seconds:e*t}}function G(e){return{apiRequests:e,seconds:p(e,Ae)*b}}function l(...e){return e.reduce((t,n)=>({apiRequests:t.apiRequests+n.apiRequests,seconds:t.seconds+n.seconds}),R)}function p(e,t){return e>0?Math.ceil(e/t):0}function E(e){return p(e,x)}function Ye(e){return ne(e,ze).length}function Wt(e){return e.length>It?x/4:x}function Q(e,t){return p(e,Wt(t))*Ye(t)}function We(e,t){if(e.length===0)return 0;let n=2*(e.length-1)+2+2*(t-1);for(let r of e){let o=JSON.stringify(r,null,2),i=1;for(let a=o.indexOf(`
9
- `);a>=0;a=o.indexOf(`
10
- `,a+1))i++;n+=Buffer.byteLength(o,"utf8")+i*2*t}return n}function Ut(e){let t=gt+(e.printsBytes??0),n=[];for(let r of e.objects)t+=r.records*pt+Be(r.records,2),r.records>0&&(t+=bt),t+=(r.inBin??0)*At,t+=(r.links??0)*(Et+Ct),r.entry!==void 0&&n.push(r.entry);return t+We(n,2)+We(e.leftOut??[],3)}function Xn(e,t,n){let[,...r]=ne(t,ze),o=n==="scanAllLive"?Bt:void 0;return r.map(i=>Oe(e,i,o))}function Ue(e,t){return t.reduce((n,r)=>n+p(e,Math.max(1,r)),0)}function qt(e,t){if(e.records===0)return{pages:0,reads:0};let n=Math.floor(e.records/t),r=e.records-n*t,o=e.otherGroups??[];return{pages:n+(r>0?1:0),reads:n*Ue(t,o)+Ue(r,o)}}function Zn(e){let t=e.objects.length,n=p(e.described,I),r=e.describedAlone??0,o=G(p(e.counted??t,S)),i=(e.countedAlone??0)+p(e.recounted??0,S),a=o.apiRequests+i,m=G(p(t,S)),u=Math.min(e.pageRows,kt),c=0,g=0,y=0;for(let f of e.objects){y+=f.records;let w=qt(f,u);c+=w.pages,g+=w.reads}let A=H(e.objects.map(f=>$(f.inBin??0))),h=Gt(e.objects),B=e.objects.filter(f=>(f.stampedSince??0)>0),C=l(H(B.flatMap(f=>[$(f.stampedSince??0),1])),G(p(B.length,S))),F=c+g+(c>0?wt:0),s={guard:Rt,scope:yt+n+r,start:Ot,counts:a,bin:A.apiRequests,snapshot:F+h.apiRequests,stability:St+m.apiRequests+C.apiRequests};return{records:y,apiRequests:Object.values(s).reduce((f,w)=>f+w,0),requestsByPhase:s,seconds:Math.ceil(n*j+(r+i)*b+o.seconds+m.seconds+A.seconds+C.seconds+h.seconds+c*Mt+g*O),bytes:Ut(e)}}function Gt(e){let t=e.filter(o=>o.links!==void 0);if(t.length===0)return R;let n=0,r=0;for(let o of t)o.links===null?n+=p(p(o.records,$e),S):r+=o.links??0;return l(H(t.map(o=>$(o.links??0))),d(n,O),d(p(p(r,$e),S),O))}function $(e){return Math.max(1,p(e,xt))}function H(e){let t=0,n=0;for(let r=0;r<e.length;r+=S){let o=Math.max(1,...e.slice(r,r+S));t+=1,n+=o-1}return l(d(t,b),d(n,$t))}function Ht(e){let t=new Set([...e.held,...e.moved.map(n=>n.objectApiName)]);return l(G(p(e.objects,S)),H(e.moved.flatMap(({live:n,deleted:r})=>[$(n),$(r)])),G(p(t.size,S)))}function Xe(e){let t=e.reduce((n,r)=>n+E(r),0);return l(d(t*(jt-1),O),d(t,T))}function Qt(e){return l(...e.filter(t=>t.records>0).map(({records:t,cascades:n,described:r})=>{let o=E(t);return l(d(r?0:1,j),Xe([t]),d(o*p(n,S),b),d(o*Dt,O))}))}function le(e,t){let n=R;for(let r=e;r>0;r-=v){let o=Math.min(r,v);n=l(n,d(Je,b),d(Q(o,t),O),d(V([{rows:o}]),T),d(E(o),O))}return n}function Kt(e,t,n,r){return e===0||n===0?R:l(d(r?0:1,j),d((n+E(e))*p(t,S),b))}var Vt=W({childRelationships:he(W({childSObject:be().optional(),cascadeDelete:te().optional(),restrictedDelete:te().optional()}).loose()).nullish()}).loose();function er(e,t){let n=Vt.parse(e).childRelationships??[],r=n.filter(u=>u.cascadeDelete===!0),o=t?.worked,i={dependents:n.filter(u=>(u.cascadeDelete===!0||u.restrictedDelete===!0)&&(o===void 0||u.childSObject!==void 0&&o.has(u.childSObject))).length,cascades:r.length,cascadeChildren:[...new Set(r.flatMap(u=>u.childSObject===void 0?[]:[u.childSObject]))]};if(t===void 0)return i;let a=n.filter(u=>u.cascadeDelete===!0&&u.childSObject!==void 0&&!t.inCheckpoint.has(u.childSObject.toLowerCase())),m=a.filter(u=>u.childSObject!==void 0&&t.worked?.has(u.childSObject)===!0);return{...i,outside:{all:a.length,worked:m.length}}}function ge(e,t){return e?.get(t)??{dependents:Le,cascades:Le}}function Jt(e,t){if(e<Ee||t===Lt||t===Ft)return d(V([{rows:e}]),T);let n=Math.ceil(e/Ce),r=Math.ceil(e/n),o=R;for(let i=e;i>0;i-=r){let a=Math.min(i,r);o=l(o,{apiRequests:we({stateReads:Se(a)}),seconds:ke(a)})}return o}function fe(e,t=Number.POSITIVE_INFINITY){let n=e.filter(r=>r.records>0);return n.length===0?R:l(d(Pt,b),...n.map(({records:r,dependents:o,objectApiName:i})=>{let a=E(r),m=0;for(let c=r;c>0;c-=t)Math.min(c,t)>x&&m++;let u=m*o;return l(d(1,b),d(a,O),d(u+o*a,pe),Yt(i,a,u+o*a),Jt(r,i))}))}function zt(e,t,n){return l(...e.filter(({count:r})=>r>0).map(({objectApiName:r,count:o})=>{let{dependents:i}=ge(t,r),a=o>x?i:0;return l(d(n.has(r)?0:1,j),d(a+i*E(o),pe))}))}function Yt(e,t,n){return e===void 0||K[e]===void 0||Re.has(e)?R:l(d(1,b),d(t,O),d(n,pe),d(t,T))}function N(e){return e.toDelete.createdSince+e.toDelete.broughtBackSince}function z(e){return e.toBringBack.inBin+e.toBringBack.deletedWhileTaken+Z(e)}function Z(e){return e.toBringBack.carriers??0}function L(e){return e.toDelete.comesBackWithParent+Z(e)}function Y(e){return e.cannotUndo.filter(t=>t.reason==="deletedWithCreatedParent"||t.reason==="deletedWithParentOutside").reduce((t,n)=>t+n.count,0)}function X(e){return z(e)-Z(e)+e.toBringBack.withParent}function Ze(e){return e.toGiveBack.records+e.toBringBack.inBin+e.toBringBack.withParent}function me(e){return e.cannotUndo.filter(t=>t.reason==="goneForGood").reduce((t,n)=>t+n.count,0)}function _(e){return e.toRecreate??0}function Xt(e){return me(e)+_(e)}function Zt(e,t){let n=0;for(let r=e;r>0&&t>0;r-=v){let o=Math.min(r,v);n+=p(t*E(o),S)}return n}function et(e,t,n){let r=Xt(e);return{objectApiName:e.objectApiName,live:e.toGiveBack.records+e.touched+N(e)+e.unexplained,deleted:X(e)+L(e)+Y(e),valued:e.toGiveBack.records+e.touched+e.toBringBack.withParent,backTo:X(e)+Z(e)+Y(e)>0||t.undeletable===!1&&r>0,deletes:N(e),scans:r>0&&t.undeletable!==!1,whole:e.schemaDrift!==void 0,outside:n?.get(e.objectApiName)?.outside??{all:e.outside.length,worked:e.outside.length}}}function en(e,t,n,r){let o=et(e,t,n),i=e.toBringBack,a=r?0:L(e);return{...o,live:e.toGiveBack.records+e.touched+e.unexplained+X(e)+_(e)+a,deleted:N(e)+L(e)-a+Y(e),valued:e.toGiveBack.records+e.touched+i.inBin+i.withParent+_(e),backTo:Y(e)>0||t.undeletable===!1&&me(e)>0,scans:me(e)>0&&t.undeletable!==!1,deletes:a}}function tt(e,t,n,r,o,i=0,a,m=0){let u=[],c=[],g=0,y=0,A=0,h=!1,B=0;for(let{objectApiName:s,records:f,fields:w}of e){let k=t.get(s);if(k===void 0){n.has(s)&&u.push({objectApiName:s,live:0,deleted:0});continue}u.push({objectApiName:s,live:k.live,deleted:k.deleted}),g+=Q(k.valued,w),k.backTo&&!k.whole&&y++,k.scans&&c.push(H([$(f)])),k.deletes!==0&&(!k.whole&&!k.backTo&&A++,k.outside.all>0&&(h=!0),B+=Zt(k.deletes,k.outside.worked))}a!==void 0&&(h=!0);let C=a!==void 0?1:0,F=o===void 0?p(e.length+C,I):p(o.first+C,I)+p(o.later,I);return l(d(Tt,b),d(F,j),Ht({objects:e.length,held:e.filter(s=>s.records>0).map(s=>s.objectApiName),moved:u}),d(g,O),d(p(y,I),j),d(A,b),d(h?1:0,j),d(B,b),d(i,b),d(m,b),d(a?.requests??0,O),...c,d(p(p(r,Nt),S),b))}function nt(e){return e.files!==void 0?{requests:e.filesRequests??0}:void 0}function rt(e,t){let n=new Map(e.diff.objects.map(o=>[o.objectApiName,o])),r=new Map;for(let o of e.objects){let i=n.get(o.objectApiName);i&&r.set(o.objectApiName,t(i,o))}return r}function tn(e){let t=new Set(e.diff.objects.flatMap(n=>Object.keys(n.lastChangedBy)));return tt(e.objects,rt(e,(n,r)=>et(n,r,e.relationships)),new Set(e.diff.unread.map(n=>n.objectApiName)),t.size,e.diff.described,e.diff.parentsOutsideRequests??0,nt(e.diff),e.diff.fieldsRequests??0)}function qe(e,t,n=!1){let r=!t&&(n||e.diff.objects.some(i=>L(i)>0)),o=e.diff.described;return tt(e.objects,rt(e,(i,a)=>en(i,a,e.relationships,t)),new Set(e.diff.unread.map(i=>i.objectApiName)),r?1:0,o===void 0?void 0:{first:o.first+o.later,later:0},e.diff.parentsOutsideRequests??0,nt(e.diff),e.diff.fieldsRequests??0)}function nn(e){return l(...e.filter(t=>t>0).map(t=>l(d(1,b),d(E(t),T))))}var rn=new Set(["activateddate","activatedbyid"]);function on(e){return l(...e.filter(({objectApiName:t,records:n})=>n>0&&K[t]!==void 0).map(({records:t})=>l(d(1,b),d(E(t),T))))}function sn(e,t){return e*ht+t*Ke}function Ge(e){return l(d(Je,b),d(Ye(e),O),d(1,T),d(1,O))}function an(e,t,n,r){if(t===0)return R;let o=e==="Order"?n.find(c=>c.toLowerCase()==="status"):void 0,i=o===void 0?[]:[o],a=c=>l(le(c,n),o?le(c,i):R),m=l(Ge(n),o?Ge(i):R),u=d(Q(t,n),O);return l(a(t),r.held?l(u,m):R,r.held&&r.twice?l(a(t),m):R,r.nextPass?l(u,m):R)}function He(e,t,n,r){let o=r?.get(n.objectApiName)?.cascadeChildren;return o!==void 0?o.includes(t):e?.cascadeParents!==void 0&&e.cascadeParents.length===0?!1:e?.readOrder!==void 0&&n.readOrder!==void 0?e.readOrder<n.readOrder:!0}function dn(e){let t=e.diff.objects,n=new Map(e.objects.map(s=>[s.objectApiName,s])),r=s=>ge(e.relationships,s),o=e.diff.undoCannot?e.diff.undoCannot.reduce((s,{objectApiName:f,count:w})=>s.set(f,(s.get(f)??0)+w),new Map):void 0,i=e.diff.withParentDeleted?new Map(e.diff.withParentDeleted.map(({objectApiName:s,count:f})=>[s,f])):void 0,a=s=>{if(i!==void 0)return Math.max(0,N(s)-(i.get(s.objectApiName)??0));if(o===void 0||n.get(s.objectApiName)?.undeletable!==!1)return N(s);let f=(o.get(s.objectApiName)??0)-s.toDelete.comesBackWithParent;return Math.max(0,Math.min(N(s),f))},m=t.filter(s=>a(s)>0),u=t.filter(s=>L(s)>0),c=(s,f)=>f.some(w=>w.objectApiName!==s.objectApiName&&He(n.get(w.objectApiName),w.objectApiName,s,e.relationships)),g=(s,f)=>f.some(w=>{let k=n.get(w.objectApiName);return k!==void 0&&w.objectApiName!==s.objectApiName&&He(s,s.objectApiName,k,e.relationships)}),y=t.reduce((s,f)=>s+E(z(f)),0),A=e.reusesPreview!==!0&&t.some(s=>N(s)>0&&(e.relationships?.get(s.objectApiName)?.outside?.all??s.outside.length)>0),h=t.some(s=>z(s)>0&&r(s.objectApiName).cascades>0),B=l(d(h&&!A?1:0,j),Qt(t.map(s=>({records:z(s),cascades:r(s.objectApiName).cascades,described:e.reusesPreview!==!0}))),...t.map(s=>Kt(s.toBringBack.withParent,r(s.objectApiName).cascades,y,e.reusesPreview!==!0)),...t.map(s=>{let f=n.get(s.objectApiName);return f===void 0?R:an(s.objectApiName,Ze(s),f.fields,{held:c(f,m),twice:g(f,m),nextPass:c(f,u)})}),nn(t.map(_)),on(t.map(s=>({objectApiName:s.objectApiName,records:_(s)}))),fe(t.map(s=>({objectApiName:s.objectApiName,records:a(s),dependents:r(s.objectApiName).dependents})),re)),C=t.flatMap(s=>{let f=n.get(s.objectApiName),w=_(s);return w===0||f===void 0?[]:K[s.objectApiName]===void 0?[]:f.fields.some(k=>rn.has(k.toLowerCase()))?[le(w,f.fields)]:[]}),F=u.length>0||C.length>0?l(fe(u.map(s=>({objectApiName:s.objectApiName,records:L(s),dependents:r(s.objectApiName).dependents})),re),...C,qe(e,!0)):R;return l(d(_t,b),B,un(e.diff.files),qe(e,!1,C.length>0),F)}function cn(e){return e===void 0?0:e.unlink+e.relink+e.updateLinks}function un(e){return e===void 0?R:d(p(e.unlink,ue)+p(e.relink,ue)+p(e.updateLinks,ue),T)}function tr(e){let t=e.diff.objects,n=t.reduce((g,y)=>g+N(y)+y.toDelete.comesBackWithParent,0),r=t.reduce((g,y)=>g+y.toGiveBack.records,0),o=t.reduce((g,y)=>g+X(y),0),i=t.reduce((g,y)=>g+_(y),0),a=n+r+o+i,m=l(d(Ve+vt(e.diff),b),e.reusesPreview===!0?R:tn(e)),u=e.diff.files;if(a===0&&cn(u)===0)return{records:0,apiRequests:m.apiRequests,seconds:Math.ceil(m.seconds),bytes:0};let c=l(m,d(e.automationRequests,O),d(e.deliverabilityRequests??0,b),dn(e));return{records:a,apiRequests:c.apiRequests,seconds:Math.ceil(c.seconds),bytes:sn(t.reduce((g,y)=>g+Ze(y),0),n+o+2*i)+ln(u)}}function ln(e){return e===void 0?0:e.unlink*Fe+e.relink*Ke+e.updateLinks*Fe}var fn=1;function Qe(e,t){let n=R;for(let r=e;r>0;r-=v){let o=Math.min(r,v);n=l(n,d(fn,b),d(Q(o,t),O),d(V([{rows:o}]),T))}return n}function mn(e,t){let n=Math.min(e.givenBackHeld??0,e.givenBack),r=R;for(let o=e.givenBack;o>0;o-=v)r=l(r,d(Q(Math.min(o,v),t),O));return l(Qe(n,t),Qe(e.givenBack-n,t),r)}var pn=2;function gn(e){let t=Math.min(e.givenBackHeld??0,e.givenBack);return d(E(e.givenBack)+E(t)+E(e.givenBack-t),O)}function nr(e){let t=new Map(e.objects.map(c=>[c.objectApiName,c.fields])),n=e.rewound.reduce((c,g)=>c+g.deleted+g.broughtBack+g.givenBack,0),r=d(Ve,b);if(n===0)return{records:0,apiRequests:r.apiRequests,seconds:Math.ceil(r.seconds),bytes:0};let o=e.rewound.some(c=>c.deleted>0),i=e.rewound.some(c=>c.givenBack>0),a=new Set(e.rewound.filter(c=>c.broughtBack>0).map(c=>c.objectApiName)),m=o&&i?l(d(pn,b),...e.rewound.map(gn)):R,u=l(r,d(e.automationRequests,O),m,fe(e.rewound.map(c=>({objectApiName:c.objectApiName,records:c.broughtBack,dependents:ge(e.relationships,c.objectApiName).dependents}))),a.size>0?zt(e.along??[],e.relationships,a):R,Xe(e.rewound.map(c=>c.deleted)),...e.rewound.map(c=>mn(c,t.get(c.objectApiName)??[])));return{records:n,apiRequests:u.apiRequests,seconds:Math.ceil(u.seconds),bytes:0}}var bn={take:{what:"This checkpoint",then:"Take it once the org has requests to spare \u2014 the limit is counted over the last 24 hours \u2014 or pick fewer objects.",done:"No record was read."},rewind:{what:"This rewind",then:"Rewind once the org has requests to spare \u2014 the limit is counted over the last 24 hours \u2014 or rewind fewer of its objects at a time, which sends only theirs (the objects ticked in the preview, or --object on a command line).",done:"No record was read or written."},undo:{what:"This undo",then:"Undo the rewind once the org has requests to spare \u2014 the limit is counted over the last 24 hours \u2014 while the recycle bin still holds what it brings back.",done:"No record was read or written."}},hn=W({FileStorageMB:W({Max:ee(),Remaining:ee()}).loose()}).loose();async function rr(e,t){let n,r;try{n=await e.request({method:"GET",url:"/limits"}),r=await ve({request:()=>Promise.resolve(n)})}catch(a){throw new Error(`${t} did not say how many API requests it has left today: ${P(a)}`)}let o;try{o=await Ne({request:()=>Promise.resolve(n)})}catch(a){o={unread:P(a)}}let i=hn.safeParse(n);return{...r,emails:o,...i.success?{fileStorage:{max:i.data.FileStorageMB.Max,remaining:i.data.FileStorageMB.Remaining}}:{}}}var Rn={deliverability:e=>`to read whether ${e} delivers its emails`};function yn(e,t){if(e===void 0)return"";let n=Object.entries(Rn).flatMap(([r,o])=>{let i=e[r]??0;return i>0&&o?[{requests:i,words:o(t)}]:[]}).map(({requests:r,words:o},i)=>`${r}${i===0?" of them":""} ${o}`);return n.length>0?` (${n.join(", ")})`:""}function or(e,t,n,r){let o=Te(t,n);if(o.verdict!=="exceeds")return;let i=bn[e];return{code:"API_BUDGET",message:`${i.what} takes about ${o.estimate} API requests${yn(o.parts,r)}; ${r} has ${n.remaining} of its ${n.max} left today. ${i.then} ${i.done}`}}var On={rewind:{then:"Free file storage, then rewind again.",done:"Nothing was written."},undo:{then:"Free file storage, then undo the rewind again while the recycle bin still holds them.",done:"Nothing was written."}};function wn(e){let t=e/1048576;return t<1?`${Math.max(1,Math.round(t*10))/10} MB`:`${Math.ceil(t)} MB`}function ir(e,t,n,r){if(n===void 0||t.files===0||t.bytes<=n*1048576)return;let o=On[e];return{code:"FILE_STORAGE",message:`Bringing back ${t.files===1?"1 file":`${t.files} files`} takes ${wn(t.bytes)} of file storage; ${r} has ${n} MB left. ${o.then} ${o.done}`}}export{Sn as a,En as b,Cn as c,An as d,Bn as e,vn as f,Tn as g,Nn as h,_n as i,ie as j,Pn as k,De as l,xn as m,In as n,Me as o,kt as p,xt as q,b as r,Mt as s,T as t,Xn as u,Zn as v,er as w,dn as x,tr as y,nr as z,rr as A,or as B,ir as C};
@@ -1,7 +0,0 @@
1
- import { createRequire as __sandforgeRequire } from 'node:module';
2
- import { fileURLToPath as __sandforgePath } from 'node:url';
3
- import { dirname as __sandforgeDirname } from 'node:path';
4
- const require = __sandforgeRequire(import.meta.url);
5
- const __filename = __sandforgePath(import.meta.url);
6
- const __dirname = __sandforgeDirname(__filename);
7
- import{A as y,B as z,C as A,D as B,E as C,F as D,G as E,H as F,I as G,J as H,K as I,L as J,M as K,N as L,O as M,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"./chunk-IFETCRWE.mjs";import"./chunk-TYYOBZMU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-GGD7ON3M.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-TTFDUKUS.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-NTOVCTRS.mjs";export{a as CHECKPOINT_DIR_MODE,b as CHECKPOINT_FILE_MODE,p as CHECKPOINT_FILE_PATH,D as CheckpointStoreError,c as DEFAULT_KEEP_DAYS,d as EXPIRY_WARNING_DAYS,I as OrgCheckpointStore,f as PREVIEW_KEEP_MS,e as RECYCLE_BIN_DAYS,L as acquireOrgLock,m as binFileOf,A as binReachSince,G as compressedFieldPrints,h as defaultCheckpointLocksDir,g as defaultCheckpointStoreRoot,x as expiresAtFor,z as expiresSoon,s as exportedFileIn,r as exportedFilesOf,n as filesDocumentsFileOf,o as filesLinksFileOf,j as indexFileOf,y as isExpired,q as isExportedPath,J as latestRewindOf,v as makePrivateDir,w as newFolderId,l as notInBinFileOf,H as openCheckpointStore,K as orgLockFileOf,M as orgLockHolder,i as organizationKey,t as previewDirOf,F as readFieldPrints,k as recreatedFileOf,u as rewindDirOf,B as scratchOrgExpired,C as scratchOrgExpiresSoon,E as storeRefusalWords};