sandforge 1.79.0 → 1.81.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 (256) hide show
  1. package/bin/sandforge-pipeline.mjs +12 -0
  2. package/lib/{chunk-BN7A4GRQ.mjs → chunk-2IB7I3IQ.mjs} +1 -1
  3. package/lib/{chunk-PBI4BYWW.mjs → chunk-2NAIUKVL.mjs} +1 -1
  4. package/lib/chunk-2OIRJEYE.mjs +7 -0
  5. package/lib/{chunk-FOVVHGEP.mjs → chunk-2OZG6GRW.mjs} +1 -1
  6. package/lib/{chunk-5CD257T7.mjs → chunk-2Z54GB6X.mjs} +1 -1
  7. package/lib/chunk-2ZMGVBLW.mjs +7 -0
  8. package/lib/{chunk-4NAHW2D3.mjs → chunk-33ZX3A56.mjs} +1 -1
  9. package/lib/{chunk-4SNDMJP2.mjs → chunk-3AOKLIVE.mjs} +1 -1
  10. package/lib/{chunk-SIOZXPFG.mjs → chunk-3B5H24ZG.mjs} +1 -1
  11. package/lib/chunk-43K2C6H2.mjs +7 -0
  12. package/lib/chunk-4JKR4PTZ.mjs +8 -0
  13. package/lib/chunk-4L7FBOJS.mjs +8 -0
  14. package/lib/chunk-5344TZBT.mjs +11 -0
  15. package/lib/{chunk-SAR5622P.mjs → chunk-54HYHHVL.mjs} +1 -1
  16. package/lib/chunk-55LQD3Y3.mjs +7 -0
  17. package/lib/chunk-56MPPWLA.mjs +7 -0
  18. package/lib/chunk-5C5XEVZN.mjs +11 -0
  19. package/lib/chunk-5CKWGZX4.mjs +9 -0
  20. package/lib/{chunk-RSWDYIHY.mjs → chunk-5GBO4KD5.mjs} +1 -1
  21. package/lib/{chunk-GNC27UEU.mjs → chunk-5UT2ZBGF.mjs} +1 -1
  22. package/lib/chunk-5VQNKDFU.mjs +7 -0
  23. package/lib/chunk-5WGA5CZB.mjs +7 -0
  24. package/lib/chunk-5ZKCLBTN.mjs +474 -0
  25. package/lib/chunk-67CC7RAE.mjs +7 -0
  26. package/lib/{chunk-5O6JOMHS.mjs → chunk-6CDIIFNX.mjs} +1 -1
  27. package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
  28. package/lib/{chunk-7UQD6V6F.mjs → chunk-6FMLW7PH.mjs} +1 -1
  29. package/lib/chunk-6IGEASOF.mjs +7 -0
  30. package/lib/{chunk-H2PJNIYJ.mjs → chunk-6NADW3OI.mjs} +1 -1
  31. package/lib/chunk-6SEDOIO3.mjs +10 -0
  32. package/lib/{chunk-AUTM6H6Z.mjs → chunk-742SSN7I.mjs} +1 -1
  33. package/lib/chunk-7DALDJMO.mjs +7 -0
  34. package/lib/chunk-7PK5QDQI.mjs +7 -0
  35. package/lib/chunk-AELFEK3G.mjs +7 -0
  36. package/lib/chunk-AITNZWLB.mjs +9 -0
  37. package/lib/{chunk-HV2MXMGI.mjs → chunk-AJPSGVMD.mjs} +1 -1
  38. package/lib/{chunk-OTWRDD6L.mjs → chunk-BNO5GIJ6.mjs} +1 -1
  39. package/lib/{chunk-K2FBZIXY.mjs → chunk-BWWQXU2B.mjs} +1 -1
  40. package/lib/{chunk-IC2C2GOF.mjs → chunk-BXZ73A5M.mjs} +1 -1
  41. package/lib/chunk-BZFIOZS3.mjs +156 -0
  42. package/lib/{chunk-XBG5SP6Q.mjs → chunk-C4YGSK6W.mjs} +1 -1
  43. package/lib/chunk-CAFUNR6D.mjs +7 -0
  44. package/lib/chunk-CULAOP3U.mjs +7 -0
  45. package/lib/chunk-D62KWDDT.mjs +7 -0
  46. package/lib/{chunk-BILZ3SSR.mjs → chunk-D7P7DTWL.mjs} +1 -1
  47. package/lib/chunk-DHGPDSXS.mjs +7 -0
  48. package/lib/{chunk-ZXH4MBWP.mjs → chunk-DHIW4IO5.mjs} +1 -1
  49. package/lib/{chunk-NM4MDLK4.mjs → chunk-DMBR24CK.mjs} +1 -1
  50. package/lib/chunk-DPYTG6DM.mjs +48 -0
  51. package/lib/chunk-DQR5NDMI.mjs +7 -0
  52. package/lib/chunk-DXOXLUZA.mjs +7 -0
  53. package/lib/chunk-E2OBAWSH.mjs +7 -0
  54. package/lib/chunk-E2YJVSX6.mjs +10 -0
  55. package/lib/chunk-EAFLDSQ2.mjs +7 -0
  56. package/lib/{chunk-HCIDVIOW.mjs → chunk-EH5YUA5W.mjs} +1 -1
  57. package/lib/{chunk-2BVTCNWA.mjs → chunk-EOSEMFPU.mjs} +1 -1
  58. package/lib/chunk-ETT5GP4P.mjs +13 -0
  59. package/lib/{chunk-3SRXFZSD.mjs → chunk-FDGFUEK3.mjs} +1 -1
  60. package/lib/{chunk-3DCUADVK.mjs → chunk-FLNLG43R.mjs} +1 -1
  61. package/lib/{chunk-HTJ5OGP5.mjs → chunk-FSDO4DJA.mjs} +1 -1
  62. package/lib/{chunk-HJKM3E56.mjs → chunk-FSZTXLNW.mjs} +1 -1
  63. package/lib/chunk-FTA5LOVX.mjs +7 -0
  64. package/lib/chunk-G4VXPS3A.mjs +7 -0
  65. package/lib/chunk-GF247DA7.mjs +7 -0
  66. package/lib/{chunk-QRV2OSIS.mjs → chunk-GK7VEYFM.mjs} +1 -1
  67. package/lib/{chunk-5MMXFWPD.mjs → chunk-GR3NGDVM.mjs} +1 -1
  68. package/lib/{chunk-P7GSGFJO.mjs → chunk-GTIXJCGS.mjs} +1 -1
  69. package/lib/{chunk-342FN7AO.mjs → chunk-GWRKS3AL.mjs} +1 -1
  70. package/lib/{chunk-LQ4DRFUH.mjs → chunk-GYKNCYES.mjs} +1 -1
  71. package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
  72. package/lib/chunk-HVC5CYIB.mjs +7 -0
  73. package/lib/{chunk-EQF2IJS2.mjs → chunk-HYBH5PFM.mjs} +1 -1
  74. package/lib/chunk-HYOOJVR6.mjs +7 -0
  75. package/lib/{chunk-TQX3PURV.mjs → chunk-IBURU7T7.mjs} +1 -1
  76. package/lib/chunk-ICIYL45C.mjs +7 -0
  77. package/lib/{chunk-K22PA4XL.mjs → chunk-IKGHRYCN.mjs} +1 -1
  78. package/lib/chunk-IM2XA6JI.mjs +7 -0
  79. package/lib/{chunk-P2PJYWGQ.mjs → chunk-J6G23RUI.mjs} +1 -1
  80. package/lib/{chunk-JVL444U5.mjs → chunk-JU2XEKEO.mjs} +1 -1
  81. package/lib/{chunk-H45UXY6G.mjs → chunk-K55LH4ZQ.mjs} +1 -1
  82. package/lib/chunk-K5HV4YRO.mjs +7 -0
  83. package/lib/{chunk-IAZB4WIL.mjs → chunk-K77NR3UK.mjs} +1 -1
  84. package/lib/chunk-KE2PGD6C.mjs +7 -0
  85. package/lib/chunk-KGYXLSQ5.mjs +37 -0
  86. package/lib/{chunk-TEOLMRDO.mjs → chunk-KNIRA333.mjs} +1 -1
  87. package/lib/chunk-KOQV4WXC.mjs +8 -0
  88. package/lib/{chunk-PNCONNFJ.mjs → chunk-KRNFVAGC.mjs} +1 -1
  89. package/lib/chunk-L5FGY6YA.mjs +7 -0
  90. package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
  91. package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
  92. package/lib/{chunk-ZOVSMN5C.mjs → chunk-LO527YLT.mjs} +1 -1
  93. package/lib/chunk-MAHZMPMZ.mjs +7 -0
  94. package/lib/{chunk-QQZZMKU3.mjs → chunk-MHW6DV6T.mjs} +1 -1
  95. package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
  96. package/lib/{chunk-6EBMEGZB.mjs → chunk-MKNAZPOT.mjs} +1 -1
  97. package/lib/{chunk-NTDN2JQZ.mjs → chunk-MNITSYI2.mjs} +8 -8
  98. package/lib/chunk-MO3N5XVV.mjs +341 -0
  99. package/lib/{chunk-SBIMVCXT.mjs → chunk-MS4FJDFD.mjs} +9 -9
  100. package/lib/chunk-MWLFFVQV.mjs +8 -0
  101. package/lib/chunk-N6HHNR6J.mjs +7 -0
  102. package/lib/chunk-N7J6NJQ6.mjs +7 -0
  103. package/lib/chunk-NJ3EOEHS.mjs +9 -0
  104. package/lib/chunk-NWPQF5XR.mjs +7 -0
  105. package/lib/{chunk-PUOX4NBJ.mjs → chunk-NWVVCZUK.mjs} +1 -1
  106. package/lib/{chunk-DLDX6RRC.mjs → chunk-O6ADMP36.mjs} +1 -1
  107. package/lib/chunk-O7DAFE6M.mjs +14 -0
  108. package/lib/chunk-OEHVAJAB.mjs +7 -0
  109. package/lib/chunk-OETEC3P7.mjs +7 -0
  110. package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
  111. package/lib/chunk-OIIL4NVI.mjs +7 -0
  112. package/lib/chunk-OMZJ37JI.mjs +15 -0
  113. package/lib/{chunk-NZ5ZZLKS.mjs → chunk-ONMBSACW.mjs} +1 -1
  114. package/lib/chunk-OQQHNYR7.mjs +272 -0
  115. package/lib/{chunk-AAVJ5XVX.mjs → chunk-OU5W7SCB.mjs} +1 -1
  116. package/lib/{chunk-RSYICMZG.mjs → chunk-OVOLG3AL.mjs} +1 -1
  117. package/lib/{chunk-F74IHMGL.mjs → chunk-OXKZ4Y3B.mjs} +1 -1
  118. package/lib/{chunk-W7KFAY55.mjs → chunk-OZNLOV4U.mjs} +1 -1
  119. package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
  120. package/lib/chunk-PPGDAUEQ.mjs +7 -0
  121. package/lib/{chunk-RACDTRZA.mjs → chunk-PYUEHBA6.mjs} +1 -1
  122. package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
  123. package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
  124. package/lib/{chunk-PZTSVQSF.mjs → chunk-QXLZINZB.mjs} +1 -1
  125. package/lib/chunk-R2BJWO5N.mjs +20 -0
  126. package/lib/chunk-R6TF26V4.mjs +10 -0
  127. package/lib/{chunk-P42X3B4D.mjs → chunk-RKALOKAU.mjs} +1 -1
  128. package/lib/chunk-SQGP46QS.mjs +7 -0
  129. package/lib/chunk-SU65Z2BA.mjs +7 -0
  130. package/lib/chunk-SW2NUKQL.mjs +9 -0
  131. package/lib/chunk-T26C576X.mjs +9 -0
  132. package/lib/{chunk-3OHPD72J.mjs → chunk-T3PLRQ2T.mjs} +1 -1
  133. package/lib/chunk-T5VAULLQ.mjs +7 -0
  134. package/lib/chunk-TEIBWMJM.mjs +7 -0
  135. package/lib/chunk-TKQQVB2D.mjs +9 -0
  136. package/lib/{chunk-RAAANPPG.mjs → chunk-TPHXRHOA.mjs} +1 -1
  137. package/lib/chunk-TQ2TQHTT.mjs +9 -0
  138. package/lib/{chunk-IEYG5ATY.mjs → chunk-TQM2XJ27.mjs} +1 -1
  139. package/lib/{chunk-X65MT4W3.mjs → chunk-UCHAZ4ZU.mjs} +1 -1
  140. package/lib/chunk-UIUPPEFB.mjs +7 -0
  141. package/lib/{chunk-QPF6C5MX.mjs → chunk-UT27HXE7.mjs} +1 -1
  142. package/lib/{chunk-J7HVXMSW.mjs → chunk-UUSLTW5V.mjs} +1 -1
  143. package/lib/chunk-V2QO6KOE.mjs +19 -0
  144. package/lib/chunk-V473C7LY.mjs +7 -0
  145. package/lib/chunk-V4RKM4QZ.mjs +8 -0
  146. package/lib/chunk-VSU74RQ3.mjs +9 -0
  147. package/lib/chunk-VV3B6IC3.mjs +7 -0
  148. package/lib/chunk-W2AAGIZF.mjs +7 -0
  149. package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
  150. package/lib/chunk-WD47PGUS.mjs +10 -0
  151. package/lib/{chunk-3CA767QB.mjs → chunk-WEZLXE34.mjs} +1 -1
  152. package/lib/{chunk-WFEB5X4U.mjs → chunk-WI4HYWV6.mjs} +1 -1
  153. package/lib/{chunk-AR7BE5O2.mjs → chunk-WM5JI4JI.mjs} +1 -1
  154. package/lib/chunk-WWTXRWNZ.mjs +7 -0
  155. package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
  156. package/lib/{chunk-ZJKCWBRJ.mjs → chunk-X2ZVSQ54.mjs} +1 -1
  157. package/lib/{chunk-SFURUNJM.mjs → chunk-XC2QKQT5.mjs} +1 -1
  158. package/lib/chunk-XC54KKKC.mjs +7 -0
  159. package/lib/chunk-XEB6HZ34.mjs +7 -0
  160. package/lib/chunk-XGKSSCW7.mjs +7 -0
  161. package/lib/chunk-XIZ5LMQM.mjs +7 -0
  162. package/lib/{chunk-RFEO2KAN.mjs → chunk-Y5ZCPY36.mjs} +1 -1
  163. package/lib/{chunk-TBZMC2VV.mjs → chunk-YCSFP6ER.mjs} +4 -4
  164. package/lib/{chunk-YBU4Z4QV.mjs → chunk-YHIOS2PU.mjs} +1 -1
  165. package/lib/chunk-YIGFYZQY.mjs +7 -0
  166. package/lib/chunk-YJEXE6HZ.mjs +925 -0
  167. package/lib/{chunk-57VHUYNG.mjs → chunk-YOGMP72T.mjs} +4 -4
  168. package/lib/chunk-ZRUDYB7O.mjs +7 -0
  169. package/lib/{chunk-55HEMHEG.mjs → chunk-ZUA5BNAO.mjs} +1 -1
  170. package/lib/chunk-ZWCRWF7E.mjs +7 -0
  171. package/lib/{chunk-VHI54FBK.mjs → chunk-ZWZXQTAK.mjs} +53 -53
  172. package/lib/sandforge-autopilot.mjs +29 -24
  173. package/lib/sandforge-backup.mjs +67 -32
  174. package/lib/sandforge-checkpoint.mjs +1 -347
  175. package/lib/sandforge-cleanup.mjs +14 -10
  176. package/lib/sandforge-clone.mjs +1 -1
  177. package/lib/sandforge-compare.mjs +9 -8
  178. package/lib/sandforge-dataops.mjs +1 -1
  179. package/lib/sandforge-empty.mjs +15 -15
  180. package/lib/sandforge-env.mjs +101 -101
  181. package/lib/sandforge-frozen.mjs +1 -257
  182. package/lib/sandforge-mcp.mjs +33 -14
  183. package/lib/sandforge-monitor.mjs +7 -7
  184. package/lib/sandforge-pipeline.mjs +88 -0
  185. package/lib/sandforge-seed.mjs +1 -1
  186. package/lib/sandforge-sync.mjs +1 -1
  187. package/lib/sandforge.mjs +6 -6
  188. package/package.json +2 -1
  189. package/lib/chunk-2S5OMIIA.mjs +0 -7
  190. package/lib/chunk-36U7IQ6Y.mjs +0 -25
  191. package/lib/chunk-3F5YMM2F.mjs +0 -7
  192. package/lib/chunk-3RYLICRX.mjs +0 -7
  193. package/lib/chunk-42RER7V4.mjs +0 -14
  194. package/lib/chunk-4GL773D5.mjs +0 -7
  195. package/lib/chunk-4HFRHFGQ.mjs +0 -7
  196. package/lib/chunk-4U6NXJNL.mjs +0 -7
  197. package/lib/chunk-4XZ5YT5O.mjs +0 -7
  198. package/lib/chunk-5AJRHRXA.mjs +0 -20
  199. package/lib/chunk-5HMAPZBV.mjs +0 -7
  200. package/lib/chunk-5P4PHJRL.mjs +0 -9
  201. package/lib/chunk-5QKTYCWE.mjs +0 -11
  202. package/lib/chunk-6LAXTAVN.mjs +0 -7
  203. package/lib/chunk-6MUEPV7M.mjs +0 -9
  204. package/lib/chunk-6QSM2WIH.mjs +0 -10
  205. package/lib/chunk-75ADZS6B.mjs +0 -7
  206. package/lib/chunk-ALJVEUUS.mjs +0 -7
  207. package/lib/chunk-ALUFROGA.mjs +0 -7
  208. package/lib/chunk-B45CNPUX.mjs +0 -47
  209. package/lib/chunk-BS5T3MOQ.mjs +0 -7
  210. package/lib/chunk-CGWXQX75.mjs +0 -7
  211. package/lib/chunk-D3QRXG63.mjs +0 -787
  212. package/lib/chunk-EEVVGGM6.mjs +0 -7
  213. package/lib/chunk-ENLBYECD.mjs +0 -7
  214. package/lib/chunk-EQOQASDQ.mjs +0 -7
  215. package/lib/chunk-FQBRBBY4.mjs +0 -7
  216. package/lib/chunk-GAM726CK.mjs +0 -7
  217. package/lib/chunk-HJC7AIBK.mjs +0 -7
  218. package/lib/chunk-HUMEKZT5.mjs +0 -8
  219. package/lib/chunk-I3JKJTLO.mjs +0 -110
  220. package/lib/chunk-I7O6C2B5.mjs +0 -8
  221. package/lib/chunk-KLX67VPL.mjs +0 -7
  222. package/lib/chunk-L776PUMV.mjs +0 -7
  223. package/lib/chunk-LRFAIUN7.mjs +0 -7
  224. package/lib/chunk-LV6G4XTK.mjs +0 -7
  225. package/lib/chunk-MYTIL2JD.mjs +0 -10
  226. package/lib/chunk-NEVXIGR6.mjs +0 -10
  227. package/lib/chunk-NGSMZZDA.mjs +0 -7
  228. package/lib/chunk-NHWE66K5.mjs +0 -7
  229. package/lib/chunk-OQOZAPCI.mjs +0 -7
  230. package/lib/chunk-PA3MKJVH.mjs +0 -7
  231. package/lib/chunk-QROPNEGY.mjs +0 -14
  232. package/lib/chunk-QWT2C74M.mjs +0 -7
  233. package/lib/chunk-RH3N2H7P.mjs +0 -7
  234. package/lib/chunk-SRQDABQ2.mjs +0 -15
  235. package/lib/chunk-SVS6UMDU.mjs +0 -323
  236. package/lib/chunk-TNXUU6W7.mjs +0 -14
  237. package/lib/chunk-VGW4MXXZ.mjs +0 -7
  238. package/lib/chunk-VXHDBYMI.mjs +0 -7
  239. package/lib/chunk-WJY54JO7.mjs +0 -13
  240. package/lib/chunk-WRU5FJFC.mjs +0 -7
  241. package/lib/chunk-X2PY6MWZ.mjs +0 -7
  242. package/lib/chunk-XEFDB2R4.mjs +0 -7
  243. package/lib/chunk-XETCPL7E.mjs +0 -7
  244. package/lib/chunk-Y5CGXLUB.mjs +0 -7
  245. package/lib/chunk-Y6J6QFI2.mjs +0 -7
  246. package/lib/chunk-YMJVMFPY.mjs +0 -7
  247. package/lib/chunk-YPSRZRIT.mjs +0 -7
  248. package/lib/chunk-YS4G22C2.mjs +0 -7
  249. package/lib/chunk-YW2SBL4Z.mjs +0 -7
  250. package/lib/chunk-Z7X534S4.mjs +0 -10
  251. package/lib/chunk-ZE6HKRR4.mjs +0 -9
  252. package/lib/chunk-ZLZRU6MO.mjs +0 -7
  253. package/lib/chunk-ZPYJPGDK.mjs +0 -7
  254. package/lib/chunk-ZQOZ4EFW.mjs +0 -7
  255. package/lib/chunk-ZUTYVST5.mjs +0 -7
  256. package/lib/chunk-ZYEE34WO.mjs +0 -7
