sandforge 1.80.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 (239) hide show
  1. package/bin/sandforge-pipeline.mjs +12 -0
  2. package/lib/{chunk-EMNC6YI4.mjs → chunk-2IB7I3IQ.mjs} +1 -1
  3. package/lib/{chunk-3RZQZHEB.mjs → chunk-2NAIUKVL.mjs} +1 -1
  4. package/lib/{chunk-AEKONPF4.mjs → chunk-2OIRJEYE.mjs} +1 -1
  5. package/lib/{chunk-BV6VTP3J.mjs → chunk-2OZG6GRW.mjs} +1 -1
  6. package/lib/{chunk-JEERQRLW.mjs → chunk-2Z54GB6X.mjs} +1 -1
  7. package/lib/chunk-2ZMGVBLW.mjs +7 -0
  8. package/lib/{chunk-FKG7Q3WH.mjs → chunk-33ZX3A56.mjs} +1 -1
  9. package/lib/{chunk-HLWMJF6Y.mjs → chunk-3AOKLIVE.mjs} +1 -1
  10. package/lib/{chunk-GGD7ON3M.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-BKDV4ENO.mjs → chunk-5UT2ZBGF.mjs} +1 -1
  22. package/lib/chunk-5VQNKDFU.mjs +7 -0
  23. package/lib/{chunk-XAMBCQPU.mjs → chunk-5WGA5CZB.mjs} +1 -1
  24. package/lib/chunk-5ZKCLBTN.mjs +474 -0
  25. package/lib/{chunk-UCD54V2M.mjs → chunk-67CC7RAE.mjs} +1 -1
  26. package/lib/{chunk-TSLJUSLW.mjs → chunk-6CDIIFNX.mjs} +1 -1
  27. package/lib/{chunk-AV5SWEHP.mjs → chunk-6FARZYMJ.mjs} +1 -1
  28. package/lib/{chunk-FPKYYFM7.mjs → chunk-6FMLW7PH.mjs} +1 -1
  29. package/lib/chunk-6IGEASOF.mjs +7 -0
  30. package/lib/{chunk-XUWL6ZPC.mjs → chunk-6NADW3OI.mjs} +1 -1
  31. package/lib/chunk-6SEDOIO3.mjs +10 -0
  32. package/lib/{chunk-PJ5I73CK.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-2UZPIMUC.mjs → chunk-AJPSGVMD.mjs} +1 -1
  38. package/lib/{chunk-GSKCGQIP.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-J525F5KI.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-OHWNPXWW.mjs → chunk-D7P7DTWL.mjs} +1 -1
  47. package/lib/{chunk-COFG7Q6R.mjs → chunk-DHGPDSXS.mjs} +1 -1
  48. package/lib/{chunk-WU3GLFZO.mjs → chunk-DHIW4IO5.mjs} +1 -1
  49. package/lib/{chunk-6XYKJSGX.mjs → chunk-DMBR24CK.mjs} +1 -1
  50. package/lib/chunk-DPYTG6DM.mjs +48 -0
  51. package/lib/{chunk-BY2HJFFG.mjs → chunk-DQR5NDMI.mjs} +1 -1
  52. package/lib/chunk-DXOXLUZA.mjs +7 -0
  53. package/lib/{chunk-YRQGKDHM.mjs → chunk-E2OBAWSH.mjs} +1 -1
  54. package/lib/chunk-E2YJVSX6.mjs +10 -0
  55. package/lib/{chunk-JWTSEDIQ.mjs → chunk-EAFLDSQ2.mjs} +1 -1
  56. package/lib/{chunk-MILU7WFN.mjs → chunk-EH5YUA5W.mjs} +1 -1
  57. package/lib/{chunk-BGUEWRK2.mjs → chunk-EOSEMFPU.mjs} +1 -1
  58. package/lib/chunk-ETT5GP4P.mjs +13 -0
  59. package/lib/{chunk-MYW5QNGI.mjs → chunk-FDGFUEK3.mjs} +1 -1
  60. package/lib/{chunk-NTFIRZP6.mjs → chunk-FLNLG43R.mjs} +1 -1
  61. package/lib/{chunk-CHYDMRSV.mjs → chunk-FSDO4DJA.mjs} +1 -1
  62. package/lib/{chunk-MJVTDA5Q.mjs → chunk-FSZTXLNW.mjs} +1 -1
  63. package/lib/{chunk-SOU4FRYN.mjs → chunk-FTA5LOVX.mjs} +1 -1
  64. package/lib/chunk-G4VXPS3A.mjs +7 -0
  65. package/lib/chunk-GF247DA7.mjs +7 -0
  66. package/lib/{chunk-BTWDMNN3.mjs → chunk-GK7VEYFM.mjs} +1 -1
  67. package/lib/{chunk-SE4QEZUG.mjs → chunk-GR3NGDVM.mjs} +1 -1
  68. package/lib/{chunk-3TJON4F3.mjs → chunk-GTIXJCGS.mjs} +1 -1
  69. package/lib/{chunk-NZC67CGR.mjs → chunk-GWRKS3AL.mjs} +1 -1
  70. package/lib/{chunk-XLXIPIEW.mjs → chunk-GYKNCYES.mjs} +1 -1
  71. package/lib/{chunk-WIO4XO4F.mjs → chunk-HFSBDM7B.mjs} +1 -1
  72. package/lib/{chunk-KDGMAGQR.mjs → chunk-HVC5CYIB.mjs} +1 -1
  73. package/lib/{chunk-WR4Q363I.mjs → chunk-HYBH5PFM.mjs} +1 -1
  74. package/lib/chunk-HYOOJVR6.mjs +7 -0
  75. package/lib/{chunk-5K5VLULK.mjs → chunk-IBURU7T7.mjs} +1 -1
  76. package/lib/chunk-ICIYL45C.mjs +7 -0
  77. package/lib/{chunk-QR3WELJQ.mjs → chunk-IKGHRYCN.mjs} +1 -1
  78. package/lib/chunk-IM2XA6JI.mjs +7 -0
  79. package/lib/{chunk-IWDREM66.mjs → chunk-J6G23RUI.mjs} +1 -1
  80. package/lib/{chunk-2BA2XKAY.mjs → chunk-JU2XEKEO.mjs} +1 -1
  81. package/lib/{chunk-MHMH6MTP.mjs → chunk-K55LH4ZQ.mjs} +1 -1
  82. package/lib/chunk-K5HV4YRO.mjs +7 -0
  83. package/lib/{chunk-M3ROUWDX.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-E5AHXLS6.mjs → chunk-KNIRA333.mjs} +1 -1
  87. package/lib/chunk-KOQV4WXC.mjs +8 -0
  88. package/lib/{chunk-L77FJZEP.mjs → chunk-KRNFVAGC.mjs} +1 -1
  89. package/lib/{chunk-MTMH6H2A.mjs → chunk-LCDPCUXS.mjs} +1 -1
  90. package/lib/{chunk-YAZO75G2.mjs → chunk-LNXBCE7E.mjs} +1 -1
  91. package/lib/{chunk-IZQZ6ZUF.mjs → chunk-LO527YLT.mjs} +1 -1
  92. package/lib/chunk-MAHZMPMZ.mjs +7 -0
  93. package/lib/{chunk-F6GUDTOB.mjs → chunk-MHW6DV6T.mjs} +1 -1
  94. package/lib/{chunk-2YIV2OB2.mjs → chunk-MIDBQ7SD.mjs} +1 -1
  95. package/lib/{chunk-FGRG7ANU.mjs → chunk-MKNAZPOT.mjs} +1 -1
  96. package/lib/{chunk-PZPJKATS.mjs → chunk-MNITSYI2.mjs} +8 -8
  97. package/lib/{chunk-OLSGVAIL.mjs → chunk-MO3N5XVV.mjs} +53 -53
  98. package/lib/chunk-MWLFFVQV.mjs +8 -0
  99. package/lib/chunk-N6HHNR6J.mjs +7 -0
  100. package/lib/chunk-N7J6NJQ6.mjs +7 -0
  101. package/lib/chunk-NJ3EOEHS.mjs +9 -0
  102. package/lib/chunk-NWPQF5XR.mjs +7 -0
  103. package/lib/{chunk-IG2MTQRP.mjs → chunk-NWVVCZUK.mjs} +1 -1
  104. package/lib/{chunk-2NBYT7GR.mjs → chunk-O6ADMP36.mjs} +1 -1
  105. package/lib/chunk-O7DAFE6M.mjs +14 -0
  106. package/lib/chunk-OEHVAJAB.mjs +7 -0
  107. package/lib/chunk-OETEC3P7.mjs +7 -0
  108. package/lib/{chunk-GCOB7K5N.mjs → chunk-OHEOJISY.mjs} +1 -1
  109. package/lib/chunk-OIIL4NVI.mjs +7 -0
  110. package/lib/chunk-OMZJ37JI.mjs +15 -0
  111. package/lib/{chunk-CEX3NEZL.mjs → chunk-ONMBSACW.mjs} +1 -1
  112. package/lib/chunk-OQQHNYR7.mjs +272 -0
  113. package/lib/{chunk-SOGQW4IG.mjs → chunk-OU5W7SCB.mjs} +1 -1
  114. package/lib/{chunk-O2HDYYUV.mjs → chunk-OVOLG3AL.mjs} +1 -1
  115. package/lib/{chunk-DYFALGRT.mjs → chunk-OXKZ4Y3B.mjs} +1 -1
  116. package/lib/{chunk-2GTBABKU.mjs → chunk-OZNLOV4U.mjs} +1 -1
  117. package/lib/{chunk-TYYOBZMU.mjs → chunk-PC247GKX.mjs} +1 -1
  118. package/lib/chunk-PPGDAUEQ.mjs +7 -0
  119. package/lib/{chunk-IGYH7GMA.mjs → chunk-PYUEHBA6.mjs} +1 -1
  120. package/lib/{chunk-TLH7AD35.mjs → chunk-PZBZ7MNC.mjs} +1 -1
  121. package/lib/{chunk-DBFJB2B6.mjs → chunk-QIRO4HTE.mjs} +1 -1
  122. package/lib/{chunk-BXU6WFMH.mjs → chunk-QXLZINZB.mjs} +1 -1
  123. package/lib/chunk-R2BJWO5N.mjs +20 -0
  124. package/lib/chunk-R6TF26V4.mjs +10 -0
  125. package/lib/{chunk-YKKRIEH4.mjs → chunk-RKALOKAU.mjs} +1 -1
  126. package/lib/chunk-SQGP46QS.mjs +7 -0
  127. package/lib/chunk-SW2NUKQL.mjs +9 -0
  128. package/lib/{chunk-MFG4MUIO.mjs → chunk-T26C576X.mjs} +1 -1
  129. package/lib/{chunk-LKQ5RKIV.mjs → chunk-T3PLRQ2T.mjs} +1 -1
  130. package/lib/chunk-T5VAULLQ.mjs +7 -0
  131. package/lib/{chunk-KYEDBS54.mjs → chunk-TEIBWMJM.mjs} +1 -1
  132. package/lib/chunk-TKQQVB2D.mjs +9 -0
  133. package/lib/{chunk-ELFXJHU7.mjs → chunk-TPHXRHOA.mjs} +1 -1
  134. package/lib/chunk-TQ2TQHTT.mjs +9 -0
  135. package/lib/{chunk-RPI7LRTW.mjs → chunk-TQM2XJ27.mjs} +1 -1
  136. package/lib/{chunk-IOIWJ3DJ.mjs → chunk-UCHAZ4ZU.mjs} +1 -1
  137. package/lib/{chunk-G35N4P7D.mjs → chunk-UIUPPEFB.mjs} +1 -1
  138. package/lib/{chunk-DBB3EMIN.mjs → chunk-UT27HXE7.mjs} +1 -1
  139. package/lib/{chunk-KBJ5VERV.mjs → chunk-UUSLTW5V.mjs} +1 -1
  140. package/lib/chunk-V2QO6KOE.mjs +19 -0
  141. package/lib/chunk-V473C7LY.mjs +7 -0
  142. package/lib/chunk-V4RKM4QZ.mjs +8 -0
  143. package/lib/chunk-VSU74RQ3.mjs +9 -0
  144. package/lib/chunk-VV3B6IC3.mjs +7 -0
  145. package/lib/chunk-W2AAGIZF.mjs +7 -0
  146. package/lib/{chunk-WR2GIKWE.mjs → chunk-WB2RIVO3.mjs} +1 -1
  147. package/lib/chunk-WD47PGUS.mjs +10 -0
  148. package/lib/{chunk-HEKAZJRH.mjs → chunk-WEZLXE34.mjs} +1 -1
  149. package/lib/{chunk-W622GUAW.mjs → chunk-WI4HYWV6.mjs} +1 -1
  150. package/lib/{chunk-WA7EYLAQ.mjs → chunk-WM5JI4JI.mjs} +1 -1
  151. package/lib/chunk-WWTXRWNZ.mjs +7 -0
  152. package/lib/{chunk-7EANH5PY.mjs → chunk-WZQEK4WT.mjs} +1 -1
  153. package/lib/{chunk-FXXLX4O6.mjs → chunk-X2ZVSQ54.mjs} +1 -1
  154. package/lib/{chunk-ZVAED4QV.mjs → chunk-XC2QKQT5.mjs} +1 -1
  155. package/lib/chunk-XC54KKKC.mjs +7 -0
  156. package/lib/chunk-XEB6HZ34.mjs +7 -0
  157. package/lib/chunk-XGKSSCW7.mjs +7 -0
  158. package/lib/chunk-XIZ5LMQM.mjs +7 -0
  159. package/lib/{chunk-74Q6DORA.mjs → chunk-Y5ZCPY36.mjs} +1 -1
  160. package/lib/{chunk-UNJA4J37.mjs → chunk-YCSFP6ER.mjs} +4 -4
  161. package/lib/{chunk-X5JYBPXP.mjs → chunk-YHIOS2PU.mjs} +1 -1
  162. package/lib/chunk-YIGFYZQY.mjs +7 -0
  163. package/lib/chunk-YJEXE6HZ.mjs +925 -0
  164. package/lib/{chunk-TTKXMDBN.mjs → chunk-YOGMP72T.mjs} +4 -4
  165. package/lib/chunk-ZRUDYB7O.mjs +7 -0
  166. package/lib/{chunk-CU2INBND.mjs → chunk-ZUA5BNAO.mjs} +1 -1
  167. package/lib/chunk-ZWCRWF7E.mjs +7 -0
  168. package/lib/{chunk-N652NMZ4.mjs → chunk-ZWZXQTAK.mjs} +52 -52
  169. package/lib/sandforge-autopilot.mjs +11 -11
  170. package/lib/sandforge-backup.mjs +63 -32
  171. package/lib/sandforge-checkpoint.mjs +1 -348
  172. package/lib/sandforge-cleanup.mjs +1 -1
  173. package/lib/sandforge-clone.mjs +1 -1
  174. package/lib/sandforge-compare.mjs +1 -1
  175. package/lib/sandforge-dataops.mjs +1 -1
  176. package/lib/sandforge-empty.mjs +11 -11
  177. package/lib/sandforge-env.mjs +104 -104
  178. package/lib/sandforge-frozen.mjs +1 -266
  179. package/lib/sandforge-mcp.mjs +33 -14
  180. package/lib/sandforge-monitor.mjs +1 -1
  181. package/lib/sandforge-pipeline.mjs +88 -0
  182. package/lib/sandforge-seed.mjs +1 -1
  183. package/lib/sandforge-sync.mjs +1 -1
  184. package/lib/sandforge.mjs +6 -6
  185. package/package.json +2 -1
  186. package/lib/chunk-2CNCDM56.mjs +0 -7
  187. package/lib/chunk-3F6Q5E7I.mjs +0 -14
  188. package/lib/chunk-4VS2V6WU.mjs +0 -25
  189. package/lib/chunk-5P4PHJRL.mjs +0 -9
  190. package/lib/chunk-5TC3QB4U.mjs +0 -10
  191. package/lib/chunk-7ABODJ4G.mjs +0 -7
  192. package/lib/chunk-7EGQP6S4.mjs +0 -7
  193. package/lib/chunk-7FFGJWHN.mjs +0 -7
  194. package/lib/chunk-7YDNUBO5.mjs +0 -7
  195. package/lib/chunk-A527W53V.mjs +0 -7
  196. package/lib/chunk-ADOAS63R.mjs +0 -7
  197. package/lib/chunk-B5QQJ4SI.mjs +0 -7
  198. package/lib/chunk-CION3VMZ.mjs +0 -7
  199. package/lib/chunk-CSBS5U5I.mjs +0 -7
  200. package/lib/chunk-DB7RBE5D.mjs +0 -7
  201. package/lib/chunk-E5ZB3LU5.mjs +0 -7
  202. package/lib/chunk-EFR2Y7E4.mjs +0 -7
  203. package/lib/chunk-EHQ3FX6X.mjs +0 -7
  204. package/lib/chunk-EQNW3UC2.mjs +0 -7
  205. package/lib/chunk-F43REJDZ.mjs +0 -10
  206. package/lib/chunk-GSG7WZHM.mjs +0 -7
  207. package/lib/chunk-HOJYWTP7.mjs +0 -20
  208. package/lib/chunk-HS4YRX4J.mjs +0 -7
  209. package/lib/chunk-I7O6C2B5.mjs +0 -8
  210. package/lib/chunk-IFETCRWE.mjs +0 -10
  211. package/lib/chunk-IQXHJEYB.mjs +0 -7
  212. package/lib/chunk-JPUR2CFX.mjs +0 -10
  213. package/lib/chunk-K327QKMD.mjs +0 -7
  214. package/lib/chunk-KRCA6IPH.mjs +0 -8
  215. package/lib/chunk-LPBMBW3O.mjs +0 -13
  216. package/lib/chunk-LWW4U276.mjs +0 -7
  217. package/lib/chunk-MJU2PGZQ.mjs +0 -15
  218. package/lib/chunk-OAZRPP4I.mjs +0 -7
  219. package/lib/chunk-OO6CLPEH.mjs +0 -7
  220. package/lib/chunk-OPXCV2KL.mjs +0 -7
  221. package/lib/chunk-P33PSCXK.mjs +0 -7
  222. package/lib/chunk-Q3DM32KF.mjs +0 -11
  223. package/lib/chunk-QROPNEGY.mjs +0 -14
  224. package/lib/chunk-QWT2C74M.mjs +0 -7
  225. package/lib/chunk-R3X3LV64.mjs +0 -14
  226. package/lib/chunk-RMBPOTD7.mjs +0 -7
  227. package/lib/chunk-SIHORWVK.mjs +0 -7
  228. package/lib/chunk-T62WNR54.mjs +0 -7
  229. package/lib/chunk-TTFDUKUS.mjs +0 -47
  230. package/lib/chunk-VE6XKGGD.mjs +0 -7
  231. package/lib/chunk-VGW4MXXZ.mjs +0 -7
  232. package/lib/chunk-VS7ZXUII.mjs +0 -824
  233. package/lib/chunk-VXQLDM4R.mjs +0 -7
  234. package/lib/chunk-VYXMVJL5.mjs +0 -7
  235. package/lib/chunk-W7U5E5ZL.mjs +0 -9
  236. package/lib/chunk-WXAQ7FK3.mjs +0 -115
  237. package/lib/chunk-YS4G22C2.mjs +0 -7
  238. package/lib/chunk-ZM6OJGIG.mjs +0 -7
  239. package/lib/chunk-ZUTYVST5.mjs +0 -7