@@ -4,7 +4,7 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{e as j}from"./chunk-TNXUU6W7.mjs";import"./chunk-IC2C2GOF.mjs";import"./chunk-VGW4MXXZ.mjs";import"./chunk-JVL444U5.mjs";import"./chunk-KLX67VPL.mjs";import"./chunk-5CD257T7.mjs";import"./chunk-5AJRHRXA.mjs";import"./chunk-42RER7V4.mjs";import"./chunk-LRFAIUN7.mjs";import"./chunk-OQOZAPCI.mjs";import"./chunk-RSYICMZG.mjs";import"./chunk-IAZB4WIL.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-XEFDB2R4.mjs";import"./chunk-H45UXY6G.mjs";import"./chunk-WRU5FJFC.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-GNC27UEU.mjs";import"./chunk-YBU4Z4QV.mjs";import{b as S,c as x}from"./chunk-I7O6C2B5.mjs";import"./chunk-4GL773D5.mjs";import"./chunk-SRQDABQ2.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-LV6G4XTK.mjs";import"./chunk-HJKM3E56.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-WR2GIKWE.mjs";import"./chunk-YMJVMFPY.mjs";import"./chunk-ALJVEUUS.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-4HFRHFGQ.mjs";import"./chunk-342FN7AO.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-36U7IQ6Y.mjs";import"./chunk-XETCPL7E.mjs";import"./chunk-K2FBZIXY.mjs";import"./chunk-Z7X534S4.mjs";import"./chunk-6QSM2WIH.mjs";import"./chunk-WJY54JO7.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-DBFJB2B6.mjs";import"./chunk-NEVXIGR6.mjs";import"./chunk-NTDN2JQZ.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-F74IHMGL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-Y5CGXLUB.mjs";import"./chunk-3F5YMM2F.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-SAR5622P.mjs";import"./chunk-L776PUMV.mjs";import"./chunk-6MUEPV7M.mjs";import"./chunk-HJC7AIBK.mjs";import"./chunk-OTWRDD6L.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-TYYOBZMU.mjs";import"./chunk-RH3N2H7P.mjs";import"./chunk-ZUTYVST5.mjs";import"./chunk-55HEMHEG.mjs";import"./chunk-P42X3B4D.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-VXHDBYMI.mjs";import"./chunk-ENLBYECD.mjs";import"./chunk-PA3MKJVH.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-ZLZRU6MO.mjs";import"./chunk-WIO4XO4F.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-GCOB7K5N.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-PNCONNFJ.mjs";import"./chunk-CGWXQX75.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-SIOZXPFG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-CA5NAXSU.mjs";import{a as w,e as b,g as y}from"./chunk-MTMH6H2A.mjs";import"./chunk-B45CNPUX.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-SBIMVCXT.mjs";import"./chunk-NTOVCTRS.mjs";var v=`sandforge monitor \u2014 read an org the way the Monitor page does, without the editor.
7
+ import{b as j,q as O}from"./chunk-R2BJWO5N.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-YIGFYZQY.mjs";import"./chunk-2Z54GB6X.mjs";import"./chunk-V2QO6KOE.mjs";import"./chunk-5CKWGZX4.mjs";import"./chunk-R6TF26V4.mjs";import"./chunk-WD47PGUS.mjs";import"./chunk-5C5XEVZN.mjs";import"./chunk-DXOXLUZA.mjs";import"./chunk-5344TZBT.mjs";import"./chunk-V4RKM4QZ.mjs";import"./chunk-JU2XEKEO.mjs";import"./chunk-XIZ5LMQM.mjs";import"./chunk-AELFEK3G.mjs";import"./chunk-K77NR3UK.mjs";import"./chunk-OVOLG3AL.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-IM2XA6JI.mjs";import"./chunk-K55LH4ZQ.mjs";import"./chunk-5UT2ZBGF.mjs";import"./chunk-YHIOS2PU.mjs";import"./chunk-DHGPDSXS.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-742SSN7I.mjs";import"./chunk-E2OBAWSH.mjs";import"./chunk-OMZJ37JI.mjs";import"./chunk-43K2C6H2.mjs";import"./chunk-FSZTXLNW.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{b as S,c as x}from"./chunk-VSU74RQ3.mjs";import"./chunk-CAFUNR6D.mjs";import"./chunk-AITNZWLB.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-OEHVAJAB.mjs";import"./chunk-GWRKS3AL.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-KGYXLSQ5.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-DMBR24CK.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-4L7FBOJS.mjs";import"./chunk-OXKZ4Y3B.mjs";import"./chunk-MAHZMPMZ.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-UIUPPEFB.mjs";import"./chunk-6SEDOIO3.mjs";import"./chunk-ZWCRWF7E.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-MNITSYI2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NJ3EOEHS.mjs";import"./chunk-ETT5GP4P.mjs";import"./chunk-SW2NUKQL.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-HVC5CYIB.mjs";import"./chunk-T26C576X.mjs";import"./chunk-BNO5GIJ6.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-SQGP46QS.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-6IGEASOF.mjs";import"./chunk-KOQV4WXC.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-CULAOP3U.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-KRNFVAGC.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-2OIRJEYE.mjs";import{b as w,f as b,h as y}from"./chunk-LCDPCUXS.mjs";import"./chunk-XEB6HZ34.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZUA5BNAO.mjs";import"./chunk-RKALOKAU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-55LQD3Y3.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-EAFLDSQ2.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var v=`sandforge monitor \u2014 read an org the way the Monitor page does, without the editor.
8
8
 
9
9
  Usage:
10
10
  npx sandforge monitor --org <alias> [options]
@@ -33,11 +33,11 @@ Nothing is written to the org.
33
33
  Exit codes: 0 every request was answered (read the answers); 1 it could not
34
34
  start, or a request failed, was refused or was not answered in time; 2 a bad
35
35
  command line.
36
- `,$=["refresh","live-operations","storage","deployments","api-usage","error-logs","sessions","apex-insights","sandbox-refresh","alerts"],k={switches:["--json"],values:["--org","--op","--acknowledge","--dismiss","--repeat","--pause","--store","--wait"]};function P(g){let e=g.slice(2);(e.includes("--help")||e.includes("-h"))&&(process.stdout.write(v),process.exit(0)),w(e,k);let i=(c,m)=>{let p=e.indexOf(c);return p>=0&&p+1<e.length?e[p+1]:m},o=c=>{let m=[];for(let p=0;p<e.length;p++)e[p]===c&&p+1<e.length&&m.push(e[p+1]);return m},u=c=>{process.stderr.write(`${c}
37
- `),process.exit(2)},t=(c,m,p)=>{let l=Number(i(c,m)??m);return(!Number.isInteger(l)||l<p)&&u(`${c} takes a whole number from ${p}.`),l},s=[...new Set(o("--org"))];s.length===0&&u("Missing --org. Run with --help.");let r=o("--op");for(let c of r)c==="open-apex-jobs"&&u("open-apex-jobs opens a browser and reads nothing: it is not run from here."),$.includes(c)||u(`Not a Monitor request: "${c}". One of: ${$.join(", ")}.`);let n=o("--acknowledge"),a=o("--dismiss"),d=r.length>0?[...new Set(r)]:n.length+a.length>0?[]:[...$];return{orgs:s,operations:d,acknowledge:n,dismiss:a,repeat:t("--repeat","1",1),pauseMs:t("--pause","0",0)*1e3,storeDir:i("--store")??S("monitor"),waitMs:t("--wait","300",1)*1e3,json:e.includes("--json")}}function R(g,e){switch(g){case"refresh":return{type:"monitor:refresh",payload:{orgId:e},responseType:"monitor:data"};case"live-operations":return{type:"monitor:live-operations"};case"alerts":return{type:"monitor:alerts",responseType:"monitor:alerts:result"};default:return{type:`monitor:${g}`,payload:{orgId:e}}}}function f(g,e=6){if(g.length===0)return"\u2014";let i=g.slice(0,e).join("; ");return g.length>e?`${i} \u2026 (+${g.length-e})`:i}function C(g,e,i){let o=t=>Array.isArray(e[t])?e[t]:[],u=t=>e.truncated===!0?`; the list stops at ${t}`:"";switch(g){case"refresh":{let t=o("limits"),s=[...t].sort((l,h)=>h.usedPercent-l.usedPercent).slice(0,5),r=o("jobs"),n={};for(let l of r)n[l.status]=(n[l.status]??0)+1;let a=e.orgInfo??void 0,d=e.orgHealthStatus??void 0,c=Array.isArray(e.jobInsights)?e.jobInsights:null,m=e.trends??{},p=a&&a.type!=="Sandbox"?`, created ${String(a.createdDate??"\u2014")}`:"";return[` health score ${String(e.healthScore)}; ${t.length} limit(s), highest: ${f(s.map(l=>`${l.name} ${l.usedPercent}% (${l.max-l.remaining}/${l.max})`),5)}`,` ${r.length} job(s)${e.jobsTruncated===!0?" (the window came back full: older jobs not read)":""}: ${f(Object.entries(n).map(([l,h])=>`${l} ${h}`))}`,` job insights: ${c===null?"none sent":f(c.map(l=>l.title))}`,a?` org: type ${String(a.type)}, edition ${String(a.edition)}, instance ${String(a.instanceName)}, API ${String(a.apiVersion)}, namespace ${String(a.namespacePrefix??"\u2014")}${p}, users ${String(a.userCount)}, custom objects ${String(a.customObjectCount)}, Apex classes ${String(a.apexClassCount)}, active flows ${String(a.flowCount)}`:" org: no org info sent",d?` health check: ${String(d.overall)}; api ${String(d.apiLimitsStatus)}, storage ${String(d.storageStatus)}, failed jobs ${String(d.failedJobs)}${typeof d.failedJobsOutOf=="number"?` of the ${d.failedJobsOutOf} latest`:""}, recent error logs ${String(d.recentErrorLogs)}`:" health check: none sent",` trends: ${f(Object.entries(m).map(([l,h])=>`${l} ${h.direction} (${h.sparklineData.length} pt)`),7)}`]}case"live-operations":return[` ${o("operations").length} operation(s)`];case"storage":{let t=o("objects");return[` ${t.length} of ${String(e.objectCount??t.length)} object(s) holding records listed, total ${String(e.totalRecords)} record(s)`,` ${f(t.map(s=>`${s.objectName} ${s.recordCount}`),10)}`]}case"deployments":{let t=o("deployments");return[` ${t.length} deployment(s)${u(t.length)}`,` ${f(t.map(s=>`${s.status} ${s.startDate} (${s.componentCount})`),5)}`]}case"api-usage":{let t=o("categories");return[` ${t.length} categor(ies)`,` ${f(t.map(s=>`${s.category} ${s.usedPercent}% (${s.used}/${s.max})`),16)}`]}case"error-logs":{let t=o("errors");return[` total ${String(e.totalCount)}; ${t.length} listed${u(t.length)}; by type ${f(o("errorsByType").map(s=>`${s.type} ${s.count}`))}`,t.length>0?` newest ${t[0].timestamp}, oldest ${t[t.length-1].timestamp}`:" \u2014"]}case"sessions":{let t=o("sessions"),s={};for(let r of t)s[r.sessionType]=(s[r.sessionType]??0)+1;return[` ${t.length} session(s), ${String(e.activeUserCount)} active user(s)${u(t.length)}`,` ${f(Object.entries(s).map(([r,n])=>`${r} ${n}`),10)}`]}case"apex-insights":return[` ${o("analyses").length} log(s) analysed${u(o("analyses").length)}; top issues: ${f(o("topIssues").map(t=>t.message))}`];case"sandbox-refresh":return[` supported ${String(e.supported)}; ${o("refreshes").length} refresh(es)${u(o("refreshes").length)}; in progress ${String(e.inProgress)}`];case"alerts":{let t=o("alerts"),s=o("history"),r=t.filter(n=>n.orgId===i);return[` ${t.length} active alert(s), ${r.length} of this org; ${s.length} in history, ${s.filter(n=>n.orgId===i).length} of this org`,...t.map(n=>` ${n.id} ${n.status} ${n.orgId===i?"this org":"another org"}: ${n.message}`)]}}}function O(g,e,i,o=""){let u=`${(i.elapsedMs/1e3).toFixed(1)}s`,t=`${g} ${i.outcome} in ${u}`,s=[i.late?`${t} \u2014 past the page's timeout: the page dropped it`:t],r=i.message?.payload??{};return i.outcome!=="answered"?(i.message&&s.push(` ${String(r.message??JSON.stringify(r))}`),s):e?[...s,...C(e,r,o)]:[...s,` ${JSON.stringify(r)}`]}async function T(g=process.argv){let e=P(g),i=r=>{process[e.json?"stderr":"stdout"].write(`${r}
36
+ `,$=["refresh","live-operations","storage","deployments","api-usage","error-logs","sessions","apex-insights","sandbox-refresh","alerts"],k={switches:["--json"],values:["--org","--op","--acknowledge","--dismiss","--repeat","--pause","--store","--wait"]};function R(g){let e=g.slice(2);(e.includes("--help")||e.includes("-h"))&&(process.stdout.write(v),process.exit(0)),w(e,k);let i=(c,m)=>{let p=e.indexOf(c);return p>=0&&p+1<e.length?e[p+1]:m},o=c=>{let m=[];for(let p=0;p<e.length;p++)e[p]===c&&p+1<e.length&&m.push(e[p+1]);return m},u=c=>{process.stderr.write(`${c}
37
+ `),process.exit(2)},t=(c,m,p)=>{let l=Number(i(c,m)??m);return(!Number.isInteger(l)||l<p)&&u(`${c} takes a whole number from ${p}.`),l},s=[...new Set(o("--org"))];s.length===0&&u("Missing --org. Run with --help.");let r=o("--op");for(let c of r){if(c==="open-apex-jobs"){let m=o("--org")[0]??"<alias>";u(`open-apex-jobs opens a browser and reads nothing: it is not run from here. sf org open --target-org ${m} --path ${j} opens the same page.`)}$.includes(c)||u(`Not a Monitor request: "${c}". One of: ${$.join(", ")}.`)}let n=o("--acknowledge"),a=o("--dismiss"),d=r.length>0?[...new Set(r)]:n.length+a.length>0?[]:[...$];return{orgs:s,operations:d,acknowledge:n,dismiss:a,repeat:t("--repeat","1",1),pauseMs:t("--pause","0",0)*1e3,storeDir:i("--store")??S("monitor"),waitMs:t("--wait","300",1)*1e3,json:e.includes("--json")}}function T(g,e){switch(g){case"refresh":return{type:"monitor:refresh",payload:{orgId:e},responseType:"monitor:data"};case"live-operations":return{type:"monitor:live-operations"};case"alerts":return{type:"monitor:alerts",responseType:"monitor:alerts:result"};default:return{type:`monitor:${g}`,payload:{orgId:e}}}}function f(g,e=6){if(g.length===0)return"\u2014";let i=g.slice(0,e).join("; ");return g.length>e?`${i} \u2026 (+${g.length-e})`:i}function C(g,e,i){let o=t=>Array.isArray(e[t])?e[t]:[],u=t=>e.truncated===!0?`; the list stops at ${t}`:"";switch(g){case"refresh":{let t=o("limits"),s=[...t].sort((l,h)=>h.usedPercent-l.usedPercent).slice(0,5),r=o("jobs"),n={};for(let l of r)n[l.status]=(n[l.status]??0)+1;let a=e.orgInfo??void 0,d=e.orgHealthStatus??void 0,c=Array.isArray(e.jobInsights)?e.jobInsights:null,m=e.trends??{},p=a&&a.type!=="Sandbox"?`, created ${String(a.createdDate??"\u2014")}`:"";return[` health score ${String(e.healthScore)}; ${t.length} limit(s), highest: ${f(s.map(l=>`${l.name} ${l.usedPercent}% (${l.max-l.remaining}/${l.max})`),5)}`,` ${r.length} job(s)${e.jobsTruncated===!0?" (the window came back full: older jobs not read)":""}: ${f(Object.entries(n).map(([l,h])=>`${l} ${h}`))}`,` job insights: ${c===null?"none sent":f(c.map(l=>l.title))}`,a?` org: type ${String(a.type)}, edition ${String(a.edition)}, instance ${String(a.instanceName)}, API ${String(a.apiVersion)}, namespace ${String(a.namespacePrefix??"\u2014")}${p}, users ${String(a.userCount)}, custom objects ${String(a.customObjectCount)}, Apex classes ${String(a.apexClassCount)}, active flows ${String(a.flowCount)}`:" org: no org info sent",d?` health check: ${String(d.overall)}; api ${String(d.apiLimitsStatus)}, storage ${String(d.storageStatus)}, failed jobs ${String(d.failedJobs)}${typeof d.failedJobsOutOf=="number"?` of the ${d.failedJobsOutOf} latest`:""}, recent error logs ${String(d.recentErrorLogs)}`:" health check: none sent",` trends: ${f(Object.entries(m).map(([l,h])=>`${l} ${h.direction} (${h.sparklineData.length} pt)`),7)}`]}case"live-operations":return[` ${o("operations").length} operation(s)`];case"storage":{let t=o("objects");return[` ${t.length} of ${String(e.objectCount??t.length)} object(s) holding records listed, total ${String(e.totalRecords)} record(s)`,` ${f(t.map(s=>`${s.objectName} ${s.recordCount}`),10)}`]}case"deployments":{let t=o("deployments");return[` ${t.length} deployment(s)${u(t.length)}`,` ${f(t.map(s=>`${s.status} ${s.startDate} (${s.componentCount})`),5)}`]}case"api-usage":{let t=o("categories");return[` ${t.length} categor(ies)`,` ${f(t.map(s=>`${s.category} ${s.usedPercent}% (${s.used}/${s.max})`),16)}`]}case"error-logs":{let t=o("errors");return[` total ${String(e.totalCount)}; ${t.length} listed${u(t.length)}; by type ${f(o("errorsByType").map(s=>`${s.type} ${s.count}`))}`,t.length>0?` newest ${t[0].timestamp}, oldest ${t[t.length-1].timestamp}`:" \u2014"]}case"sessions":{let t=o("sessions"),s={};for(let r of t)s[r.sessionType]=(s[r.sessionType]??0)+1;return[` ${t.length} session(s), ${String(e.activeUserCount)} active user(s)${u(t.length)}`,` ${f(Object.entries(s).map(([r,n])=>`${r} ${n}`),10)}`]}case"apex-insights":return[` ${o("analyses").length} log(s) analysed${u(o("analyses").length)}; top issues: ${f(o("topIssues").map(t=>t.message))}`];case"sandbox-refresh":return[` supported ${String(e.supported)}; ${o("refreshes").length} refresh(es)${u(o("refreshes").length)}; in progress ${String(e.inProgress)}`];case"alerts":{let t=o("alerts"),s=o("history"),r=t.filter(n=>n.orgId===i);return[` ${t.length} active alert(s), ${r.length} of this org; ${s.length} in history, ${s.filter(n=>n.orgId===i).length} of this org`,...t.map(n=>` ${n.id} ${n.status} ${n.orgId===i?"this org":"another org"}: ${n.message}`)]}}}function A(g,e,i,o=""){let u=`${(i.elapsedMs/1e3).toFixed(1)}s`,t=`${g} ${i.outcome} in ${u}`,s=[i.late?`${t} \u2014 past the page's timeout: the page dropped it`:t],r=i.message?.payload??{};return i.outcome!=="answered"?(i.message&&s.push(` ${String(r.message??JSON.stringify(r))}`),i.outcome==="unanswered"&&s.push(` nothing came back in ${Math.round(i.elapsedMs/1e3)} s: give a longer --wait, or read fewer requests at once with --op`),s):e?[...s,...C(e,r,o)]:[...s,` ${JSON.stringify(r)}`]}async function N(g=process.argv){let e=R(g),i=r=>{process[e.json?"stderr":"stdout"].write(`${r}
38
38
  `)},o=x(e.storeDir);if(o!==void 0){process.stderr.write(`${o}
39
- `),process.exitCode=1;return}let u=j({storeDir:e.storeDir,log:r=>{/^\s*!|\[(ERR|WARN|ALERT)\]/.test(r)&&i(r)},waitMs:e.waitMs}),t=[];for(let r of e.orgs){let n=await u.connect(r);t.push(n),i(`sandforge monitor ${r} (${n.orgType}) store: ${e.storeDir}`)}let s=[];for(let r=1;r<=e.repeat;r++){e.repeat>1&&i(`
39
+ `),process.exitCode=1;return}let u=O({storeDir:e.storeDir,log:r=>{/^\s*!|\[(ERR|WARN|ALERT)\]/.test(r)&&i(r)},waitMs:e.waitMs}),t=[];for(let r of e.orgs){let n=await u.connect(r);t.push(n),i(`sandforge monitor ${r} (${n.orgType}) store: ${e.storeDir}`)}let s=[];for(let r=1;r<=e.repeat;r++){e.repeat>1&&i(`
40
40
  \u2014 pass ${r} of ${e.repeat}`);for(let n of t){t.length>1&&i(`