@@ -0,0 +1,9 @@
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{b as D,d as L,f as G,g as _}from"./chunk-5C5XEVZN.mjs";import{d as T}from"./chunk-DXOXLUZA.mjs";import{H as $,d as F,k as u,z as j}from"./chunk-E2YJVSX6.mjs";import{Ra as k,Ua as P,cb as A}from"./chunk-DPYTG6DM.mjs";import{b as w,k as E,l as O,u as v,v as N,z as b}from"./chunk-WZQEK4WT.mjs";import{randomBytes as q}from"node:crypto";import{open as H,readFile as V,readdir as Q,rename as X,rm as tt,stat as et}from"node:fs/promises";import{homedir as rt}from"node:os";import{join as l,resolve as nt}from"node:path";import*as y from"node:fs";import*as S from"node:path";function Z(n){return`counting-contract.${D(n)}.json`}function C(n,t,e){return n.assertOutsideRepo(S.join(t,Z(e)))}function pt(n,t,e){let r=C(n,t,e.orgId);return y.mkdirSync(S.dirname(r),{recursive:!0}),y.writeFileSync(r,`${JSON.stringify(e,null,2)}
8
+ `,"utf8"),r}function gt(n,t){let e=n.assertOutsideRepo(t),r=JSON.parse(y.readFileSync(e,"utf8"));if(r.version!==1||typeof r.objects!="object"||r.objects===null)throw new Error(`Invalid counting contract at ${e}: version 1 with objects expected`);return r}function ut(n,t){if(n.loadStartedAt!==void 0)return n.loadStartedAt===t.startedAt;let e=Date.parse(n.writtenAt),r=Date.parse(t.endedAt);return Number.isFinite(e)&&Number.isFinite(r)&&e>=r}var it="replays",J="replay.json";function Pt(n=process.env){let t=n.SANDFORGE_JOURNAL_DIR,e=t!==void 0&&t.trim()!==""?nt(t):l(rt(),".sandforge");return l(e,it)}var x=b.datetime({offset:!0}),ot=O({organizationId:P,name:w().min(1).max(255),choices:A,firstAt:x,lastAt:x}),Y=O({version:N(1),checkpoint:O({checkpointId:k,name:w().min(1).max(255),organizationId:P,alias:w().min(1).max(255).optional(),tier:v(["sandbox","scratch","developer"]),takenAt:x}),targets:E(ot).max(1e4)}),M=/^00D[A-Za-z0-9]{15}$/,K=class{root;guard;now;writes=new Map;constructor(t){this.guard=t.guard??new L,this.root=this.guard.assertOutsideRepo(t.root),this.now=t.now??(()=>new Date)}folderOf(t,e){let r=u(t),i=k.safeParse(e);if(!i.success)throw new $("invalid","Not a checkpoint\u2019s id");return{dir:this.guard.assertOutsideRepo(l(this.root,r,i.data)),sourceOrganizationId:r,checkpointId:i.data}}async record(t,e,r){let i=this.folderOf(t.org.organizationId,t.checkpointId),o=u(e.organizationId),c=A.parse(r);await j(i.dir);let d=l(i.dir,J),a=async()=>{let h=this.now().toISOString(),I=await B(d),R=I?.targets.find(s=>s.organizationId===o),m={version:1,checkpoint:{checkpointId:i.checkpointId,name:t.name,organizationId:i.sourceOrganizationId,...t.org.alias!==void 0?{alias:t.org.alias}:{},tier:t.org.tier,takenAt:t.takenAt},targets:[...I?.targets.filter(s=>s.organizationId!==o)??[],{organizationId:o,name:e.name,choices:c,firstAt:R?.firstAt??h,lastAt:h}]};await st(d,`${JSON.stringify(Y.parse(m),null,2)}
9
+ `)},g=(this.writes.get(d)??Promise.resolve()).then(a,a),f=g.catch(()=>{});return this.writes.set(d,f),f.then(()=>{this.writes.get(d)===f&&this.writes.delete(d)}),await g,i}mappingStoreOf(t,e,r={}){return new _(t.dir,{guard:this.guard,orgId:u(e),...r})}contractPathOf(t,e){return C(this.guard,t.dir,u(e))}async read(t){return B(l(t.dir,J))}async list(t={}){let e=t.sourceOrganizationId!==void 0?u(t.sourceOrganizationId):void 0,r=t.targetOrganizationId!==void 0?u(t.targetOrganizationId):void 0,i=[];for(let o of await W(this.root))if(!(!M.test(o)||e!==void 0&&o!==e))for(let c of await W(l(this.root,o))){if(!k.safeParse(c).success||t.checkpointId!==void 0&&c!==t.checkpointId)continue;let d=this.folderOf(o,c);i.push(...await this.entriesOf(d,r))}return i.sort((o,c)=>z(c.replayedAt??"",o.replayedAt??"")||z(o.checkpointId,c.checkpointId)||z(o.target.organizationId,c.target.organizationId))}async replaysOf(t,e){return this.list({sourceOrganizationId:t,checkpointId:e})}async entriesOf(t,e){let r=await this.read(t),i=new Map(r?.targets.map(a=>[a.organizationId,a])),o=(await G(t.dir,this.guard)).filter(a=>M.test(a)),c=[...new Set([...i.keys(),...o])].filter(a=>e===void 0||a===e),d=[];for(let a of c){let g=i.get(a),f=await this.mappingStoreOf(t,a).recordedLoads(),h=new Map;for(let s of f)for(let{objectApiName:p,ids:U}of T(s))h.set(p,(h.get(p)??0)+U.length);let I=[...h].map(([s,p])=>({objectApiName:s,records:p})).sort((s,p)=>z(s.objectApiName,p.objectApiName)),R=I.reduce((s,p)=>s+p.records,0),m=f.find(s=>s.earlier!==!0);d.push({sourceOrganizationId:t.sourceOrganizationId,checkpointId:t.checkpointId,...r?{checkpointName:r.checkpoint.name}:{},...r?{takenAt:r.checkpoint.takenAt}:{},target:{organizationId:a,...g?{name:g.name}:{}},...g?{choices:g.choices}:{},...m?{replayedAt:m.endedAt}:{},inPlace:R,inPlaceByObject:I,...m!==void 0&&R===0&&m.removal!==void 0?{removed:!0}:{}})}return d}};function at(n){return n.filter(t=>t.inPlace>0)}function At(n){let t=at(n);if(t.length===0)return;let e=t.map(r=>`${r.inPlace.toLocaleString("en-US")} record${r.inPlace===1?"":"s"} in ${r.target.name??r.target.organizationId}`).join(", ");return`${t.length===1?"A replay":`${t.length} replays`} of it ${t.length===1?"is":"are"} still in place: ${e}. Deleting the checkpoint leaves them there, and each replay is still removed without it.`}async function B(n){let t;try{t=await V(n,"utf8")}catch(e){if(e.code==="ENOENT")return;throw e}try{let e=Y.safeParse(JSON.parse(t));return e.success?e.data:void 0}catch{return}}async function st(n,t){let e=`${n}.${process.pid}-${q(4).toString("hex")}.tmp`,r=await H(e,"wx",F);try{try{await r.writeFile(t,"utf8"),await r.sync()}finally{await r.close()}await X(e,n)}catch(i){throw await tt(e,{force:!0}),i}}async function W(n){let t;try{t=await Q(n)}catch(r){if(r.code==="ENOENT")return[];throw r}let e=[];for(let r of t)(await et(l(n,r)).catch(()=>{}))?.isDirectory()&&e.push(r);return e.sort()}function z(n,t){return n<t?-1:n>t?1:0}export{C as a,pt as b,gt as c,ut as d,J as e,Pt as f,K as g,at as h,At as i};
@@ -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{d as s}from"./chunk-AV5SWEHP.mjs";var i=["--accept-automation","--accept-emails","--mute-automation"];function n(t){return{...t.includes("--accept-automation")?{acceptAutomation:!0}:{},...t.includes("--accept-emails")?{acceptEmails:!0}:{},...t.includes("--mute-automation")?{muteAutomation:!0}:{}}}function r(t,e){let a=e?`exit 1; with ${e}, says what
7
+ import{d as s}from"./chunk-6FARZYMJ.mjs";var i=["--accept-automation","--accept-emails","--mute-automation"];function n(t){return{...t.includes("--accept-automation")?{acceptAutomation:!0}:{},...t.includes("--accept-emails")?{acceptEmails:!0}:{},...t.includes("--mute-automation")?{muteAutomation:!0}:{}}}function r(t,e){let a=e?`exit 1; with ${e}, says what
8
8
  would be muted and assigns nothing`:"exit 1";return` --accept-automation write although the org runs flows, Apex triggers,
9
9
  processes or workflow rules as the records are
10
10
  ${t}, or could not say what it runs:
@@ -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{f as m,h as u}from"./chunk-TZE3Y7IQ.mjs";import{b as $}from"./chunk-CA5NAXSU.mjs";import{d as l}from"./chunk-TTFDUKUS.mjs";async function q(n,a,o,t){if(!Number.isInteger(t)||t<1||t>l.maxExistingParents)throw new Error(`A relation reads between 1 and ${l.maxExistingParents} existing records, not ${t}.`);let c=o?.trim()?` WHERE ${m(o.trim())}`:"",i=`SELECT Id FROM ${u(a)}${c} LIMIT ${t}`,r=[],e=await n.query(i);for(;;){for(let s of e.records)typeof s.Id=="string"&&r.push(s.Id);if(e.done||!e.nextRecordsUrl||r.length>=t)break;e=await n.queryMore(e.nextRecordsUrl)}return r.slice(0,t)}var w=200,E=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function R(n){return n.slice(0,15)}async function N(n,a,o){let t=u(a);for(let i of o)if(!E.test(i))throw new Error(`Not a record id: "${i}".`);let c=[];for(let i=0;i<o.length;i+=w){let r=o.slice(i,i+w).map(s=>`'${s}'`).join(", "),e=await n.query(`SELECT Id FROM ${t} WHERE Id IN (${r})`);for(;;){for(let s of e.records)typeof s.Id=="string"&&c.push(s.Id);if(e.done||!e.nextRecordsUrl)break;e=await n.queryMore(e.nextRecordsUrl)}}return c}function y(n){let a=n.slice(0,5).join(", ");return n.length>5?`${a}, and ${n.length-5} more`:a}async function b(n,a){let o=[];for(let t of n??[]){if(t.parents.kind!=="records")continue;let{childObject:c,lookupField:i,parentObject:r}=t,e=t.parents.ids,s=`${c}.${i}`,d;try{d=await a.keyPrefixOf?.(r)}catch{d=void 0}let f=d?e.filter(g=>g.slice(0,3)!==d):[];if(f.length>0){o.push(`The relation on ${s} names ${f.length} id(s) that are not ${r} ids \u2014 the org's ${r} ids start with ${d}: ${y(f)}. Nothing was written. Give the ids of ${r} records.`);continue}if(!a.presentIds){o.push(`This run cannot check that the ${e.length} ${r} record(s) the relation on ${s} names are in the org. Nothing was written.`);continue}let p;try{p=await a.presentIds(r,e)}catch(g){o.push(`Reading the ${r} records the relation on ${s} names failed (${$(g)}). Nothing was written.`);continue}let I=new Set(p.map(R)),h=e.filter(g=>!I.has(R(g)));h.length>0&&o.push(`${h.length} of the ${e.length} ${r} record(s) the relation on ${s} names are no longer in the org: ${y(h)}. Nothing was written. Run again what created them, or give the ids of ${r} records the org holds.`)}return o}export{q as a,w as b,N as c,b as d};
7
+ import{f as m,h as u}from"./chunk-TZE3Y7IQ.mjs";import{b as $}from"./chunk-CA5NAXSU.mjs";import{e as l}from"./chunk-DPYTG6DM.mjs";async function q(n,a,o,t){if(!Number.isInteger(t)||t<1||t>l.maxExistingParents)throw new Error(`A relation reads between 1 and ${l.maxExistingParents} existing records, not ${t}.`);let c=o?.trim()?` WHERE ${m(o.trim())}`:"",i=`SELECT Id FROM ${u(a)}${c} LIMIT ${t}`,r=[],e=await n.query(i);for(;;){for(let s of e.records)typeof s.Id=="string"&&r.push(s.Id);if(e.done||!e.nextRecordsUrl||r.length>=t)break;e=await n.queryMore(e.nextRecordsUrl)}return r.slice(0,t)}var w=200,E=/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/;function R(n){return n.slice(0,15)}async function N(n,a,o){let t=u(a);for(let i of o)if(!E.test(i))throw new Error(`Not a record id: "${i}".`);let c=[];for(let i=0;i<o.length;i+=w){let r=o.slice(i,i+w).map(s=>`'${s}'`).join(", "),e=await n.query(`SELECT Id FROM ${t} WHERE Id IN (${r})`);for(;;){for(let s of e.records)typeof s.Id=="string"&&c.push(s.Id);if(e.done||!e.nextRecordsUrl)break;e=await n.queryMore(e.nextRecordsUrl)}}return c}function y(n){let a=n.slice(0,5).join(", ");return n.length>5?`${a}, and ${n.length-5} more`:a}async function b(n,a){let o=[];for(let t of n??[]){if(t.parents.kind!=="records")continue;let{childObject:c,lookupField:i,parentObject:r}=t,e=t.parents.ids,s=`${c}.${i}`,d;try{d=await a.keyPrefixOf?.(r)}catch{d=void 0}let f=d?e.filter(g=>g.slice(0,3)!==d):[];if(f.length>0){o.push(`The relation on ${s} names ${f.length} id(s) that are not ${r} ids \u2014 the org's ${r} ids start with ${d}: ${y(f)}. Nothing was written. Give the ids of ${r} records.`);continue}if(!a.presentIds){o.push(`This run cannot check that the ${e.length} ${r} record(s) the relation on ${s} names are in the org. Nothing was written.`);continue}let p;try{p=await a.presentIds(r,e)}catch(g){o.push(`Reading the ${r} records the relation on ${s} names failed (${$(g)}). Nothing was written.`);continue}let I=new Set(p.map(R)),h=e.filter(g=>!I.has(R(g)));h.length>0&&o.push(`${h.length} of the ${e.length} ${r} record(s) the relation on ${s} names are no longer in the org: ${y(h)}. Nothing was written. Run again what created them, or give the ids of ${r} records the org holds.`)}return o}export{q as a,w as b,N as c,b as d};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __sandforgeRequire } from 'node:module';
2
+ import { fileURLToPath as __sandforgePath } from 'node:url';
3
+ import { dirname as __sandforgeDirname } from 'node:path';
4
+ const require = __sandforgeRequire(import.meta.url);
5
+ const __filename = __sandforgePath(import.meta.url);
6
+ const __dirname = __sandforgeDirname(__filename);
7
+ import{A as y,B as z,C as A,D as B,E as C,F as D,G as E,H as F,I as G,J as H,K as I,L as J,M as K,N as L,O as M,P as N,Q as O,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-E2YJVSX6.mjs";import"./chunk-PC247GKX.mjs";import"./chunk-TUACWKIH.mjs";import"./chunk-3B5H24ZG.mjs";import"./chunk-UNDIBZWG.mjs";import"./chunk-DPYTG6DM.mjs";import"./chunk-WZQEK4WT.mjs";import"./chunk-NTOVCTRS.mjs";export{a as CHECKPOINT_DIR_MODE,b as CHECKPOINT_FILE_MODE,r as CHECKPOINT_FILE_PATH,F as CheckpointStoreError,c as DEFAULT_KEEP_DAYS,d as EXPIRY_WARNING_DAYS,K as OrgCheckpointStore,f as PREVIEW_KEEP_MS,e as RECYCLE_BIN_DAYS,q as REPLAY_ANNEX_PATH,N as acquireOrgLock,m as binFileOf,C as binReachSince,I as compressedFieldPrints,h as defaultCheckpointLocksDir,g as defaultCheckpointStoreRoot,z as expiresAtFor,B as expiresSoon,u as exportedFileIn,t as exportedFilesOf,n as filesDocumentsFileOf,o as filesLinksFileOf,j as indexFileOf,A as isExpired,s as isExportedPath,L as latestRewindOf,x as makePrivateDir,y as newFolderId,l as notInBinFileOf,J as openCheckpointStore,M as orgLockFileOf,O as orgLockHolder,i as organizationKey,v as previewDirOf,H as readFieldPrints,k as recreatedFileOf,p as replayAnnexFileOf,w as rewindDirOf,D as scratchOrgExpired,E as scratchOrgExpiresSoon,G as storeRefusalWords};
@@ -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{c as I}from"./chunk-UNDIBZWG.mjs";import{a as N,b as O}from"./chunk-CA5NAXSU.mjs";import{b as l,n as m}from"./chunk-7EANH5PY.mjs";var V="tooling",M={GenAiPlannerDefinition:["Id","DeveloperName","MasterLabel"],GenAiPlannerFunctionDef:["PlannerId","Plugin"],GenAiPluginDefinition:["Id","DeveloperName","LocalDeveloperName","MasterLabel","Description"],GenAiPluginFunctionDef:["PluginId","Function"],GenAiFunctionDefinition:["Id","DeveloperName","LocalDeveloperName","MasterLabel","Description"],GenAiPlannerAttrDefinition:["ParentId","DeveloperName","ParameterName"]},_="DeveloperName",y=200,j="This org has no Agentforce agent: the records this run wrote stay, usable as they are. Create an agent in Setup > Agentforce Agents, then write the test file from this run.",v="This org has no Agentforce, which takes a Salesforce license: it has no GenAiPlannerDefinition, the object that lists its agents. The records this run wrote stay, usable as they are.",g=l().nullish().transform(n=>n==null||n===""?void 0:n),z={GenAiPlannerDefinition:m({Id:l().min(1),DeveloperName:l().min(1),MasterLabel:g}),GenAiPlannerFunctionDef:m({PlannerId:l().min(1),Plugin:g}),GenAiPluginDefinition:m({Id:l().min(1),DeveloperName:l().min(1),LocalDeveloperName:g,MasterLabel:g,Description:g}),GenAiPluginFunctionDef:m({PluginId:l().min(1),Function:g}),GenAiFunctionDefinition:m({Id:l().min(1),DeveloperName:l().min(1),LocalDeveloperName:g,MasterLabel:g,Description:g}),GenAiPlannerAttrDefinition:m({ParentId:l().min(1),DeveloperName:l().min(1),ParameterName:g})},D=class extends Error{constructor(t,d,s){super(s);this.object=t;this.code=d;this.name="CatalogRefusal"}object;code};async function W(n){try{let e=await E(n,"GenAiPlannerDefinition");if(e.length===0)return{kind:"no-agent",reason:"none",message:j};let t=e.map(a=>a.Id),d=await A(n,"GenAiPlannerFunctionDef","PlannerId",t),s=await A(n,"GenAiPlannerAttrDefinition","ParentId",t),o=await A(n,"GenAiPluginDefinition","Id",d.map(a=>a.Plugin)),i=await A(n,"GenAiPluginFunctionDef","PluginId",o.map(a=>a.Id)),r=await A(n,"GenAiFunctionDefinition","Id",i.map(a=>a.Function)),f=G(o),L=G(r),T=a=>{let u=R(i.filter(p=>b(p.PluginId,a)).map(p=>p.Function),L);return{actions:u.items,unnamedActions:u.unnamed}};return{kind:"agents",catalog:{agents:e.map(a=>{let u=R(d.filter(c=>b(c.PlannerId,a.Id)).map(c=>c.Plugin),f),p=u.items.map((c,x)=>{let w=u.rows[x];return w?{...c,...T(w.Id)}:{...c,actions:[],unnamedActions:0}});return{id:a.Id,name:a.DeveloperName,...a.MasterLabel!==void 0?{label:a.MasterLabel}:{},topics:p,unnamedTopics:u.unnamed,variables:s.filter(c=>b(c.ParentId,a.Id)).map(c=>({name:c.DeveloperName,...c.ParameterName!==void 0?{parameterName:c.ParameterName}:{}}))}}).sort((a,u)=>C(a.name,u.name))}}}catch(e){if(!(e instanceof D))throw e;return e.object==="GenAiPlannerDefinition"&&e.code==="INVALID_TYPE"?{kind:"no-agent",reason:"no-agentforce",message:v}:{kind:"unreadable",object:e.object,message:`The org would not read ${e.object}: ${e.message}`}}}function H(n,e){return n.agents.find(t=>t.name===e)}function Z(n,e){return n.topics.find(t=>t.name===e)?.actions.map(t=>t.name)??[]}var h=["Off_Topic"];function B(n){return n.topics.find(e=>h.includes(e.name)||h.includes(e.localName??""))?.name}function U(n,e){return n.variables.some(t=>t.name===e||t.parameterName===e)}async function E(n,e,t){let d=`SELECT ${M[e].join(", ")} FROM ${e}${t?` WHERE ${t}`:""}`,s;try{s=await n(d)}catch(i){let r=O(i);throw new D(e,k(i)??N(r),r)}let o=z[e];return s.map(i=>{let r=o.safeParse(i);if(!r.success){let f=r.error.issues[0];throw new D(e,void 0,`a row has no ${f.path.join(".")} the catalog can read (${f.message})`)}return r.data})}async function A(n,e,t,d){let s=[...new Set(d.filter(i=>i!==void 0&&I(i)))],o=[];for(let i=0;i<s.length;i+=y){let r=s.slice(i,i+y).map(f=>`'${f}'`);o.push(...await E(n,e,`${t} IN (${r.join(", ")})`))}return o}function k(n){if(typeof n!="object"||n===null)return;let{errorCode:e,name:t}=n;if(typeof e=="string"&&e!=="")return e;if(typeof t=="string"&&/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(t))return t}function P(n){return n.slice(0,15)}function b(n,e){return P(n)===P(e)}function G(n){return new Map(n.map(e=>[P(e.Id),e]))}function R(n,e){let t=new Map,d=0;for(let o of n){if(o===void 0)continue;if(!I(o)){t.has(o)||t.set(o,{item:{name:o,described:!1}});continue}let i=e.get(P(o));if(!i){d++;continue}let r=i[_];t.has(r)||t.set(r,{row:i,item:{name:r,...i.LocalDeveloperName!==void 0?{localName:i.LocalDeveloperName}:{},...i.MasterLabel!==void 0?{label:i.MasterLabel}:{},...i.Description!==void 0?{description:i.Description}:{},described:!0}})}let s=[...t.values()].sort((o,i)=>C(o.item.name,i.item.name));return{items:s.map(o=>o.item),rows:s.map(o=>o.row),unnamed:d}}function C(n,e){return n<e?-1:n>e?1:0}export{V as a,M as b,_ as c,j as d,v as e,W as f,H as g,Z as h,h as i,B as j,U as k};
7
+ import{c as I}from"./chunk-UNDIBZWG.mjs";import{a as N,b as O}from"./chunk-CA5NAXSU.mjs";import{b as l,n as m}from"./chunk-WZQEK4WT.mjs";var V="tooling",M={GenAiPlannerDefinition:["Id","DeveloperName","MasterLabel"],GenAiPlannerFunctionDef:["PlannerId","Plugin"],GenAiPluginDefinition:["Id","DeveloperName","LocalDeveloperName","MasterLabel","Description"],GenAiPluginFunctionDef:["PluginId","Function"],GenAiFunctionDefinition:["Id","DeveloperName","LocalDeveloperName","MasterLabel","Description"],GenAiPlannerAttrDefinition:["ParentId","DeveloperName","ParameterName"]},_="DeveloperName",y=200,j="This org has no Agentforce agent: the records this run wrote stay, usable as they are. Create an agent in Setup > Agentforce Agents, then write the test file from this run.",v="This org has no Agentforce, which takes a Salesforce license: it has no GenAiPlannerDefinition, the object that lists its agents. The records this run wrote stay, usable as they are.",g=l().nullish().transform(n=>n==null||n===""?void 0:n),z={GenAiPlannerDefinition:m({Id:l().min(1),DeveloperName:l().min(1),MasterLabel:g}),GenAiPlannerFunctionDef:m({PlannerId:l().min(1),Plugin:g}),GenAiPluginDefinition:m({Id:l().min(1),DeveloperName:l().min(1),LocalDeveloperName:g,MasterLabel:g,Description:g}),GenAiPluginFunctionDef:m({PluginId:l().min(1),Function:g}),GenAiFunctionDefinition:m({Id:l().min(1),DeveloperName:l().min(1),LocalDeveloperName:g,MasterLabel:g,Description:g}),GenAiPlannerAttrDefinition:m({ParentId:l().min(1),DeveloperName:l().min(1),ParameterName:g})},D=class extends Error{constructor(t,d,s){super(s);this.object=t;this.code=d;this.name="CatalogRefusal"}object;code};async function W(n){try{let e=await E(n,"GenAiPlannerDefinition");if(e.length===0)return{kind:"no-agent",reason:"none",message:j};let t=e.map(a=>a.Id),d=await A(n,"GenAiPlannerFunctionDef","PlannerId",t),s=await A(n,"GenAiPlannerAttrDefinition","ParentId",t),o=await A(n,"GenAiPluginDefinition","Id",d.map(a=>a.Plugin)),i=await A(n,"GenAiPluginFunctionDef","PluginId",o.map(a=>a.Id)),r=await A(n,"GenAiFunctionDefinition","Id",i.map(a=>a.Function)),f=G(o),L=G(r),T=a=>{let u=R(i.filter(p=>b(p.PluginId,a)).map(p=>p.Function),L);return{actions:u.items,unnamedActions:u.unnamed}};return{kind:"agents",catalog:{agents:e.map(a=>{let u=R(d.filter(c=>b(c.PlannerId,a.Id)).map(c=>c.Plugin),f),p=u.items.map((c,x)=>{let w=u.rows[x];return w?{...c,...T(w.Id)}:{...c,actions:[],unnamedActions:0}});return{id:a.Id,name:a.DeveloperName,...a.MasterLabel!==void 0?{label:a.MasterLabel}:{},topics:p,unnamedTopics:u.unnamed,variables:s.filter(c=>b(c.ParentId,a.Id)).map(c=>({name:c.DeveloperName,...c.ParameterName!==void 0?{parameterName:c.ParameterName}:{}}))}}).sort((a,u)=>C(a.name,u.name))}}}catch(e){if(!(e instanceof D))throw e;return e.object==="GenAiPlannerDefinition"&&e.code==="INVALID_TYPE"?{kind:"no-agent",reason:"no-agentforce",message:v}:{kind:"unreadable",object:e.object,message:`The org would not read ${e.object}: ${e.message}`}}}function H(n,e){return n.agents.find(t=>t.name===e)}function Z(n,e){return n.topics.find(t=>t.name===e)?.actions.map(t=>t.name)??[]}var h=["Off_Topic"];function B(n){return n.topics.find(e=>h.includes(e.name)||h.includes(e.localName??""))?.name}function U(n,e){return n.variables.some(t=>t.name===e||t.parameterName===e)}async function E(n,e,t){let d=`SELECT ${M[e].join(", ")} FROM ${e}${t?` WHERE ${t}`:""}`,s;try{s=await n(d)}catch(i){let r=O(i);throw new D(e,k(i)??N(r),r)}let o=z[e];return s.map(i=>{let r=o.safeParse(i);if(!r.success){let f=r.error.issues[0];throw new D(e,void 0,`a row has no ${f.path.join(".")} the catalog can read (${f.message})`)}return r.data})}async function A(n,e,t,d){let s=[...new Set(d.filter(i=>i!==void 0&&I(i)))],o=[];for(let i=0;i<s.length;i+=y){let r=s.slice(i,i+y).map(f=>`'${f}'`);o.push(...await E(n,e,`${t} IN (${r.join(", ")})`))}return o}function k(n){if(typeof n!="object"||n===null)return;let{errorCode:e,name:t}=n;if(typeof e=="string"&&e!=="")return e;if(typeof t=="string"&&/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(t))return t}function P(n){return n.slice(0,15)}function b(n,e){return P(n)===P(e)}function G(n){return new Map(n.map(e=>[P(e.Id),e]))}function R(n,e){let t=new Map,d=0;for(let o of n){if(o===void 0)continue;if(!I(o)){t.has(o)||t.set(o,{item:{name:o,described:!1}});continue}let i=e.get(P(o));if(!i){d++;continue}let r=i[_];t.has(r)||t.set(r,{row:i,item:{name:r,...i.LocalDeveloperName!==void 0?{localName:i.LocalDeveloperName}:{},...i.MasterLabel!==void 0?{label:i.MasterLabel}:{},...i.Description!==void 0?{description:i.Description}:{},described:!0}})}let s=[...t.values()].sort((o,i)=>C(o.item.name,i.item.name));return{items:s.map(o=>o.item),rows:s.map(o=>o.row),unnamed:d}}function C(n,e){return n<e?-1:n>e?1:0}export{V as a,M as b,_ as c,j as d,v as e,W as f,H as g,Z as h,h as i,B as j,U as k};