41
- [${n.alias}]`);for(let a of e.operations){let d=await u.request(R(a,n.id));s.push({pass:r,org:n.alias,label:`monitor:${a}`,answer:d});for(let c of O(`monitor:${a}`,a,d,n.id))i(c)}}for(let[n,a]of[["acknowledge",e.acknowledge],["dismiss",e.dismiss]])for(let d of a){let c=`monitor:alert:${n}`,m=await u.request({type:c,payload:{alertId:d}});s.push({pass:r,org:"",label:c,answer:m});for(let p of O(`${c} ${d}`,void 0,m))i(p)}r<e.repeat&&e.pauseMs>0&&await new Promise(n=>setTimeout(n,e.pauseMs))}e.json&&process.stdout.write(`${JSON.stringify({tool:"sandforge-monitor",results:s,posted:u.posted},null,2)}
42
- `),b(N(s.map(({answer:r})=>r)))}function N(g){return g.some(e=>e.outcome!=="answered")?1:0}process.argv[1]?.includes("sandforge-monitor")&&(y(),T().then(()=>process.exit(process.exitCode??0)).catch(g=>{process.stderr.write(`${g instanceof Error?g.message:String(g)}
43
- `),process.exit(1)}));export{O as describeAnswer,T as main,N as monitorExitCode,R as pageRequest,P as parseArgs};
41
+ [${n.alias}]`);for(let a of e.operations){let d=await u.request(T(a,n.id));s.push({pass:r,org:n.alias,label:`monitor:${a}`,answer:d});for(let c of A(`monitor:${a}`,a,d,n.id))i(c)}}for(let[n,a]of[["acknowledge",e.acknowledge],["dismiss",e.dismiss]])for(let d of a){let c=`monitor:alert:${n}`,m=await u.request({type:c,payload:{alertId:d}});s.push({pass:r,org:"",label:c,answer:m});for(let p of A(`${c} ${d}`,void 0,m))i(p)}r<e.repeat&&e.pauseMs>0&&await new Promise(n=>setTimeout(n,e.pauseMs))}e.json&&process.stdout.write(`${JSON.stringify({tool:"sandforge-monitor",results:s,posted:u.posted},null,2)}
42
+ `),b(I(s.map(({answer:r})=>r)))}function I(g){return g.some(e=>e.outcome!=="answered")?1:0}process.argv[1]?.includes("sandforge-monitor")&&(y(),N().then(()=>process.exit(process.exitCode??0)).catch(g=>{process.stderr.write(`${g instanceof Error?g.message:String(g)}
43
+ `),process.exit(1)}));export{A as describeAnswer,N as main,I as monitorExitCode,T as pageRequest,R as parseArgs};
@@ -0,0 +1,88 @@
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{p as De}from"./chunk-5ZKCLBTN.mjs";import"./chunk-Y5ZCPY36.mjs";import"./chunk-OIIL4NVI.mjs";import"./chunk-YCSFP6ER.mjs";import"./chunk-GYKNCYES.mjs";import"./chunk-YOGMP72T.mjs";import"./chunk-6CDIIFNX.mjs";import"./chunk-MWLFFVQV.mjs";import"./chunk-OQQHNYR7.mjs";import"./chunk-MO3N5XVV.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-TPHXRHOA.mjs";import"./chunk-2NAIUKVL.mjs";import"./chunk-TKQQVB2D.mjs";import{a as W,c as Oe,g as Ie,h as Y,i as Te,j as be,k as q,l as Ee,m as Ne,n as xe,o as Ae,p as _e,q as Ce}from"./chunk-R2BJWO5N.mjs";import"./chunk-BXZ73A5M.mjs";import"./chunk-ZRUDYB7O.mjs";import"./chunk-YIGFYZQY.mjs";import"./chunk-2Z54GB6X.mjs";import"./chunk-V2QO6KOE.mjs";import"./chunk-5CKWGZX4.mjs";import"./chunk-R6TF26V4.mjs";import"./chunk-WD47PGUS.mjs";import"./chunk-5C5XEVZN.mjs";import"./chunk-DXOXLUZA.mjs";import"./chunk-5344TZBT.mjs";import"./chunk-V4RKM4QZ.mjs";import"./chunk-JU2XEKEO.mjs";import"./chunk-XIZ5LMQM.mjs";import"./chunk-AELFEK3G.mjs";import"./chunk-K77NR3UK.mjs";import"./chunk-OVOLG3AL.mjs";import"./chunk-FQGHL7GR.mjs";import{h as Pe}from"./chunk-IM2XA6JI.mjs";import"./chunk-K55LH4ZQ.mjs";import"./chunk-5UT2ZBGF.mjs";import"./chunk-YHIOS2PU.mjs";import"./chunk-DHGPDSXS.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-742SSN7I.mjs";import{a as Fe}from"./chunk-TW3N6W5Z.mjs";import"./chunk-YJEXE6HZ.mjs";import"./chunk-FTA5LOVX.mjs";import{d as ve}from"./chunk-KNIRA333.mjs";import"./chunk-7DALDJMO.mjs";import{a as he,l as we,m as ke}from"./chunk-O7DAFE6M.mjs";import{b as K,e as de}from"./chunk-BZ24IAP5.mjs";import{a as N}from"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-E2OBAWSH.mjs";import{e as ce}from"./chunk-OMZJ37JI.mjs";import"./chunk-43K2C6H2.mjs";import"./chunk-FSZTXLNW.mjs";import"./chunk-XCA5AONB.mjs";import"./chunk-66NMFCWX.mjs";import"./chunk-WB2RIVO3.mjs";import{a as Re,c as Se}from"./chunk-VSU74RQ3.mjs";import"./chunk-CAFUNR6D.mjs";import{h as ge,i as me}from"./chunk-AITNZWLB.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-OEHVAJAB.mjs";import"./chunk-GWRKS3AL.mjs";import"./chunk-BOGNK4LV.mjs";import{m as ye}from"./chunk-KGYXLSQ5.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-DMBR24CK.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-4L7FBOJS.mjs";import"./chunk-OXKZ4Y3B.mjs";import"./chunk-MAHZMPMZ.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-UIUPPEFB.mjs";import{l as fe}from"./chunk-6SEDOIO3.mjs";import"./chunk-ZWCRWF7E.mjs";import{d as le}from"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import{h as pe,m as ue}from"./chunk-MNITSYI2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NJ3EOEHS.mjs";import"./chunk-ETT5GP4P.mjs";import"./chunk-SW2NUKQL.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-HVC5CYIB.mjs";import"./chunk-T26C576X.mjs";import"./chunk-BNO5GIJ6.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-SQGP46QS.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-6IGEASOF.mjs";import"./chunk-KOQV4WXC.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-CULAOP3U.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-KRNFVAGC.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-2OIRJEYE.mjs";import{a as oe,c as ae,f as T,h as $e}from"./chunk-LCDPCUXS.mjs";import"./chunk-XEB6HZ34.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZUA5BNAO.mjs";import"./chunk-RKALOKAU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-55LQD3Y3.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-EAFLDSQ2.mjs";import"./chunk-CA5NAXSU.mjs";import{he as ie,je as re,le as se,yc as te}from"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";import{copyFileSync as fn,existsSync as Je,mkdtempSync as gn,readFileSync as Xe,rmSync as mn,rmdirSync as hn}from"node:fs";import{tmpdir as yn}from"node:os";import{join as j,resolve as wn}from"node:path";import{randomUUID as kn}from"node:crypto";import{mkdirSync as sn}from"node:fs";import{join as on}from"node:path";var an=/^\[(WARN|ERR)\]|^\[INFO\] (?:The run lock|the confirmation)/;function je(e,t){return t==="production"?`${e??"the org"} is taken for a production org, and a pipeline from the command line writes to none`:void 0}function J(e){let t=e.journalDir??he(),n=e.backupDir??Re(),s=Se(n);if(s!==void 0)throw new Error(s);sn(e.storeDir,{recursive:!0,mode:448});let i=new Fe,r,o=Ce({storeDir:e.storeDir,log:a=>{an.test(a.trim())&&e.log(a.trim())},waitMs:0,typeScratchOrgs:!0,...e.onPost?{onPost:e.onPost}:{},services:{getSandforgeSetting:e.setting,showNotification:e.notify,...e.askApproval?{askApproval:e.askApproval}:{}},compose:a=>{let d=u=>a.orgManager.getOrg(u)?.alias,c=new fe({orgNameOf:d,requestConfirmation:(u,y)=>{let w=je(void 0,y);return w===void 0?Promise.resolve(!0):(e.log(`refused: ${w} (${u})`),Promise.resolve(!1))},declinesWithoutAsking:u=>je(void 0,u)});a.handlers.setInfraServices({productionGuard:c,backgroundRegistry:i,piiDetector:new le,checkpointFiles:{sandforgeVersion:e.sandforgeVersion,pickExportFile:()=>Promise.reject(new Error("sandforge checkpoint export saves a checkpoint to a file.")),pickImportFile:()=>Promise.reject(new Error("sandforge checkpoint import reads a checkpoint file."))}}),a.handlers.setBackgroundRegistry(i),a.handlers.setBackupRecordStore(new me(ge(n))),a.handlers.setSyncRunCreations(pe(t)),a.handlers.setSeedRunCreations(ve(t)),r={configStore:a.configStore,orgRegistry:a.orgRegistry}}});if(r===void 0)throw new Error("The host composed no handlers.");return{host:o,configStore:r.configStore,orgRegistry:r.orgRegistry,backupDir:n,dispose:()=>i.dispose()}}function X(e){switch(te(e.orgType,e.metadata?.edition)){case"Sandbox":return"sandbox";case"Scratch":return"scratch";case"Developer":return"developer";default:return"production"}}function Me(e,t){return e.length>=15&&t.length>=15&&e.slice(0,15)===t.slice(0,15)}var Le=new Set(["scratch","developer"]),ze={sandbox:"a sandbox",scratch:"a scratch org",developer:"a Developer Edition org",production:"a production org"};function dn(e,t){return e!==t?`another org, of another kind: ${ze[t]} here, ${ze[e]} in the file`:e==="sandbox"?"a sandbox refreshed since is another org, holding production\u2019s data again":"another org than the one the pipeline was exported for"}function Ge(e,t,n,s,i,r=e){return Me(n.organizationId,s.organizationId)?{ok:!0}:i!==void 0&&Me(i,s.organizationId)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: taken, as --accept-org ${r}=${i} says.`}:Le.has(n.kind)&&Le.has(s.kind)?{ok:!0,note:`${t} answers as org ${s.organizationId}, not the ${n.organizationId} the file names: a ${s.kind==="scratch"?"scratch org":"Developer Edition org"} is made again under its alias, and is not pinned to its Id.`}:{ok:!1,code:"ORG_MOVED",message:`${t} answers as org ${s.organizationId}, and the file names ${n.organizationId}: ${dn(n.kind,s.kind)}. Nothing was run.`,wayOut:`check that ${t} is the org the pipeline is for, then run again with --accept-org ${t}=${s.organizationId}; or export the pipeline again from the Automation page.`}}function Be(e,t,n,s){if(!n.staging)return{org:t};let i=X(t);if(i!=="sandbox")return{org:t,note:`${s} is marked Staging in the file, and is a ${i} org here: the mark is read of a sandbox alone, and not set.`};let r={...t,staging:!0};return e.updateOrgMetadata(r),{org:r}}function L(e){return JSON.parse(JSON.stringify(e))}function He(e,t){let n=L(e.pipeline),s=L(e.syncConfigs);for(let i of se(e)){let r=t(i.key);if(r!==void 0){if(i.stepId!==void 0){let o=n.steps.find(a=>a.id===i.stepId);o&&(o.config[i.field]=r)}else if(i.syncConfigId!==void 0){let o=s[i.syncConfigId];o&&(o[i.field]=r)}}}return{pipeline:{...n,variables:n.variables.map(i=>i.required&&i.defaultValue===void 0?{...i,required:!1}:i),version:1,triggers:[],createdAt:e.exportedAt,updatedAt:e.exportedAt},syncConfigs:Object.values(s)}}var pn="prebuilt-",un="tpl-";function Ve(e,t,n){let s=new Pe(e);for(let o of n.syncConfigs)s.save(o);let i=new Oe(e);for(let o of Object.values(t.seedTemplates))o.id.startsWith(pn)||i.save(L(o));let r=new ce(e);for(let o of Object.values(t.maskingTemplates))o.id.startsWith(un)||r.save(L(o))}var Ue="backup:";function Ke(e,t,n,s=()=>{}){let i=e.getKeysByPrefix(Ue).filter(o=>!n.has(o));if(i.length===0)return 0;let r=ye(on(t,"snapshots.json"));for(let o of i)r.set(o,cn(e.get(o),s),"backups");return i.length}function cn(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return e;let n=e;if(typeof n.orgId!="string")return e;let s=t(n.orgId);return s===void 0?e:{...n,orgId:s,organizationId:typeof n.organizationId=="string"?n.organizationId:n.orgId}}function We(e){return new Set(e.getKeysByPrefix(Ue))}var vn=`sandforge pipeline \u2014 run an Automation pipeline exported from VS Code, without the editor.
8
+
9
+ Usage:
10
+ npx sandforge pipeline plan --file <file> [options]
11
+ npx sandforge pipeline run --file <file> [options]
12
+ npx sandforge pipeline confirm --file <file> [--org <key>=<alias>]\u2026 [--store <dir>]
13
+ npx sandforge pipeline history --file <file> [--json]
14
+
15
+ Commands:
16
+ plan connect each org, type it, and say what a run would do and refuse; writes nothing
17
+ run run the pipeline as the Automation page runs it; with --dry-run, the steps that
18
+ write say what they would do, and the steps that read run
19
+ confirm confirm its Rewind steps at the terminal, as the page's confirmation does: the
20
+ alias of each Rewind step's org is typed, and the confirmation kept in the store
21
+ history the runs of the pipeline the command line made on this machine, newest first
22
+
23
+ The file is the one the Automation page's Export\u2026 writes (<name>.sandforge-pipeline.json).
24
+
25
+ Options (plan, run):
26
+ --file <file> the pipeline file
27
+ --org <key>=<alias> the sf alias an org of the file is reached by here, by its key in
28
+ the file's "orgs"; repeat for more (default: the alias the file names)
29
+ --accept-org <alias>=<id> take the org an alias reaches for the file's though its Organization
30
+ Id differs \u2014 a sandbox refreshed since \u2014 once you checked it is the
31
+ one: the org by its alias, or by its key in the file's "orgs", and
32
+ the Id it answers with; repeat for more
33
+ --var <name>=<value> a variable of the pipeline; repeat for more
34
+ --var-env <name>=<VAR> a variable read from an environment variable: a secret, which the
35
+ file never holds; repeat for more
36
+ --approve <step> answer the Approval step of that name ahead, yes, for a run with no
37
+ one at a terminal; repeat for more. Never one that stands before a
38
+ write to a sandbox marked Staging: a person answers it at a terminal
39
+ --confirm-rewind <alias> confirm the Rewind steps of the org of that alias, as typing it on
40
+ the page does; repeat for more
41
+ --store <dir> where the run keeps its state between runs: the Sync watermarks a
42
+ delta Sync reads on from, the Rewind confirmations, the audit
43
+ (default: the pipeline's folder under the folder
44
+ SANDFORGE_JOURNAL_DIR names, ~/.sandforge by default). A CI job
45
+ caches it between its runs
46
+ --json the plan, or the run, as JSON on stdout; every other line on stderr
47
+ --help this text
48
+
49
+ Options (run):
50
+ --dry-run the steps that write say what they would do: a Sync simulates, an
51
+ Anonymize previews, a Rewind previews, a Checkpoint estimates, a
52
+ Seed meets its gates \u2014 the data storage and the API requests its
53
+ org has left \u2014 and says what it would seed; Compare and Pre-check
54
+ run, and the Conditions read what they found; no Delay waits, no
55
+ Approval is asked; nothing is kept in the history, the audit or
56
+ the store
57
+ --timeout <ms> the run's time budget, sandforge.pipeline.timeout, from 30000 to
58
+ 3600000 (default: the file's, or 300000); an Approval's wait, a
59
+ Delay and the steps that write have their own
60
+ --triggered-by <how> manual | schedule: what the history says started it (default: manual)
61
+ --fail-on-partial exit 3 when the run ended with warnings: a step past which it went on
62
+
63
+ Nothing is written to any org by plan, nor by run --dry-run. A run takes the pipeline's lock
64
+ on this machine, which a run in VS Code takes too: one run of a pipeline at a time. Each org
65
+ is named by its sf CLI alias: the Salesforce CLI (sf) must be installed and logged in to it.
66
+
67
+ Exit codes:
68
+ 0 the plan refuses nothing; the run completed (with warnings, unless --fail-on-partial)
69
+ 1 the run failed, or could not start
70
+ 2 a bad command line, a file that does not read, or a run refused before its first step,
71
+ every cause said with what lifts it: nothing ran
72
+ 3 --fail-on-partial, and the run completed with warnings
73
+ 129, 130, 143 a SIGHUP, a Ctrl-C or a SIGTERM stopped it: the step under way is stopped, and
74
+ the run ends cancelled
75
+ `,Q=["plan","run","confirm","history"],$n={plan:{words:1,switches:["--json"],values:["--file","--org","--accept-org","--var","--var-env","--approve","--confirm-rewind","--store"]},run:{words:1,switches:["--json","--dry-run","--fail-on-partial"],values:["--file","--org","--accept-org","--var","--var-env","--approve","--confirm-rewind","--store","--timeout","--triggered-by"]},confirm:{words:1,switches:[],values:["--file","--org","--accept-org","--store"]},history:{words:1,switches:["--json"],values:["--file"]}},E=2,z=ie["pipeline.timeout"],Pn=2147483647,ee=6e4,H=5*6e4,I=class extends Error{};function G(e,t){let n=t.indexOf("=");if(n<=0||n===t.length-1)throw new I(`${e} takes <key>=<value>, got "${t}". Nothing was run.`);return[t.slice(0,n),t.slice(n+1)]}function Rn(e,t=process.env){let n=e.slice(2),s=n[0];if(s===void 0||s.startsWith("-"))throw new I(`Name the command: ${Q.join(", ")}. Nothing was run.`);if(!Q.includes(s))throw new I(`"${s}" is not a command of sandforge pipeline: ${Q.join(", ")}. Nothing was run.`);let i=$n[s],r=oe(n,i);if(r!==void 0)throw new I(r);let o=v=>{let m=[];for(let p=1;p<n.length;p++)n[p]===v&&p+1<n.length?m.push(n[++p]):i.values.includes(n[p])&&p++;return m},a=v=>{let m=o(v);if(m.length>1)throw new I(`${v} is given ${m.length} times. Nothing was run.`);return m[0]},d=a("--file");if(d===void 0)throw new I("--file names the pipeline file. Nothing was run.");let c=new Map;for(let v of o("--org")){let[m,p]=G("--org",v);if(!ae.test(p))throw new I(`--org ${m}=${p}: "${p}" is not an sf alias. Nothing was run.`);if(c.has(m))throw new I(`--org names ${m} twice. Nothing was run.`);c.set(m,p)}let u=new Map;for(let v of o("--accept-org")){let[m,p]=G("--accept-org",v);if(!/^00D[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?$/.test(p))throw new I(`--accept-org ${m}=${p}: "${p}" is no Organization Id (00D\u2026). Nothing was run.`);u.set(m,p)}let y=new Map;for(let v of o("--var")){let[m,p]=G("--var",v);if(y.has(m))throw new I(`${m} is given twice. Nothing was run.`);y.set(m,{value:p})}for(let v of o("--var-env")){let[m,p]=G("--var-env",v);if(y.has(m))throw new I(`${m} is given twice. Nothing was run.`);let k=t[p];y.set(m,{env:p,...k!==void 0&&k!==""?{value:k}:{}})}let w,h=a("--timeout");if(h!==void 0&&(w=Number(h),!Number.isInteger(w)||w<(z.minimum??0)||w>(z.maximum??1/0)))throw new I(`--timeout takes milliseconds from ${z.minimum} to ${z.maximum}, got "${h}". Nothing was run.`);let $=a("--triggered-by")??"manual";if($!=="manual"&&$!=="schedule")throw new I(`--triggered-by takes manual or schedule, got "${$}". Nothing was run.`);let P=a("--store");return{verb:s,file:d,orgs:c,accepted:u,vars:y,approve:o("--approve"),confirmRewind:o("--confirm-rewind"),...P!==void 0?{store:wn(P)}:{},json:n.includes("--json"),dryRun:n.includes("--dry-run"),...w!==void 0?{timeoutMs:w}:{},triggeredBy:$,failOnPartial:n.includes("--fail-on-partial")}}function Ye(){try{let e=JSON.parse(Xe(j(__dirname,"..","package.json"),"utf8"));return typeof e.version=="string"?e.version:"0.0.0"}catch{return"0.0.0"}}function Sn(e,t,n){return e.code==="PIPELINE_FILE_NEWER"&&e.exporterVersion!==void 0?[{code:e.code,message:e.message,wayOut:`npx -y sandforge@${e.exporterVersion} pipeline ${t} --file ${n}`}]:e.issues.length===0?[{code:e.code,message:e.message}]:[{code:e.code,message:e.message},...e.issues.map(s=>({code:e.code,message:`${s.path}: ${s.message}`}))]}function Qe(e,t){let n=[],s=[];for(let i of t.keys())Object.prototype.hasOwnProperty.call(e.orgs,i)||s.push({code:"ORG_UNKNOWN_KEY",org:i,message:`--org names "${i}", and the file has no org of that key.`,wayOut:`name one of ${Object.keys(e.orgs).join(", ")||"none"}.`});for(let[i,r]of Object.entries(e.orgs)){let o=t.get(i)??r.alias;if(o===void 0){s.push({code:"ORG_NO_ALIAS",org:i,message:`The org "${r.name??i}" (${r.organizationId}) has no alias in the file.`,wayOut:`give the sf alias it is reached by here: --org ${i}=<alias> (sf alias set <alias>=<username> names one).`});continue}n.push({key:i,alias:o,file:r})}return{orgs:n,refusals:s}}function On(e,t){let n={},s=[],i=new Map(e.pipeline.variables.map(r=>[r.name,r]));for(let[r,o]of t)i.has(r)?o.value!==void 0?n[r]=o.value:o.env!==void 0&&s.push({code:"VARIABLE_MISSING",message:`Variable "${r}" is to be read from ${o.env}, which is not set, or empty.`,wayOut:`set ${o.env} in the environment the run starts in.`}):s.push({code:"VARIABLE_UNKNOWN",message:`The pipeline declares no variable "${r}".`,wayOut:`name one of ${[...i.keys()].join(", ")||"none"}, or leave it out.`});for(let r of e.pipeline.variables)Object.prototype.hasOwnProperty.call(n,r.name)||t.has(r.name)||(r.defaultValue!==void 0?n[r.name]=r.defaultValue:r.required&&s.push({code:"VARIABLE_MISSING",message:`Variable "${r.name}" is required, and the file gives it no value${r.type==="secret"?": a secret never travels in it":""}.`,wayOut:r.type==="secret"?`--var-env ${r.name}=<environment variable that holds it>`:`--var ${r.name}=<value>, or --var-env ${r.name}=<environment variable>`}));return{values:n,refusals:s}}function In(e,t){return e.pipeline.steps.filter(n=>n.type===t).map(n=>n.name)}function Tn(e,t,n){let s=[],i=In(e,"approval");for(let o of t.approve)i.includes(o)||s.push({code:"APPROVE_UNKNOWN_STEP",message:`--approve "${o}" names no Approval step of the pipeline.`,wayOut:i.length>0?`name one of ${i.map(a=>`"${a}"`).join(", ")}.`:"leave it out: the pipeline has no Approval step."});let r=new Set(e.pipeline.steps.filter(o=>o.type==="rewind").map(o=>n.find(a=>a.key===o.config.orgId)?.alias).filter(o=>o!==void 0));for(let o of t.confirmRewind)r.has(o)||s.push({code:"CONFIRM_UNKNOWN_ORG",message:`--confirm-rewind ${o} names no org a Rewind step of the pipeline rewinds.`,wayOut:r.size>0?`name ${[...r].join(", ")}.`:"leave it out: the pipeline has no Rewind step."});return s}function bn(e,t){let n=e.pipeline.steps.find(s=>s.id===t);if(!n)return[];if(n.type==="sync"){let s=e.syncConfigs[String(n.config.configId??"")]?.targetOrgId;return typeof s=="string"?[s]:[]}if(["seed","anonymize","rewind","restore","delete"].includes(n.type)){let s=n.config.orgId;return typeof s=="string"?[s]:[]}return[]}function En(e,t,n,s){let i=[],r=new Set,o=d=>n.find(c=>c.key===d)?.kind,a=d=>n.find(c=>c.key===d)?.alias??d;for(let d of t.steps){let c=bn(e,d.stepId).find(y=>o(y)==="production");if(c!==void 0){let y=`Step "${d.name}" writes to ${a(c)}, a production org: a pipeline from the command line never writes to a production org, whatever an Approval answers.`;i.push({code:"PRODUCTION_TARGET",step:d.name,org:c,message:y,wayOut:`point the step at a sandbox, a scratch org or a Developer Edition org, and export again; or map ${c} to one with --org.`}),r.add(d.refusal??y);continue}let u=Nn(e,d,n,s.confirmLine);if(u!==void 0){i.push(u),r.add(d.refusal??u.message);continue}if(d.fate==="refused"&&d.refusal!==void 0){i.push({code:"STEP_REFUSED",step:d.name,message:d.refusal}),r.add(d.refusal);continue}d.type==="approval"&&i.push(...An(d,s))}for(let d of t.problems)r.has(d)||[...r].some(c=>d.includes(c))||i.push({code:"PIPELINE_REFUSED",message:d});return i}function Nn(e,t,n,s=`${N("pipeline")} confirm --file <file>`){if(t.type!=="rewind"||t.fate!=="refused"||t.refusal===void 0)return;let i=t.refusal===W(t.name,"changed");if(!i&&t.refusal!==W(t.name,"never"))return;let r=e.pipeline.steps.find(a=>a.id===t.stepId)?.config.orgId,o=n.find(a=>a.key===r)?.alias??"<alias>";return{code:"REWIND_NOT_CONFIRMED",step:t.name,message:`Rewind step "${t.name}" has `+(i?"not been confirmed since it was changed":"never been confirmed on this machine")+`: it rewinds ${o} only once ${o}'s alias is confirmed for it.`,wayOut:`run it with --confirm-rewind ${o}; or confirm it once, at a terminal, with ${s}, typing ${o}: the runs of that store then rewind it without the flag.`}}function xn(e){let t=[...e.orgs].map(([s,i])=>` --org ${s}=${i}`).join(""),n=[...e.accepted].map(([s,i])=>` --accept-org ${s}=${i}`).join("");return`${N("pipeline")} confirm --file ${e.file}${t}${n}`+(e.store!==void 0?` --store ${e.store}`:"")}function An(e,t){let n=`Approval step "${e.name}"`,s=t.approve.includes(e.name);return e.notes.includes("STAGING_NEEDS_PERSON")?s?[{code:"STAGING_NEEDS_PERSON",step:e.name,message:`${n} stands before a write to a sandbox marked Staging: only a person at a terminal answers it, never --approve.`,wayOut:`leave --approve "${e.name}" out and run it in a terminal; or take the Staging mark off the sandbox on the Organizations page, and export again.`}]:t.isTTY?[]:[{code:"STAGING_NEEDS_PERSON",step:e.name,message:`${n} stands before a write to a sandbox marked Staging, and this run has no terminal: only a person at a terminal answers it.`,wayOut:"run it in a terminal; or take the Staging mark off the sandbox on the Organizations page, and export again."}]:!s&&!t.isTTY?[{code:"APPROVAL_NO_TERMINAL",step:e.name,message:`${n} has no one to ask: this run has no terminal.`,wayOut:`run it in a terminal, or add --approve "${e.name}".`}]:[]}function Ze(e,t){return(n,s)=>{if(n==="pipeline.timeout"&&t!==void 0)return t;let i=e.settings;if(Object.prototype.hasOwnProperty.call(i,n))return i[n];let r=_e;return Object.prototype.hasOwnProperty.call(r,n)?r[n]:s}}function _n(e,t,n,s){let i=e.output??{};if(i.dryRun===!0)return;let r=a=>typeof a=="string"&&a!==""?a:void 0,o=r(i.orgId)!==void 0?t(String(i.orgId)):void 0;switch(e.stepType){case"seed":{let a=r(i.runId);return a===void 0||o===void 0||Number(i.totalRecordsCreated??0)===0?void 0:`${N("seed")} --remove ${a} --target ${o}`}case"sync":{let a=r(i.operationId),d=s(String(i.configId??""));return a===void 0||d===void 0||Number(i.totalSuccess??0)===0?void 0:`${N("sync")} --remove ${ue(a)} --target ${d} --store ${n}`}case"anonymize":{let a=i.snapshot??{},d=r(a.operationId);return d===void 0||o===void 0?void 0:`${N("dataops")} anonymize --org ${o} --restore ${d}`}case"rewind":{let a=r(i.checkpointId);return a===void 0||o===void 0||i.undoUntil===void 0?void 0:`${N("checkpoint")} undo --org ${o} --checkpoint ${a}`}case"checkpoint":{let a=r(i.checkpointId);return a===void 0||o===void 0?void 0:`${N("checkpoint")} delete --org ${o} --checkpoint ${a}`}default:return}}function Cn(e,t,n,s){let i=e.map(a=>_n(a,t,n,s)),r=a=>{let d=a.output?.orgId;return typeof d=="string"?t(d):void 0},o=(a,d)=>{let c=a.output?.objects;return new Set((Array.isArray(c)?c:[]).filter(u=>Number(u[d]??0)>0).map(u=>String(u.objectApiName)))};return i.map((a,d)=>{let c=e[d];if(a===void 0||c===void 0)return a;let u,y;if(c.stepType==="seed")u=r(c),y=o(c,"recordsCreated");else if(c.stepType==="sync")u=s(String(c.output?.configId??"")),y=o(c,"success");else return a;return e.some((h,$)=>$<=d||i[$]===void 0||r(h)!==u?!1:h.stepType==="rewind"?Number(h.output?.deleted??0)>0:h.stepType!=="anonymize"?!1:[...o(h,"processed")].some(P=>y.has(P)))?`${a} --include-changed`:a})}function Fn(e,t){return e.flatMap(n=>{if(n.stepType!=="anonymize"||n.output?.dryRun===!0)return[];let s=n.output?.snapshot??{},i=n.output?.orgId,r=typeof i=="string"?t(i):void 0;return typeof s.operationId!="string"||r===void 0?[]:[`The snapshot of "${n.stepName}" keeps the values it masked in clear on this machine: once they are back, or no longer wanted, ${N("backup")} --delete ${s.operationId} --org ${r} deletes it.`]})}function Dn(e,t,n){switch(e.status){case"completed":return 0;case"completed_with_warnings":return t?3:0;case"cancelled":return n!==void 0?K(n):1;default:return 1}}function jn(e,t=e.triggeredBy){return{runId:e.id,pipelineId:e.pipelineId,pipelineName:e.pipelineName,status:e.status,triggeredBy:t,startTime:e.startTime,duration:e.duration??0,stepCount:e.stepResults.filter(n=>n.status!=="skipped").length,errorCount:e.stepResults.filter(n=>n.status==="failed").length,steps:e.stepResults.map(n=>({stepName:n.stepName,stepType:n.stepType,status:n.status,...n.duration!==void 0?{duration:n.duration}:{},...n.summary!==void 0?{summary:n.summary}:{},...n.error!==void 0?{error:n.error}:{},...n.approval!==void 0?{approval:n.approval}:{}})),ranFrom:"commandLine"}}function Mn(e,t){return j(Y(e,t),"store")}function A(e){return e.message?.payload??{}}function F(e,t){if(e.outcome==="unanswered")return`${t} was not answered in time.`;let n=A(e);return`${t} failed: ${String(n.message??n.error??e.outcome)}`}var Ln=new Set(["ORG_NO_ALIAS","ORG_UNKNOWN_KEY","ORG_NOT_CONNECTED"]);async function en(e,t,n,s,i){let{host:r,orgRegistry:o,configStore:a}=e,d=[...i.refusals],c=[...i.notes],u=[];for(let p of i.orgs){let k;try{k=await r.connect(p.alias)}catch(g){d.push({code:"ORG_NOT_CONNECTED",org:p.key,message:`${p.alias} could not be reached: ${g instanceof Error?g.message:String(g)}`,wayOut:`"sf org display --target-org ${p.alias}" says what sf holds for it; sign in to it under that alias.`}),u.push(p);continue}let R=X(k),O=[p.key,p.alias].find(g=>n.accepted.has(g)),S=Ge(p.key,p.alias,p.file,{organizationId:k.orgId??k.id,kind:R},O!==void 0?n.accepted.get(O):void 0,O);S.ok?S.note!==void 0&&c.push(S.note):d.push({code:S.code,org:p.key,message:S.message,wayOut:S.wayOut});let D=Be(o,k,p.file,p.alias);D.note!==void 0&&c.push(D.note),u.push({...p,org:D.org,kind:R})}if(d.some(p=>Ln.has(p.code)))return c.push("The steps are checked once every org of the file is reached."),{file:t,digestMatches:!0,orgs:u,values:i.values,refusals:d,notes:c};let w=He(t,p=>u.find(k=>k.key===p)?.org?.id);Ve(a,t,w);let h=await r.request({type:"pipeline:save",payload:{id:w.pipeline.id,config:w.pipeline},timeoutMs:ee});if(h.outcome!=="answered")return d.push({code:"PIPELINE_REFUSED",message:F(h,"Saving the pipeline in the store")}),{file:t,digestMatches:!0,orgs:u,values:i.values,refusals:d,notes:c};for(let p of n.confirmRewind)for(let k of t.pipeline.steps){if(k.type!=="rewind"||u.find(S=>S.key===k.config.orgId)?.alias!==p)continue;let R=await r.request({type:"pipeline:rewind-grant",payload:{pipelineId:w.pipeline.id,stepId:k.id,typed:p},timeoutMs:H}),O=A(R);(R.outcome!=="answered"||O.granted!==!0)&&d.push({code:"REWIND_NOT_CONFIRMED",step:k.name,message:R.outcome!=="answered"?F(R,`The confirmation of Rewind step "${k.name}"`):`Rewind step "${k.name}" was not confirmed for ${p}: ${String(O.code??"refused")}${O.why?` (${String(O.why)})`:""}.`,wayOut:"take the checkpoint it names on this machine, or import it (sandforge checkpoint import)."})}let $=await r.request({type:"pipeline:export",payload:{pipelineId:w.pipeline.id},timeoutMs:H}),P=A($);if($.outcome!=="answered"||P.exported!==!0)return d.push({code:"PIPELINE_REFUSED",message:$.outcome!=="answered"?F($,"The check of the pipeline"):`The check of the pipeline did not run: ${P.exported===!1?P.message:""}`}),{file:t,digestMatches:!0,orgs:u,values:i.values,refusals:d,notes:c};let v=En(t,P,u,{approve:n.approve,isTTY:s.isTTY,confirmLine:xn(n)});d.push(...v);let m={...P,steps:P.steps.map(p=>{let k=v.find(R=>R.code==="REWIND_NOT_CONFIRMED"&&R.step===p.name);return k!==void 0?{...p,refusal:k.message}:p})};return{file:t,digestMatches:!0,orgs:u,values:i.values,check:m,refusals:d,notes:c}}function zn(e){let{file:t}=e,n=[`Pipeline "${t.pipeline.name}" (${t.pipeline.steps.length} ${t.pipeline.steps.length===1?"step":"steps"}), exported from ${t.exportedBy} on ${t.exportedAt.slice(0,10)}.`];e.digestMatches||n.push(" The file was edited since it was exported: its digest no longer matches what it holds.");let s=new Map((e.check?.orgs??[]).map(r=>[r.alias??"",r])),i=e.orgs.map(r=>{let o=r.kind??r.file.kind,a={sandbox:"sandbox",scratch:"scratch org",developer:"Developer Edition org",production:"production org"}[o],d=r.org?.orgId??r.file.organizationId,c=s.get(r.alias),u=c===void 0?"":c.writtenBy.length>0?` (written: ${c.writtenBy.join(", ")})`:" (read)";return`${r.alias} ${a}${r.org?.staging===!0?" marked Staging":""} ${d}${u}`});i.length>0&&n.push(`Orgs: ${i.join("; ")}`);for(let[r,o]of(e.check?.steps??[]).entries()){let a=o.fate==="refused"?"refused":o.fate==="asks"?"asks":"runs";n.push(` ${r+1} ${o.type} "${o.name}": ${a}`)}for(let r of e.notes)n.push(` ${r}`);if(e.refusals.length>0){n.push(`Refused before the first step, nothing run (exit ${E}):`);for(let r of e.refusals)n.push(` - ${r.message}${r.wayOut?` ${Z(r.wayOut)}`:""}`)}return n}function Z(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qe(e){return e.map(t=>({key:t.key,alias:t.alias,organizationId:t.org?.orgId??t.file.organizationId,kind:t.kind??t.file.kind,staging:t.org?.staging===!0}))}function Gn(e){let t=gn(j(yn(),"sandforge-pipeline-plan-")),n=j(e,"configStore.json");return Je(n)&&fn(n,j(t,"configStore.json")),t}function Bn(e,t,n,s){return async i=>e.includes(i.stepName)?{decision:"approve",via:"commandLine"}:t?{decision:await we(`Approval step "${i.stepName}"${i.pipelineName?` of pipeline "${i.pipelineName}"`:""}${i.message?`: ${i.message}`:""} \u2014 approve? (it waits until ${i.expiresAt})`,n,s)?"approve":"reject",via:"terminal"}:void 0}function Hn(e){let t;try{t=Xe(e,"utf8")}catch(n){return{ok:!1,refusal:{code:"PIPELINE_FILE_NOT_JSON",message:`${e} could not be read: ${n instanceof Error?n.message:String(n)}`,issues:[]}}}return re(t)}async function Vn(e=process.argv,t={}){let n=t.env??process.env;if(e.slice(2).includes("--help")||e.slice(2).includes("-h")){process.stdout.write(vn);return}let s;try{s=Rn(e,n)}catch(u){if(!(u instanceof I))throw u;process.stderr.write(`${u.message} Run with --help.
76
+ `),T(E);return}let i={line:u=>process[s.json?"stderr":"stdout"].write(`${u}
77
+ `),json:u=>{s.json&&process.stdout.write(`${JSON.stringify(u,null,2)}
78
+ `)}},r=t.pipelinesRoot??Ie(n),o=Hn(s.file);if(!o.ok){let u=Sn(o.refusal,s.verb,s.file);for(let y of u)process.stderr.write(`${y.message}${y.wayOut?` Run it with: ${y.wayOut}`:""}
79
+ `);i.json({tool:"sandforge-pipeline",refusals:u,exit:E}),T(E);return}let{file:a}=o;if(s.verb==="history"){Yn(a,r,i);return}let d=t.isTTY??process.stdin.isTTY===!0,c=s.store??Mn(r,a.pipeline.id);if(s.verb==="confirm"){await qn(a,s,c,{...t,isTTY:d,version:t.version??Ye()},i);return}await Un(a,o.digestMatches,s,c,r,{isTTY:d,terminal:t.terminal,version:t.version??Ye()},i)}async function Un(e,t,n,s,i,r,o){let a=n.verb==="run",d=Qe(e,n.orgs),c=On(e,n.vars),u=Tn(e,n,d.orgs),y={orgs:d.orgs,values:c.values,refusals:[...d.refusals,...c.refusals,...u],notes:[]},w,h=Y(i,e.pipeline.id),$=Je(h);if(a){let g=Te(i,e.pipeline.id,{pipelineName:e.pipeline.name,ranFrom:"commandLine",triggeredBy:n.triggeredBy,...n.dryRun?{dryRun:!0}:{}});if("busy"in g){let x={code:"PIPELINE_RUNNING",message:q(g.busy,e.pipeline.name)};process.stderr.write(`${x.message}
80
+ `),o.json({tool:"sandforge-pipeline",refusals:[x],exit:E}),T(E);return}w=g.lock,g.tookOver&&y.notes.push(Ee(g.tookOver))}else{let g=be(i,e.pipeline.id);g!==void 0&&y.notes.push(q(g,e.pipeline.name))}let P=new AbortController,v,m,p,k=de(g=>{v=g,P.abort(),o.line(`Stopping (${g}): the step under way is stopped, and the run ends cancelled.`),m!==void 0&&p!==void 0&&p.host.request({type:"execution:abort",payload:{operationId:m},timeoutMs:ee})}),R=a&&!n.dryRun?s:Gn(s),O=[],S=new Set,D=new Map(e.pipeline.steps.map((g,x)=>[g.id,x]));try{try{p=J({storeDir:R,log:l=>o.line(` ${l}`),setting:Ze(e,n.timeoutMs),notify:l=>o.line(` notification: ${l}`),sandforgeVersion:r.version,askApproval:Bn(n.approve,r.isTTY,r.terminal,P.signal),onPost:l=>{if(l.type!=="pipeline:step")return;let f=l.payload??{};f.status!=="running"&&f.stepId!==void 0&&S.add(f.stepId),Wn(l,e,D,o)}})}catch(l){process.stderr.write(`${l instanceof Error?l.message:String(l)}
81
+ `),T(1);return}let g=await en(p,e,n,r,y);if(g.digestMatches=t,v!==void 0){T(K(v));return}for(let l of zn(g))o.line(l);let x={id:e.pipeline.id,name:e.pipeline.name,file:n.file,digest:e.digest,digestMatches:t};if(g.refusals.length>0||!a){let l=g.refusals.length>0?E:0;o.json({tool:"sandforge-pipeline",pipeline:x,plan:!a,...a?{dryRun:n.dryRun}:{},orgs:qe(g.orgs),steps:(g.check?.steps??[]).map(f=>({name:f.name,type:f.type,fate:f.fate,...f.refusal!==void 0?{refusal:f.refusal}:{}})),refusals:g.refusals,notes:g.notes,exit:l}),T(l);return}w?.release(),w=void 0;let nn=We(p.configStore);m=`cli-${kn()}`,o.line(n.dryRun?"Dry run: the steps that write say what they would do.":"Run:");let M=await p.host.request({id:m,type:"pipeline:execute",responseType:"pipeline:run:response",payload:{pipeline:{...p.configStore.get(`pipeline:saved:${e.pipeline.id}`)??{}},variables:g.values,...n.dryRun?{dryRun:!0}:{}},timeoutMs:Pn});if(M.outcome!=="answered"){let l=A(M),f=l.code==="PIPELINE_RUNNING",_=F(M,"The run");process.stderr.write(`${_}
82
+ `),o.json({tool:"sandforge-pipeline",pipeline:x,dryRun:n.dryRun,refusals:[{code:String(l.code??"RUN_FAILED"),message:_}],exit:f?E:1}),T(f?E:1);return}let b=A(M),V=l=>g.orgs.find(f=>f.org?.id===l)?.alias,tn=l=>{let f=e.syncConfigs[l]?.targetOrgId;return g.orgs.find(_=>_.key===f)?.alias},rn=Cn(b.stepResults,V,s,tn);for(let[l,f]of b.stepResults.entries()){let _=rn[l];O.push({name:f.stepName,type:f.stepType,status:f.status,...f.summary!==void 0?{summary:f.summary}:{},...f.error!==void 0?{error:f.error}:{},...f.output!==void 0?{output:f.output}:{},..._!==void 0?{takeBack:_}:{}})}let U=Dn(b,n.failOnPartial,v);o.line(`${n.dryRun?"Dry run":"Run"} ${b.status}${b.error?`: ${b.error}`:""} (exit ${U}).`);for(let[l,f]of O.entries())S.has(b.stepResults[l]?.stepId??"")||o.line(` ${f.type} "${f.name}": ${f.status}${f.summary?` \u2014 ${f.summary}`:""}${f.error?` \u2014 ${f.error}`:""}`);let ne=O.filter(l=>l.takeBack!==void 0).reverse();if(ne.length>0){o.line("To take this run back, in this order:");for(let l of ne)o.line(` ${l.takeBack}`)}if(!n.dryRun){let l=Ke(p.configStore,p.backupDir,nn,V);l>0&&o.line(` ${l} snapshot${l===1?"":"s"} listed in ${p.backupDir}, where sandforge dataops restores from.`);for(let f of Fn(b.stepResults,V))o.line(` ${f}`);try{Ae(i,e.pipeline.id,jn(b,n.triggeredBy))}catch(f){o.line(` warning: the run was not kept in the history: ${f instanceof Error?f.message:String(f)}`)}}o.json({tool:"sandforge-pipeline",pipeline:x,dryRun:n.dryRun,status:b.status,startedAt:b.startTime,endedAt:b.endTime,triggeredBy:n.triggeredBy,orgs:qe(g.orgs),steps:O,approvals:b.stepResults.filter(l=>l.approval!==void 0).map(l=>({step:l.stepName,...l.approval})),notes:g.notes,exit:U}),T(U)}finally{k(),w?.release(),p?.dispose(),R!==s&&mn(R,{recursive:!0,force:!0}),n.dryRun&&!$&&Kn(h)}}function Kn(e){try{hn(e)}catch{}}function Wn(e,t,n,s){let i=e.payload??{},r=n.get(i.stepId??"");if(r===void 0)return;let o=t.pipeline.steps[r];if(o===void 0)return;let a=` ${r+1} ${o.type} "${o.name}"`;if(i.status==="running"){s.line(i.approval?`${a}: waits for its answer until ${i.approval.expiresAt??"?"}`:`${a}: running`);return}s.line(`${a}: ${i.status??"?"}${i.summary?` \u2014 ${i.summary}`:""}${i.error?` \u2014 ${i.error}`:""}`)}function Yn(e,t,n){let s=[],i=xe(t,r=>s.push(r)).read().filter(r=>r.pipelineId===e.pipeline.id);for(let r of s)process.stderr.write(`${r}
83
+ `);n.line(`Pipeline "${e.pipeline.name}": ${i.length} ${i.length===1?"run":"runs"} from the command line on this machine (${Ne(t,e.pipeline.id)}).`);for(let r of i)n.line(` ${r.startTime} ${r.status} ${r.triggeredBy} ${r.stepCount} ${r.stepCount===1?"step":"steps"}${r.errorCount>0?`, ${r.errorCount} failed`:""}`);n.json({tool:"sandforge-pipeline",pipeline:{id:e.pipeline.id,name:e.pipeline.name},runs:i})}async function qn(e,t,n,s,i){let r=e.pipeline.steps.filter(d=>d.type==="rewind");if(r.length===0){i.line(`Pipeline "${e.pipeline.name}" has no Rewind step: nothing to confirm.`);return}if(!s.isTTY){process.stderr.write(`confirm asks for each Rewind step's alias to be typed at a terminal: there is none. Give --confirm-rewind <alias> to run instead. Nothing was confirmed.
84
+ `),T(E);return}let o=Qe(e,t.orgs);if(o.refusals.length>0){for(let d of o.refusals)process.stderr.write(`${d.message} ${Z(d.wayOut??"")}
85
+ `);T(E);return}let a;try{a=J({storeDir:n,log:d=>i.line(` ${d}`),setting:Ze(e,void 0),notify:()=>{},sandforgeVersion:s.version})}catch(d){process.stderr.write(`${d instanceof Error?d.message:String(d)}
86
+ `),T(1);return}try{let d=new Set(r.map(h=>String(h.config.orgId??""))),c={orgs:o.orgs.filter(h=>d.has(h.key)),values:{},refusals:[],notes:[]},u=await en(a,e,{...t,approve:[],confirmRewind:[]},{isTTY:!0},c),y=u.refusals.filter(h=>["ORG_NOT_CONNECTED","ORG_MOVED"].includes(h.code));if(y.length>0){for(let h of y)process.stderr.write(`${h.message} ${Z(h.wayOut??"")}
87
+ `);T(E);return}let w=0;for(let h of r){let $=u.orgs.find(S=>S.key===h.config.orgId);if($?.org===void 0)continue;let P=String(h.config.checkpointId??"");i.line(`Rewind step "${h.name}" rewinds ${$.alias} to checkpoint ${P}.`);let v=await a.host.request({type:"checkpoint:preview",payload:{checkpointId:P},timeoutMs:H});if(v.outcome!=="answered"){i.line(` ${F(v,"Its preview")} It is not confirmed.`),w+=1;continue}let m=await a.host.request({type:"checkpoint:list",timeoutMs:ee}),p=(A(m).checkpoints??[]).find(S=>S.checkpointId===P)?.checkpoint;for(let S of De($.alias,{name:p?.name??P,takenAt:p?.takenAt??""},A(v),$.org.username))i.line(` ${S}`);let k=await ke(`Type ${$.alias} to confirm this step's rewind:`,s.terminal);if(k!==$.alias){i.line(" Not confirmed: what was typed is not the alias."),w+=1;continue}let R=await a.host.request({type:"pipeline:rewind-grant",payload:{pipelineId:e.pipeline.id,stepId:h.id,typed:k},timeoutMs:H}),O=A(R);R.outcome==="answered"&&O.granted===!0?i.line(` Confirmed, kept in ${n}: the runs of this store rewind it without --confirm-rewind.`):(i.line(` Not confirmed: ${R.outcome==="answered"?String(O.code):F(R,"The confirmation")}.`),w+=1)}T(w>0?1:0)}finally{a.dispose()}}process.argv[1]?.includes("sandforge-pipeline")&&($e(),Vn().then(()=>process.exit(process.exitCode??0)).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
88
+ `),process.exit(1)}));export{E as REFUSED_EXIT,Qe as aliasesOf,En as checkRefusals,xn as confirmLineOf,Mn as defaultStoreOf,Sn as fileRefusals,jn as historyEntryOf,Vn as main,Fn as maskedSnapshotLines,Tn as namedStepRefusals,Rn as parseArgs,zn as planLines,Dn as runExit,Ze as settingOf,_n as takeBackOf,Cn as takeBacksOf,Nn as unconfirmedRewind,On as variablesOf};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-VHI54FBK.mjs";import"./chunk-AAVJ5XVX.mjs";import"./chunk-WFEB5X4U.mjs";import"./chunk-AR7BE5O2.mjs";import"./chunk-3OHPD72J.mjs";import"./chunk-3RYLICRX.mjs";import"./chunk-PUOX4NBJ.mjs";import"./chunk-EQF2IJS2.mjs";import"./chunk-HTJ5OGP5.mjs";import"./chunk-QQZZMKU3.mjs";import"./chunk-PZTSVQSF.mjs";import"./chunk-W7KFAY55.mjs";import"./chunk-5HMAPZBV.mjs";import"./chunk-YPSRZRIT.mjs";import"./chunk-FOVVHGEP.mjs";import"./chunk-SVS6UMDU.mjs";import"./chunk-AUTM6H6Z.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-RAAANPPG.mjs";import"./chunk-ZE6HKRR4.mjs";import"./chunk-OQOZAPCI.mjs";import"./chunk-RSYICMZG.mjs";import"./chunk-IAZB4WIL.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-XEFDB2R4.mjs";import"./chunk-H45UXY6G.mjs";import"./chunk-WRU5FJFC.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-GNC27UEU.mjs";import"./chunk-YBU4Z4QV.mjs";import"./chunk-5P4PHJRL.mjs";import"./chunk-D3QRXG63.mjs";import"./chunk-NM4MDLK4.mjs";import"./chunk-BS5T3MOQ.mjs";import"./chunk-TEOLMRDO.mjs";import"./chunk-FQBRBBY4.mjs";import"./chunk-YS4G22C2.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-AV5SWEHP.mjs";import"./chunk-I7O6C2B5.mjs";import"./chunk-YMJVMFPY.mjs";import"./chunk-ALJVEUUS.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-36U7IQ6Y.mjs";import"./chunk-XETCPL7E.mjs";import"./chunk-K2FBZIXY.mjs";import"./chunk-Z7X534S4.mjs";import"./chunk-6QSM2WIH.mjs";import"./chunk-WJY54JO7.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-DBFJB2B6.mjs";import"./chunk-NEVXIGR6.mjs";import"./chunk-NTDN2JQZ.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-F74IHMGL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-Y5CGXLUB.mjs";import"./chunk-3F5YMM2F.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-SAR5622P.mjs";import"./chunk-L776PUMV.mjs";import"./chunk-6MUEPV7M.mjs";import"./chunk-HJC7AIBK.mjs";import"./chunk-OTWRDD6L.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-TYYOBZMU.mjs";import"./chunk-RH3N2H7P.mjs";import"./chunk-ZUTYVST5.mjs";import"./chunk-55HEMHEG.mjs";import"./chunk-P42X3B4D.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-VXHDBYMI.mjs";import"./chunk-ENLBYECD.mjs";import"./chunk-PA3MKJVH.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-ZLZRU6MO.mjs";import"./chunk-WIO4XO4F.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-GCOB7K5N.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-PNCONNFJ.mjs";import"./chunk-CGWXQX75.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-SIOZXPFG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-MTMH6H2A.mjs";import"./chunk-B45CNPUX.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-SBIMVCXT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as ENV_RUN_ID_RE,G as PREVIEW_UNREAD,l as accountKindOfRecordTypes,v as apiRequestsJson,p as describeDistribution,u as dryRunGatesJson,x as fitJson,c as fitOfArgs,y as main,d as parseArgs,C as parseRemoveArgs,m as personAccountLine,k as personRecordTypeNames,i as prebuiltTemplate,D as readRunSummary,f as readTemplateFile,o as recordTypeChoiceLine,n as recordTypeRule,A as refusalLines,H as removalPreviewJson,I as removalPreviewLines,F as removeMain,j as rulesFromDescribe,g as runIdRefusal,E as runOfSummary,z as scenarioKeptLines,t as seedAutomationCheck,w as seedFitLines,B as seedInterruptedLine,q as seedOrchestrator,r as seedWritePathOf,b as seededRandom,s as storageLine,e as templateDisplayName,h as templateRecordTypesRefusal};
7
+ import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-ZWZXQTAK.mjs";import"./chunk-WI4HYWV6.mjs";import"./chunk-WM5JI4JI.mjs";import"./chunk-56MPPWLA.mjs";import"./chunk-67CC7RAE.mjs";import"./chunk-OU5W7SCB.mjs";import"./chunk-T3PLRQ2T.mjs";import"./chunk-5WGA5CZB.mjs";import"./chunk-NWVVCZUK.mjs";import"./chunk-HYBH5PFM.mjs";import"./chunk-FSDO4DJA.mjs";import"./chunk-MHW6DV6T.mjs";import"./chunk-QXLZINZB.mjs";import"./chunk-OZNLOV4U.mjs";import"./chunk-2OZG6GRW.mjs";import"./chunk-MO3N5XVV.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-TPHXRHOA.mjs";import"./chunk-TKQQVB2D.mjs";import"./chunk-AELFEK3G.mjs";import"./chunk-K77NR3UK.mjs";import"./chunk-OVOLG3AL.mjs";import"./chunk-FQGHL7GR.mjs";import"./chunk-IM2XA6JI.mjs";import"./chunk-K55LH4ZQ.mjs";import"./chunk-5UT2ZBGF.mjs";import"./chunk-YHIOS2PU.mjs";import"./chunk-DHGPDSXS.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-742SSN7I.mjs";import"./chunk-YJEXE6HZ.mjs";import"./chunk-FTA5LOVX.mjs";import"./chunk-KNIRA333.mjs";import"./chunk-7DALDJMO.mjs";import"./chunk-O7DAFE6M.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-VSU74RQ3.mjs";import"./chunk-CAFUNR6D.mjs";import"./chunk-AITNZWLB.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-KGYXLSQ5.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-DMBR24CK.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-4L7FBOJS.mjs";import"./chunk-OXKZ4Y3B.mjs";import"./chunk-MAHZMPMZ.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-UIUPPEFB.mjs";import"./chunk-6SEDOIO3.mjs";import"./chunk-ZWCRWF7E.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-MNITSYI2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NJ3EOEHS.mjs";import"./chunk-ETT5GP4P.mjs";import"./chunk-SW2NUKQL.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-HVC5CYIB.mjs";import"./chunk-T26C576X.mjs";import"./chunk-BNO5GIJ6.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-SQGP46QS.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-6IGEASOF.mjs";import"./chunk-KOQV4WXC.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-CULAOP3U.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-KRNFVAGC.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-2OIRJEYE.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-XEB6HZ34.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZUA5BNAO.mjs";import"./chunk-RKALOKAU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-55LQD3Y3.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-EAFLDSQ2.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as ENV_RUN_ID_RE,G as PREVIEW_UNREAD,l as accountKindOfRecordTypes,v as apiRequestsJson,p as describeDistribution,u as dryRunGatesJson,x as fitJson,c as fitOfArgs,y as main,d as parseArgs,C as parseRemoveArgs,m as personAccountLine,k as personRecordTypeNames,i as prebuiltTemplate,D as readRunSummary,f as readTemplateFile,o as recordTypeChoiceLine,n as recordTypeRule,A as refusalLines,H as removalPreviewJson,I as removalPreviewLines,F as removeMain,j as rulesFromDescribe,g as runIdRefusal,E as runOfSummary,z as scenarioKeptLines,t as seedAutomationCheck,w as seedFitLines,B as seedInterruptedLine,q as seedOrchestrator,r as seedWritePathOf,b as seededRandom,s as storageLine,e as templateDisplayName,h as templateRecordTypesRefusal};
@@ -4,4 +4,4 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-SVS6UMDU.mjs";import"./chunk-AUTM6H6Z.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-RAAANPPG.mjs";import"./chunk-ZE6HKRR4.mjs";import"./chunk-XEFDB2R4.mjs";import"./chunk-H45UXY6G.mjs";import"./chunk-WRU5FJFC.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-GNC27UEU.mjs";import"./chunk-YBU4Z4QV.mjs";import"./chunk-5P4PHJRL.mjs";import"./chunk-D3QRXG63.mjs";import"./chunk-NM4MDLK4.mjs";import"./chunk-BS5T3MOQ.mjs";import"./chunk-TEOLMRDO.mjs";import"./chunk-FQBRBBY4.mjs";import"./chunk-YS4G22C2.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-QROPNEGY.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-AV5SWEHP.mjs";import"./chunk-I7O6C2B5.mjs";import"./chunk-YMJVMFPY.mjs";import"./chunk-ALJVEUUS.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-36U7IQ6Y.mjs";import"./chunk-XETCPL7E.mjs";import"./chunk-K2FBZIXY.mjs";import"./chunk-Z7X534S4.mjs";import"./chunk-6QSM2WIH.mjs";import"./chunk-WJY54JO7.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-DBFJB2B6.mjs";import"./chunk-NEVXIGR6.mjs";import"./chunk-NTDN2JQZ.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-F74IHMGL.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-Y5CGXLUB.mjs";import"./chunk-3F5YMM2F.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-SAR5622P.mjs";import"./chunk-L776PUMV.mjs";import"./chunk-6MUEPV7M.mjs";import"./chunk-HJC7AIBK.mjs";import"./chunk-OTWRDD6L.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-TYYOBZMU.mjs";import"./chunk-RH3N2H7P.mjs";import"./chunk-ZUTYVST5.mjs";import"./chunk-55HEMHEG.mjs";import"./chunk-P42X3B4D.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-VXHDBYMI.mjs";import"./chunk-ENLBYECD.mjs";import"./chunk-PA3MKJVH.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-ZLZRU6MO.mjs";import"./chunk-WIO4XO4F.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-GCOB7K5N.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-PNCONNFJ.mjs";import"./chunk-CGWXQX75.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-SIOZXPFG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-MTMH6H2A.mjs";import"./chunk-B45CNPUX.mjs";import"./chunk-7EANH5PY.mjs";import"./chunk-SBIMVCXT.mjs";import"./chunk-NTOVCTRS.mjs";var export_jsforce=a.default;export{B as LINE_RUN,p as alreadyLinkedWords,A as bothRecorders,c as buildConfig,h as buildQueryFn,g as cliAllowsDeletes,i as cliCountFn,f as cliFileDeps,j as cliPersonAccountsFn,k as cliSourceIdsFn,L as configurationToldLines,v as contactPointLines,y as deltaLine,u as encryptedLeftOutLine,l as inTheCommandsWords,N as jobLines,export_jsforce as jsforce,C as main,z as memoryCreations,s as objectCountsLine,w as objectCurrencyLines,r as objectErrorLines,x as objectPriceLines,t as objectWrittenLines,b as parseArgs,D as parseRemoveArgs,E as readRunSummary,d as readSavedConfig,o as recordTypeGivenOfObjectsLines,H as removalRefusal,I as removalSummaryLines,F as removalsPathOf,O as removeMain,J as restoredLines,M as runFileOf,G as runOfSummary,e as savedConfigStore,q as simulationLines,m as syncApiRequestsJson,K as undeletedLines,n as writeCheckLines};
7
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-MO3N5XVV.mjs";import"./chunk-INIQ23K6.mjs";import"./chunk-TPHXRHOA.mjs";import"./chunk-TKQQVB2D.mjs";import"./chunk-IM2XA6JI.mjs";import"./chunk-K55LH4ZQ.mjs";import"./chunk-5UT2ZBGF.mjs";import"./chunk-YHIOS2PU.mjs";import"./chunk-DHGPDSXS.mjs";import"./chunk-GMY5427L.mjs";import"./chunk-742SSN7I.mjs";import"./chunk-YJEXE6HZ.mjs";import"./chunk-FTA5LOVX.mjs";import"./chunk-KNIRA333.mjs";import"./chunk-7DALDJMO.mjs";import"./chunk-O7DAFE6M.mjs";import"./chunk-BZ24IAP5.mjs";import"./chunk-SCKUIE3R.mjs";import"./chunk-6FARZYMJ.mjs";import"./chunk-VSU74RQ3.mjs";import"./chunk-CAFUNR6D.mjs";import"./chunk-AITNZWLB.mjs";import"./chunk-CE6ZDGBB.mjs";import"./chunk-BOGNK4LV.mjs";import"./chunk-KGYXLSQ5.mjs";import"./chunk-TEIBWMJM.mjs";import"./chunk-DMBR24CK.mjs";import"./chunk-BWWQXU2B.mjs";import"./chunk-4L7FBOJS.mjs";import"./chunk-OXKZ4Y3B.mjs";import"./chunk-MAHZMPMZ.mjs";import"./chunk-M6P5ZZLE.mjs";import"./chunk-UIUPPEFB.mjs";import"./chunk-6SEDOIO3.mjs";import"./chunk-ZWCRWF7E.mjs";import"./chunk-T63U4OZJ.mjs";import"./chunk-YYZL7UGV.mjs";import"./chunk-54HYHHVL.mjs";import"./chunk-QIRO4HTE.mjs";import"./chunk-MNITSYI2.mjs";import"./chunk-QSRAEUGZ.mjs";import"./chunk-NJ3EOEHS.mjs";import"./chunk-ETT5GP4P.mjs";import"./chunk-SW2NUKQL.mjs";import"./chunk-4JKR4PTZ.mjs";import"./chunk-E2YJVSX6.mjs";import"./chunk-HVC5CYIB.mjs";import"./chunk-T26C576X.mjs";import"./chunk-BNO5GIJ6.mjs";import"./chunk-5LFSFYFJ.mjs";import"./chunk-4TLYUZD5.mjs";import"./chunk-SQGP46QS.mjs";import"./chunk-PPGDAUEQ.mjs";import"./chunk-MS4FJDFD.mjs";import"./chunk-6IGEASOF.mjs";import"./chunk-KOQV4WXC.mjs";import"./chunk-VV3B6IC3.mjs";import"./chunk-CULAOP3U.mjs";import"./chunk-INIT2UKJ.mjs";import"./chunk-HF6LAK3G.mjs";import"./chunk-KRNFVAGC.mjs";import"./chunk-SU65Z2BA.mjs";import"./chunk-2OIRJEYE.mjs";import"./chunk-LCDPCUXS.mjs";import"./chunk-XEB6HZ34.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-ICIYL45C.mjs";import"./chunk-ZUA5BNAO.mjs";import"./chunk-RKALOKAU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-TQ2TQHTT.mjs";import"./chunk-HFSBDM7B.mjs";import"./chunk-OHEOJISY.mjs";import"./chunk-EADHKH3A.mjs";import"./chunk-55LQD3Y3.mjs";import"./chunk-TZE3Y7IQ.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-EAFLDSQ2.mjs";import"./chunk-CA5NAXSU.mjs";import"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";var export_jsforce=a.default;export{D as LINE_RUN,r as alreadyLinkedWords,C as bothRecorders,c as buildConfig,h as buildQueryFn,g as cliAllowsDeletes,k as cliCountFn,f as cliFileDeps,l as cliPersonAccountsFn,m as cliSourceIdsFn,N as configurationToldLines,x as contactPointLines,A as deltaLine,w as encryptedLeftOutLine,n as inTheCommandsWords,P as jobLines,export_jsforce as jsforce,E as main,B as memoryCreations,u as objectCountsLine,y as objectCurrencyLines,t as objectErrorLines,z as objectPriceLines,v as objectWrittenLines,b as parseArgs,F as parseRemoveArgs,i as readCutLines,G as readRunSummary,d as readSavedConfig,q as recordTypeGivenOfObjectsLines,J as removalRefusal,K as removalSummaryLines,H as removalsPathOf,Q as removeMain,L as restoredLines,O as runFileOf,I as runOfSummary,e as savedConfigStore,s as simulationLines,j as statusWithReadCuts,o as syncApiRequestsJson,M as undeletedLines,p as writeCheckLines};
package/lib/sandforge.mjs CHANGED
@@ -4,9 +4,9 @@ import { dirname as __sandforgeDirname } from 'node:path';
4
4
  const require = __sandforgeRequire(import.meta.url);
5
5
  const __filename = __sandforgePath(import.meta.url);
6
6
  const __dirname = __sandforgeDirname(__filename);
7
- import"./chunk-NTOVCTRS.mjs";import{readFileSync as i}from"node:fs";import{extname as d,join as a}from"node:path";import{pathToFileURL as c}from"node:url";var r={autopilot:"run an Autopilot copy between two orgs",backup:"take and restore DataOps snapshots",checkpoint:"take a checkpoint of an org's data, and rewind the org to it",cleanup:"Bulk delete records you created on a sandbox in a time window",clone:"clone a record, or whole tables, from one org to a sandbox, or remove a run",compare:"compare two orgs the way the Compare page does",dataops:"mask an org's records, and put them back",empty:"empty objects of a sandbox, or the whole of it",env:"apply a sandforge.yaml to an org, and take it back",frozen:"build and replay a Frozen Dataset",mcp:"the MCP server: these scripts as tools for an AI agent, on stdio",monitor:"read an org the way the Monitor page does",seed:"fill an org from a seed template",sync:"run a Sync between two orgs"},s=o=>Object.prototype.hasOwnProperty.call(r,o);function p(o){let[e,...n]=o;if(e===void 0)return{kind:"refused",reason:"Name the command to run."};if(e==="--help"||e==="-h"||e==="help")return{kind:"help"};if(e==="--version"||e==="-v")return{kind:"version"};if(s(e))return{kind:"run",tool:e,args:n};let t=e.replace(/^sandforge-/,"");return t!==e&&s(t)?{kind:"refused",reason:`"${e}" is named ${t} here: sandforge ${t} \u2026.`}:{kind:"refused",reason:e.startsWith("-")?`"${e}" is not a flag sandforge reads: name a command first.`:`"${e}" is not a command of sandforge.`}}function l(){let o=Math.max(...Object.keys(r).map(n=>n.length));return`sandforge \u2014 SandForge's command lines, without the editor: Seed, Forge's clone, Sync,
8
- Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, sandforge.yaml environments, and
9
- the MCP server.
7
+ import{a as s}from"./chunk-SCKUIE3R.mjs";import"./chunk-NTOVCTRS.mjs";import{readFileSync as d}from"node:fs";import{extname as p,join as i}from"node:path";import{pathToFileURL as c}from"node:url";var r={autopilot:"run an Autopilot copy between two orgs",backup:"take and restore DataOps snapshots",checkpoint:"take a checkpoint of an org's data, and rewind the org to it",cleanup:"Bulk delete records you created on a sandbox in a time window",clone:"clone a record, or whole tables, from one org to a sandbox, or remove a run",compare:"compare two orgs the way the Compare page does",dataops:"mask an org's records, and put them back",empty:"empty objects of a sandbox, or the whole of it",env:"apply a sandforge.yaml to an org, and take it back",frozen:"build and replay a Frozen Dataset",mcp:"the MCP server: these scripts as tools for an AI agent, on stdio",monitor:"read an org the way the Monitor page does",pipeline:"plan and run an Automation pipeline exported from VS Code",seed:"fill an org from a seed template",sync:"run a Sync between two orgs"},a=o=>Object.prototype.hasOwnProperty.call(r,o);function m(o){let[e,...n]=o;if(e===void 0)return{kind:"refused",reason:"Name the command to run."};if(e==="--help"||e==="-h"||e==="help")return{kind:"help"};if(e==="--version"||e==="-v")return{kind:"version"};if(a(e))return{kind:"run",tool:e,args:n};let t=e.replace(/^sandforge-/,"");return t!==e&&a(t)?{kind:"refused",reason:`"${e}" is named ${t} here: ${s(t)} \u2026.`}:{kind:"refused",reason:e.startsWith("-")?`"${e}" is not a flag sandforge reads: name a command first.`:`"${e}" is not a command of sandforge.`}}function l(){let o=Math.max(...Object.keys(r).map(n=>n.length));return`sandforge \u2014 SandForge's command lines, without the editor: Seed, Forge's clone, Sync,
8
+ Checkpoints, DataOps, Frozen Dataset, the emptying of a sandbox, sandforge.yaml environments,
9
+ Automation pipelines, and the MCP server.
10
10
 
11
11
  Usage:
12
12
  sandforge <command> [options]
@@ -22,7 +22,7 @@ to it. In Claude Code:
22
22
 
23
23
  --version the version of SandForge these scripts belong to
24
24
  --help this text
25
- `}function m(o,e=__dirname,n=__filename){return a(e,`sandforge-${o}${d(n)}`)}function f(o=__dirname){let e=JSON.parse(i(a(o,"..","package.json"),"utf8"));return typeof e.version=="string"?e.version:"0.0.0"}var g=o=>import(c(o).href);async function h(o=process.argv,e=g){let n=p(o.slice(2));switch(n.kind){case"help":process.stdout.write(l());return;case"version":process.stdout.write(`${f()}
25
+ `}function f(o,e=__dirname,n=__filename){return i(e,`sandforge-${o}${p(n)}`)}function g(o=__dirname){let e=JSON.parse(d(i(o,"..","package.json"),"utf8"));return typeof e.version=="string"?e.version:"0.0.0"}var u=o=>import(c(o).href);async function h(o=process.argv,e=u){let n=m(o.slice(2));switch(n.kind){case"help":process.stdout.write(l());return;case"version":process.stdout.write(`${g()}
26
26
  `);return;case"refused":process.stderr.write(`${n.reason} Nothing was run. The commands: ${Object.keys(r).join(", ")}. Run with --help.
27
- `),process.exitCode=2;return;case"run":{let t=m(n.tool);process.argv=[o[0]??process.execPath,t,...n.args],await e(t);return}}}/(?:^|[\\/])sandforge\.[cm]?[jt]s$/.test(process.argv[1]??"")&&h().catch(o=>{process.stderr.write(`${o instanceof Error?o.message:String(o)}
28
- `),process.exit(1)});export{r as TOOLS,p as dispatchOf,l as helpText,h as main,m as toolFile,f as versionOf};
27
+ `),process.exitCode=2;return;case"run":{let t=f(n.tool);process.argv=[o[0]??process.execPath,t,...n.args],await e(t);return}}}/(?:^|[\\/])sandforge\.[cm]?[jt]s$/.test(process.argv[1]??"")&&h().catch(o=>{process.stderr.write(`${o instanceof Error?o.message:String(o)}
28
+ `),process.exit(1)});export{r as TOOLS,m as dispatchOf,l as helpText,h as main,f as toolFile,g as versionOf};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandforge",
3
- "version": "1.79.0",
3
+ "version": "1.81.0",
4
4
  "description": "SandForge's command lines, without the editor: seed, clone and sync Salesforce orgs, checkpoints and rewinds, masking, Frozen Datasets, sandforge.yaml environments, and an MCP server for AI agents.",
5
5
  "keywords": [
6
6
  "salesforce",
@@ -40,6 +40,7 @@
40
40
  "sandforge-frozen": "bin/sandforge-frozen.mjs",
41
41
  "sandforge-mcp": "bin/sandforge-mcp.mjs",
42
42
  "sandforge-monitor": "bin/sandforge-monitor.mjs",
43
+ "sandforge-pipeline": "bin/sandforge-pipeline.mjs",
43
44
  "sandforge-seed": "bin/sandforge-seed.mjs",
44
45
  "sandforge-sync": "bin/sandforge-sync.mjs"
45
46
  },
@@ -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,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-NEVXIGR6.mjs";import"./chunk-TYYOBZMU.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-SIOZXPFG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-B45CNPUX.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,C as CheckpointStoreError,c as DEFAULT_KEEP_DAYS,d as EXPIRY_WARNING_DAYS,G as OrgCheckpointStore,f as PREVIEW_KEEP_MS,e as RECYCLE_BIN_DAYS,J as acquireOrgLock,m as binFileOf,A as binReachSince,E 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,H as latestRewindOf,v as makePrivateDir,w as newFolderId,l as notInBinFileOf,F as openCheckpointStore,I as orgLockFileOf,K as orgLockHolder,i as organizationKey,t as previewDirOf,D as readFieldPrints,k as recreatedFileOf,u as rewindDirOf,B as scratchOrgExpired};