stim 1.20.2 → 1.21.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 (217) hide show
  1. package/README.md +88 -8
  2. package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
  3. package/dist/act-DHAw2A2S.mjs +2667 -0
  4. package/dist/activity-BzVfHSrY.mjs +1376 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
  6. package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
  7. package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
  8. package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
  9. package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
  10. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
  11. package/dist/android-cas-compiler.mjs +2 -2
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/api.d.mts +740 -8
  14. package/dist/api.mjs +585 -1
  15. package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
  16. package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
  17. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
  18. package/dist/budget-Bs6SxxzO.mjs +9154 -0
  19. package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
  20. package/dist/build-cache-DmyR9Zzc.mjs +602 -0
  21. package/dist/build-plan-CaFskB7_.mjs +188 -0
  22. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
  25. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
  26. package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
  27. package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/client-B7QVOlCr.d.mts +253 -0
  30. package/dist/client-UXD70ZbM.mjs +1406 -0
  31. package/dist/collector-run.d.mts +4 -40
  32. package/dist/collector-run.mjs +9 -8
  33. package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
  34. package/dist/config-CYcBF478.mjs +949 -0
  35. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
  36. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
  37. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
  38. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
  39. package/dist/device-DCxH7_By.mjs +1068 -0
  40. package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
  41. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
  42. package/dist/device-host-worker.mjs +65 -61
  43. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
  44. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
  45. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
  46. package/dist/doctor-BLHCYxzi.mjs +2 -0
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
  49. package/dist/doctor-fingerprint.mjs +19 -0
  50. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
  51. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
  52. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
  53. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
  54. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
  55. package/dist/exec-H20xSg2T.d.mts +65 -0
  56. package/dist/exec-_UbtCQcG.mjs +750 -0
  57. package/dist/gc-C-WwL0yi.mjs +3 -0
  58. package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
  59. package/dist/git-C3iTsJaZ.mjs +73 -0
  60. package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
  61. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
  62. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
  63. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
  64. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
  65. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
  66. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
  67. package/dist/idle-BVeRGroT.d.mts +24 -0
  68. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
  69. package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
  70. package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
  71. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
  73. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
  74. package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
  75. package/dist/ios-signing-DTTIChGs.mjs +489 -0
  76. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
  77. package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
  78. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
  79. package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
  80. package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
  81. package/dist/logs-BS00Anxf.mjs +352 -0
  82. package/dist/logs-CMm05HxN.mjs +255 -0
  83. package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
  84. package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +122 -247
  87. package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
  88. package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
  89. package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
  90. package/dist/native-android-JACyjTZs.mjs +844 -0
  91. package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
  92. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  93. package/dist/native-run-DY_RLx3C.mjs +277 -0
  94. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
  95. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
  96. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
  97. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  98. package/dist/offload-worker.d.mts +1 -46
  99. package/dist/offload-worker.mjs +197 -66
  100. package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
  101. package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
  102. package/dist/paths-BsJMoPP2.mjs +12 -0
  103. package/dist/paths-DQtTgsBf.mjs +42 -0
  104. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
  105. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
  106. package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
  107. package/dist/prebuild-uD_ipCxF.mjs +449 -0
  108. package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
  109. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
  110. package/dist/pull-request-zjCSAryH.d.mts +120 -0
  111. package/dist/pull-requests.d.mts +1 -119
  112. package/dist/pull-requests.mjs +1 -1
  113. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
  114. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
  115. package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
  116. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
  117. package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
  118. package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
  119. package/dist/reload-DzjSl5P_.mjs +2 -0
  120. package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
  121. package/dist/result-DNiS-tTP.mjs +434 -0
  122. package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
  123. package/dist/selection-CSl9i5qU.mjs +619 -0
  124. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
  125. package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
  126. package/dist/server-expo-C-90EhcG.mjs +2 -0
  127. package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
  128. package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
  129. package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
  130. package/dist/settings-T1gtc3bf.mjs +114 -0
  131. package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
  132. package/dist/settings.schema.json +163 -16
  133. package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
  134. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
  135. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  136. package/dist/stage-BIS0ydsV.mjs +183 -0
  137. package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
  138. package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
  139. package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
  140. package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
  141. package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
  142. package/dist/stats-report-BFfMpWWF.mjs +16 -0
  143. package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
  144. package/dist/status-CSi6tlRq.mjs +2 -0
  145. package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
  146. package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
  147. package/dist/status-worker.d.mts +1 -0
  148. package/dist/status-worker.mjs +19 -0
  149. package/dist/stim-desktop-C12we7lz.mjs +112 -0
  150. package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
  151. package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
  152. package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
  153. package/dist/supervisor-run.d.mts +8 -17
  154. package/dist/supervisor-run.mjs +63 -27
  155. package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
  156. package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
  157. package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
  158. package/dist/toolchain-DhKwp9iI.mjs +2 -0
  159. package/dist/toolchain-Hp9sCpK4.mjs +873 -0
  160. package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
  161. package/dist/trigger-Bf3uDcpv.mjs +2 -0
  162. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
  163. package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
  164. package/dist/web-DknQETPs.mjs +2 -0
  165. package/dist/web-run.mjs +11 -12
  166. package/dist/windows-report.d.mts +1 -0
  167. package/dist/windows-report.mjs +18 -0
  168. package/dist/windows-report.ps1 +43 -0
  169. package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
  170. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
  171. package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
  172. package/dist/worktree-CK2MpJW5.mjs +2 -0
  173. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
  174. package/dist/xcode-Zlx3qjEs.mjs +896 -0
  175. package/package.json +7 -5
  176. package/shim/android-optimizations.gradle +7 -5
  177. package/dist/activity-BSV745Kz.mjs +0 -629
  178. package/dist/api-qvOzWyfO.mjs +0 -154
  179. package/dist/api-run.mjs +0 -294
  180. package/dist/app-install-BIKtMfPq.mjs +0 -896
  181. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  182. package/dist/budget-f7516Zk0.mjs +0 -4106
  183. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  184. package/dist/cancellation-C_22VQTH.mjs +0 -24
  185. package/dist/client-qQAaXSUs.mjs +0 -1771
  186. package/dist/config-BYDxlMY3.mjs +0 -562
  187. package/dist/device-DuiPJQSn.mjs +0 -290
  188. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  189. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  190. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  191. package/dist/exec-DqKo9GKJ.mjs +0 -268
  192. package/dist/git-DDfFzkMm.mjs +0 -45
  193. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  194. package/dist/logs-BGrEUaEs.mjs +0 -383
  195. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  196. package/dist/native-android-D5qc3-_v.mjs +0 -226
  197. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  198. package/dist/plan-C4TjdPsR.mjs +0 -260
  199. package/dist/prebuild-DYbucPXy.mjs +0 -212
  200. package/dist/preview-78a9kR_-.mjs +0 -1011
  201. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  202. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  203. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  204. package/dist/result-CaJg5Iat.mjs +0 -186
  205. package/dist/server-expo-Bigriskl.mjs +0 -2
  206. package/dist/settings-BORNaaCO.mjs +0 -402
  207. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  208. package/dist/stage-KNTQopqv.mjs +0 -157
  209. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  210. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  211. package/dist/toolchain-BFkAcstd.mjs +0 -2
  212. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  213. package/dist/trigger-9_USgmxz.mjs +0 -2
  214. package/dist/web-Dq-i3wzJ.mjs +0 -2
  215. package/dist/worktree-DpLdCHga.mjs +0 -2
  216. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  217. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,26 +1,32 @@
1
- import { O as writeConfigSetting } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { t as git } from "./git-DDfFzkMm.mjs";
4
- import { d as androidLayoutSetting, y as iosProjectDirSetting } from "./settings-B717odTD.mjs";
5
- import { D as fingerprintProject, M as refingerprintAfterMutation } from "./device-lease-BX1sJQ2E.mjs";
6
- import { w as workspaceLogsDir, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
1
+ import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
+ import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
+ import { k as writeConfigSetting } from "./config-CYcBF478.mjs";
7
4
  import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
8
- import { d as projectRegistry, h as selectNativeXcodeProject } from "./project-_phNIJfs.mjs";
9
- import { o as parseNdjsonText } from "./ndjson-GOnbyvso.mjs";
10
- import { n as CCACHE_UNAVAILABLE, o as resolveCcache } from "./ccache-zdKiYQ3E.mjs";
11
- import { i as assembleTaskFor } from "./gradle-DSrXb6lG.mjs";
12
- import { f as podsAreStale, g as runPodInstall, p as readPodState, u as workerToolchain } from "./toolchain-DxSsNssu.mjs";
13
- import { a as validateGradleManifest, d as verifyNativeTransfer, m as manifestDigest, n as gradleStateDirectories, o as verifyGradleTransfer, r as nativeGradleOutputs, t as gradleOffloadInputs } from "./native-gradle-inputs-BsLRrl7u.mjs";
14
- import { n as buildAndroid, o as gradlewPath, r as buildIos } from "./react-native-build-CtCccJtb.mjs";
15
- import { n as buildAndroidOperation, t as buildIosOperation } from "./build-DYDbfkk5.mjs";
16
- import { n as recordPrebuild, r as runPrebuild, t as planPrebuild } from "./prebuild-DYbucPXy.mjs";
17
- import { f as podAction } from "./support-CwjbFs9H.mjs";
18
- import { r as stageBundle, t as resolveBundleExtras } from "./stage-KNTQopqv.mjs";
19
- import { t as logLines } from "./run-BtPgpKks.mjs";
20
- import { r as nativeXcodeMetadataDirectories } from "./native-xcode-inputs-CykopJdM.mjs";
21
- import { chmodSync, constants, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
22
- import { basename, dirname, join } from "node:path";
5
+ import { d as androidLayoutSetting, y as iosProjectDirSetting } from "./settings-CsJDEXgK.mjs";
6
+ import { t as git } from "./git-C3iTsJaZ.mjs";
7
+ import { f as projectRegistry, g as selectNativeXcodeProject } from "./project-BZNjmW_8.mjs";
8
+ import { o as parseNdjsonText } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { Fn as processContext } from "./budget-Bs6SxxzO.mjs";
10
+ import { l as fingerprintProject, m as refingerprintAfterMutation } from "./build-cache-DmyR9Zzc.mjs";
11
+ import { n as CCACHE_UNAVAILABLE, o as resolveCcache } from "./ccache-BJRZ9pG3.mjs";
12
+ import { m as clearCorruptCompilationCache, p as COMPILATION_CACHE_CORRUPT } from "./client-UXD70ZbM.mjs";
13
+ import { _ as runPodInstall, d as workerToolchain, m as readPodState, p as podsAreStale } from "./toolchain-Hp9sCpK4.mjs";
14
+ import { r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
15
+ import { f as verifyNativeTransfer, i as nativeGradleOutputs, n as gradleStateDirectories, o as validateGradleManifest, s as verifyGradleTransfer, t as gradleOffloadInputs } from "./native-gradle-inputs-Bep9JcSF.mjs";
16
+ import { n as buildAndroid, o as gradlewPath, r as buildIos, u as assembleTaskFor } from "./react-native-build-rhk4smwQ.mjs";
17
+ import { f as podAction } from "./support-Dlu37g6H.mjs";
18
+ import { n as recordPrebuild, r as runPrebuild, t as planPrebuild } from "./prebuild-uD_ipCxF.mjs";
19
+ import { n as buildAndroidOperation, t as buildIosOperation } from "./build-CoPzQRNw.mjs";
20
+ import { r as stageBundle, t as resolveBundleExtras } from "./stage-BIS0ydsV.mjs";
21
+ import { t as logLines } from "./run-D23HmJMs.mjs";
22
+ import { r as nativeXcodeMetadataDirectories } from "./native-xcode-inputs-CB2iQeWq.mjs";
23
23
  import { createHash } from "node:crypto";
24
+ import { chmodSync, constants, copyFileSync, cpSync, createReadStream, createWriteStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
25
+ import { basename, dirname, join, sep } from "node:path";
26
+ import { withAmbientContext } from "@stim-cli/core";
27
+ import { isJsonObject, windowsShortDir, windowsShortDirKey } from "@stim-cli/core/state";
28
+ import { pipeline } from "node:stream/promises";
29
+ import { createGzip } from "node:zlib";
24
30
  //#region src/offload/worker.ts
25
31
  function emit(value) {
26
32
  process.stdout.write(`${JSON.stringify(value)}\n`);
@@ -90,13 +96,85 @@ function ensureParents(root, path) {
90
96
  mkdirSync(current);
91
97
  }
92
98
  }
93
- function materialize(job, src) {
99
+ const PRIVATE_DIRS = [
100
+ "$ErrorActionPreference = 'Stop'",
101
+ "$me = [Security.Principal.WindowsIdentity]::GetCurrent().User",
102
+ "$acl = New-Object Security.AccessControl.DirectorySecurity",
103
+ "$acl.SetAccessRuleProtection($true, $false)",
104
+ "foreach ($sid in @($me, (New-Object Security.Principal.SecurityIdentifier 'S-1-5-18'))) {",
105
+ " $acl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule($sid, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')))",
106
+ "}",
107
+ "foreach ($line in [Console]::In.ReadToEnd().Split([char]10) | ForEach-Object { $_.Trim() } | Where-Object { $_ }) {",
108
+ " $dir, $key = $line.Split([char]9)",
109
+ " [void][IO.Directory]::CreateDirectory($dir, $acl)",
110
+ " $current = Get-Acl -LiteralPath $dir",
111
+ " $owner = $current.GetOwner([Security.Principal.SecurityIdentifier]).Value",
112
+ " if ($owner -notin @($me.Value, 'S-1-5-32-544', 'S-1-5-18')) { [Console]::Error.WriteLine(\"$dir is owned by $owner\"); exit 3 }",
113
+ " $foreign = $current.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier]) | Where-Object { $_.IdentityReference.Value -notin @($me.Value, 'S-1-5-18') }",
114
+ " if (-not $current.AreAccessRulesProtected -or $foreign) { Set-Acl -LiteralPath $dir -AclObject $acl }",
115
+ " if ($key) {",
116
+ " $marker = \"$dir.owner\"",
117
+ " if (-not (Test-Path -LiteralPath $marker)) { Set-Content -NoNewline -LiteralPath $marker -Value $key }",
118
+ " elseif ((Get-Content -Raw -LiteralPath $marker) -ne $key) { [Console]::Error.WriteLine(\"$dir belongs to another build area\"); exit 4 }",
119
+ " }",
120
+ "}"
121
+ ].join("\n");
122
+ /**
123
+ * Creates each directory, in order, with access for this user and SYSTEM only, and gives an existing one that ACL.
124
+ * A directory at the drive root inherits the root's ACL, which lets every authenticated user modify it, so another
125
+ * account could plant code in a build; one that another account owns could hold such code, so it is refused. A
126
+ * directory with a key records it in `<dir>.owner` and is refused when another key is recorded there, since the
127
+ * short names of different areas can collide.
128
+ */
129
+ function makePrivateWindowsDirs(dirs) {
130
+ try {
131
+ getExecutor().runFile("powershell.exe", [
132
+ "-NoProfile",
133
+ "-NonInteractive",
134
+ "-Command",
135
+ PRIVATE_DIRS
136
+ ], {
137
+ input: dirs.map((entry) => entry.join(" ")).join("\n"),
138
+ timeoutMs: 6e4
139
+ });
140
+ } catch (error) {
141
+ const reason = (error instanceof Error ? error.message : String(error)).trim().split("\n").at(-1);
142
+ throw new Error(`Could not prepare the private Windows build directories: ${reason}`, { cause: error });
143
+ }
144
+ }
145
+ /**
146
+ * Creates the checkout directory `src` of `area`. On Windows it is a junction to a private `windowsShortDir`, and the
147
+ * client's Gradle home is made private too; an area whose `src` is a directory keeps it.
148
+ */
149
+ function ensureCheckout(area, src) {
150
+ const stat = lstatSync(src, { throwIfNoEntry: false });
151
+ if (process.platform === "win32") {
152
+ const linked = !stat || stat.isSymbolicLink();
153
+ const realArea = realpathSync(area);
154
+ const target = windowsShortDir(realArea);
155
+ const gradleHome = process.env.GRADLE_USER_HOME;
156
+ const dirs = [[dirname(target)]];
157
+ if (linked) dirs.push([target, windowsShortDirKey("checkout", realArea)]);
158
+ if (gradleHome) dirs.push([gradleHome, windowsShortDirKey("gradle", dirname(dirname(area)))]);
159
+ makePrivateWindowsDirs(dirs);
160
+ if (!linked) return;
161
+ let current = null;
162
+ try {
163
+ current = realpathSync(src);
164
+ } catch {}
165
+ if (current?.toLowerCase() === target.toLowerCase()) return;
166
+ if (stat) rmSync(src, { force: true });
167
+ symlinkSync(target, src, "junction");
168
+ return;
169
+ }
170
+ mkdirSync(src, { recursive: true });
171
+ }
172
+ async function materialize(job, src) {
94
173
  const recordFile = join(job.area, "mirror.json");
95
174
  let previous = {};
96
175
  try {
97
176
  previous = JSON.parse(readFileSync(recordFile, "utf8"));
98
177
  } catch {}
99
- mkdirSync(src, { recursive: true });
100
178
  if (!existsSync(join(src, ".git"))) {
101
179
  git(src, ["init", "--quiet"], {
102
180
  write: true,
@@ -126,7 +204,7 @@ function materialize(job, src) {
126
204
  } catch {}
127
205
  const allowed = [...declaration.outputs, ...gradleStateDirectories(job.project)];
128
206
  if (receipt.project === job.project && Array.isArray(receipt.directories)) retained = allowed.filter((path) => receipt.directories.includes(path));
129
- retained = nativeGradleOutputs(src, {
207
+ retained = await nativeGradleOutputs(src, {
130
208
  complete: true,
131
209
  ignored: [],
132
210
  outputs: retained
@@ -318,6 +396,49 @@ function destination(runtime) {
318
396
  return null;
319
397
  }
320
398
  }
399
+ /**
400
+ * Writes `name` under `dir` to `archive` as a gzip tarball at compression level 1. Node does the gzip because tar's
401
+ * compression-level flags differ between bsdtar (macOS, Windows) and GNU tar (Linux).
402
+ */
403
+ async function packArchive(archive, dir, name) {
404
+ const child = getExecutor().spawn("tar", [
405
+ "-cf",
406
+ "-",
407
+ "-C",
408
+ dir,
409
+ name
410
+ ], { stdio: [
411
+ "ignore",
412
+ "pipe",
413
+ "pipe"
414
+ ] });
415
+ const tarball = child.stdout;
416
+ if (!tarball) throw new Error("tar opened no output stream.");
417
+ const stderr = [];
418
+ child.stderr?.on("data", (chunk) => stderr.push(String(chunk)));
419
+ let spawnError = null;
420
+ const exited = new Promise((resolve) => {
421
+ child.once("error", (error) => {
422
+ spawnError = error;
423
+ resolve(null);
424
+ });
425
+ child.once("close", resolve);
426
+ });
427
+ const timeout = new AbortController();
428
+ const timer = setTimeout(() => timeout.abort(), 6e5);
429
+ try {
430
+ await pipeline(tarball, createGzip({ level: 1 }), createWriteStream(archive), { signal: timeout.signal });
431
+ } catch (error) {
432
+ child.kill("SIGKILL");
433
+ await exited;
434
+ throw timeout.signal.aborted ? /* @__PURE__ */ new Error("Packing the artifact did not finish within 10 minutes.") : error;
435
+ } finally {
436
+ clearTimeout(timer);
437
+ }
438
+ const code = await exited;
439
+ if (spawnError) throw spawnError;
440
+ if (code !== 0) throw new Error(`tar exited with ${code}: ${stderr.join("").trim().slice(-500)}`);
441
+ }
321
442
  async function sha256Of(path) {
322
443
  const hash = createHash("sha256");
323
444
  for await (const chunk of createReadStream(path)) hash.update(chunk);
@@ -347,13 +468,14 @@ async function build(job) {
347
468
  message,
348
469
  timings
349
470
  });
350
- const src = join(job.area, "src");
471
+ ensureCheckout(job.area, join(job.area, "src"));
472
+ const src = realpathSync(join(job.area, "src"));
351
473
  const root = join(src, job.project);
352
474
  const log = relayWriter(join(job.area, "build.ndjson"));
353
475
  const mirrored = await time("syncMs", () => materialize(job, src));
354
476
  const realSrc = realpathSync(src);
355
477
  const realRoot = realpathSync(root);
356
- if (realRoot !== realSrc && !realRoot.startsWith(`${realSrc}/`)) return failed("bad-project", `${job.project} leaves the checkout.`);
478
+ if (realRoot !== realSrc && !realRoot.startsWith(`${realSrc}${sep}`)) return failed("bad-project", `${job.project} leaves the checkout.`);
357
479
  note("sync", `${job.manifest.length} files, ${mirrored.written} written, ${mirrored.removed} removed`);
358
480
  let fingerprint;
359
481
  let compiled;
@@ -361,13 +483,13 @@ async function build(job) {
361
483
  if (job.platform !== "android" || job.expectedFingerprint !== null) return failed("unsupported-provider", "Native Gradle needs an Android request with no reusable artifact identity.");
362
484
  const selected = projectRegistry.selectAndroid(root);
363
485
  if ("problem" in selected || selected.id !== "native-android") return failed("provider-mismatch", "The transferred project did not select the native Android integration.");
364
- if (!verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) return failed("source-mismatch", "The materialized native inputs do not match the source transfer.");
486
+ if (!await verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) return failed("source-mismatch", "The materialized native inputs do not match the source transfer.");
365
487
  compiled = await compileNativeAndroid(job, root, log, time);
366
488
  if (!compiled.ok) return failed(compiled.code, compiled.message);
367
489
  try {
368
490
  const model = JSON.parse(readFileSync(join(workspaceDir(root), "gradle-build", `native-apk-${encodeURIComponent(job.android?.variant ?? "debug")}.json`), "utf8"));
369
- const outputs = nativeGradleOutputs(src, job.native.inputs, model.buildDirectories);
370
- if (!verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) throw new Error("The native source changed while the worker compiled it.");
491
+ const outputs = await nativeGradleOutputs(src, job.native.inputs, model.buildDirectories);
492
+ if (!await verifyGradleTransfer(src, job.project, job.native.inputs, job.manifest, job.native.sourceDigest)) throw new Error("The native source changed while the worker compiled it.");
371
493
  const directories = [...outputs, ...gradleStateDirectories(job.project).filter((path) => lstatSync(join(src, path), { throwIfNoEntry: false })?.isDirectory())];
372
494
  const receipt = join(job.area, "gradle-outputs.json");
373
495
  const tmp = `${receipt}.${process.pid}.tmp`;
@@ -391,7 +513,7 @@ async function build(job) {
391
513
  let metadataDirectories;
392
514
  try {
393
515
  metadataDirectories = nativeXcodeMetadataDirectories(selectNativeXcodeProject(root, job.scheme ?? void 0, job.configuration ?? void 0));
394
- if (!verifyNativeTransfer(src, job.manifest, job.native.sourceDigest, metadataDirectories)) return failed("source-mismatch", "The materialized native inputs do not match the source transfer.");
516
+ if (!await verifyNativeTransfer(src, job.manifest, job.native.sourceDigest, metadataDirectories)) return failed("source-mismatch", "The materialized native inputs do not match the source transfer.");
395
517
  } catch (error) {
396
518
  return failed("source-mismatch", error.message);
397
519
  }
@@ -401,7 +523,7 @@ async function build(job) {
401
523
  compiled = await compileNativeIos(job, root, log, time);
402
524
  if (!compiled.ok) return failed(compiled.code, compiled.message);
403
525
  try {
404
- if (!verifyNativeTransfer(src, job.manifest, job.native.sourceDigest, metadataDirectories)) throw new Error("The native source changed while the worker compiled it.");
526
+ if (!await verifyNativeTransfer(src, job.manifest, job.native.sourceDigest, metadataDirectories)) throw new Error("The native source changed while the worker compiled it.");
405
527
  } catch (error) {
406
528
  if (compiled.temporary) rmSync(compiled.temporary, {
407
529
  recursive: true,
@@ -413,7 +535,7 @@ async function build(job) {
413
535
  } else if (job.platform === "macos") {
414
536
  fingerprint = await time("fingerprintMs", () => manifestDigest(job.manifest));
415
537
  if (fingerprint !== job.expectedFingerprint) return failed("fingerprint-mismatch", `the manifest there fingerprints ${fingerprint.slice(0, 12)}, here ${job.expectedFingerprint?.slice(0, 12)}`);
416
- compiled = await compileMacos(job, root, log, time);
538
+ compiled = await workerOperation(root, (context) => compileMacos(context, job, root, log, time));
417
539
  if (!compiled.ok) return failed(compiled.code, compiled.message);
418
540
  } else {
419
541
  try {
@@ -424,7 +546,7 @@ async function build(job) {
424
546
  const platform = job.platform;
425
547
  let iosProject;
426
548
  try {
427
- iosProject = iosProjectDirSetting({ ios: { projectPath: job.iosProjectPath ?? void 0 } }, root);
549
+ iosProject = iosProjectDirSetting({ ios: { projectPath: job.iosProjectPath ?? void 0 } }, realRoot);
428
550
  } catch (error) {
429
551
  return failed("bad-request", error.message);
430
552
  }
@@ -433,17 +555,17 @@ async function build(job) {
433
555
  androidLayout = androidLayoutSetting({ android: {
434
556
  gradleRoot: job.android?.gradleRoot ?? void 0,
435
557
  module: job.android?.module ?? void 0
436
- } }, root, realSrc);
558
+ } }, realRoot, realSrc);
437
559
  } catch (error) {
438
560
  return failed("bad-request", error.message);
439
561
  }
440
- const initial = await time("fingerprintMs", () => fingerprintProject(root, {
562
+ const initial = await time("fingerprintMs", () => fingerprintProject(realRoot, {
441
563
  platform,
442
564
  iosProjectPath: iosProject.relative,
443
565
  androidLayout
444
566
  }));
445
- if (!initial) return failed("no-fingerprint", "The remote Mac could not fingerprint the project.");
446
- const plan = planPrebuild(root, platform, {
567
+ if (!initial) return failed("no-fingerprint", "The remote machine could not fingerprint the project.");
568
+ const plan = planPrebuild(realRoot, platform, {
447
569
  isExpo: job.isExpo,
448
570
  fingerprint: initial.hash,
449
571
  sources: initial.sources
@@ -452,17 +574,17 @@ async function build(job) {
452
574
  const mutations = [];
453
575
  if (plan === "generate" || plan === "regenerate") {
454
576
  note("prebuild", plan === "generate" ? `generating ${platform}/` : `regenerating ${platform}/ with --clean`);
455
- recordPrebuild(root, platform, null);
456
- const result = await time("prebuildMs", () => runPrebuild(root, platform, log, { clean: plan === "regenerate" }));
577
+ recordPrebuild(realRoot, platform, null);
578
+ const result = await time("prebuildMs", () => runPrebuild(realRoot, platform, log, { clean: plan === "regenerate" }));
457
579
  if (result?.failed) return failed("prebuild-failed", result.reason ?? "expo prebuild failed.");
458
580
  mutations.push("prebuild");
459
581
  }
460
582
  if (platform === "ios") {
461
- const podState = readPodState(root, iosProject.dir);
583
+ const podState = readPodState(realRoot, iosProject.dir);
462
584
  const pods = podAction(podState, podsAreStale(podState.lockText, podState.manifestText, podState.dir));
463
585
  if (pods.install) {
464
586
  note("pods", `${pods.reason ?? "Pods are stale"} -> pod install`);
465
- const result = await time("podsMs", () => runPodInstall(root, log, {
587
+ const result = await time("podsMs", () => runPodInstall(realRoot, log, {
466
588
  directory: iosProject.dir,
467
589
  onHeartbeat: (line) => note("pods", line)
468
590
  }));
@@ -473,7 +595,7 @@ async function build(job) {
473
595
  fingerprint = initial.hash;
474
596
  if (mutations.length) {
475
597
  const after = await time("fingerprintMs", () => refingerprintAfterMutation({
476
- projectRoot: root,
598
+ projectRoot: realRoot,
477
599
  platform,
478
600
  previousHash: initial.hash,
479
601
  iosProjectPath: iosProject.relative,
@@ -481,14 +603,14 @@ async function build(job) {
481
603
  }));
482
604
  if (!after) return failed("no-fingerprint", `No fingerprint after ${mutations.join(", ")}.`);
483
605
  fingerprint = after.hash;
484
- if (mutations.includes("prebuild")) recordPrebuild(root, platform, after.hash);
606
+ if (mutations.includes("prebuild")) recordPrebuild(realRoot, platform, after.hash);
485
607
  }
486
608
  if (fingerprint !== job.expectedFingerprint) return failed("fingerprint-mismatch", `the checkout there fingerprints ${fingerprint.slice(0, 12)}, here ${job.expectedFingerprint?.slice(0, 12)}`);
487
- compiled = platform === "android" ? await compileAndroid(job, root, log, time, androidLayout) : await compileIos(job, root, log, time);
609
+ compiled = platform === "android" ? await compileAndroid(job, realRoot, log, time, androidLayout) : await compileIos(job, realRoot, log, time);
488
610
  if (!compiled.ok) return failed(compiled.code, compiled.message);
489
611
  const builtFingerprint = fingerprint;
490
612
  const settled = await time("fingerprintMs", () => refingerprintAfterMutation({
491
- projectRoot: root,
613
+ projectRoot: realRoot,
492
614
  platform,
493
615
  previousHash: builtFingerprint,
494
616
  iosProjectPath: iosProject.relative,
@@ -510,15 +632,7 @@ async function build(job) {
510
632
  verbatimSymlinks: true,
511
633
  mode: constants.COPYFILE_FICLONE
512
634
  });
513
- await time("packageMs", () => getExecutor().runFileAsync("tar", [
514
- "-czf",
515
- archive,
516
- "--options",
517
- "gzip:compression-level=1",
518
- "-C",
519
- dirname(compiled.path),
520
- name
521
- ], { timeoutMs: 6e5 }));
635
+ await time("packageMs", () => packArchive(archive, dirname(compiled.path), name));
522
636
  const sha256 = await time("packageMs", () => sha256Of(archive));
523
637
  return {
524
638
  ok: true,
@@ -541,12 +655,9 @@ async function build(job) {
541
655
  });
542
656
  }
543
657
  }
544
- function isRecord(value) {
545
- return typeof value === "object" && value !== null && !Array.isArray(value);
546
- }
547
658
  function differingParameters(here, there, path) {
548
659
  if (JSON.stringify(here) === JSON.stringify(there)) return [];
549
- if (!isRecord(here) || !isRecord(there)) return [path];
660
+ if (!isJsonObject(here) || !isJsonObject(there)) return [path];
550
661
  return [.../* @__PURE__ */ new Set([...Object.keys(here), ...Object.keys(there)])].toSorted().flatMap((key) => differingParameters(here[key], there[key], `${path}.${key}`));
551
662
  }
552
663
  function unused() {
@@ -593,6 +704,10 @@ async function nativeIdentityRefusal(job, native, root, load) {
593
704
  return `This Mac cannot key the native build: ${error.message}`;
594
705
  }
595
706
  }
707
+ function workerOperation(root, fn) {
708
+ const context = processContext(root, new AbortController().signal);
709
+ return withAmbientContext(context, () => fn(context));
710
+ }
596
711
  async function compileNativeIos(job, root, log, time) {
597
712
  if (job.native?.provider !== "xcode" || !job.optimizations) return {
598
713
  ok: false,
@@ -612,15 +727,15 @@ async function compileNativeIos(job, root, log, time) {
612
727
  }, `optimizations.ios.${key}`, value ?? void 0);
613
728
  }
614
729
  note("build", `native Xcode ${job.configuration ?? "Debug"}`);
615
- const logFile = join(workspaceLogsDir(root), "build-ios.ndjson");
730
+ const logFile = join(workspaceLogsDir$1(root), "build-ios.ndjson");
616
731
  try {
617
732
  rmSync(logFile, { force: true });
618
- const built = await time("buildMs", () => buildIosOperation(root, {
733
+ const built = await time("buildMs", () => workerOperation(root, (context) => buildIosOperation(context, root, {
619
734
  scheme: job.scheme ?? void 0,
620
735
  configuration: job.configuration ?? void 0,
621
736
  arch: native.arch ?? "all",
622
737
  remoteBuild: "local"
623
- }));
738
+ })));
624
739
  if (built.cacheKey !== native.cacheKey || built.cacheSkipped) {
625
740
  rmSync(dirname(built.appPath), {
626
741
  recursive: true,
@@ -639,6 +754,14 @@ async function compileNativeIos(job, root, log, time) {
639
754
  temporary: dirname(built.appPath)
640
755
  };
641
756
  } catch (error) {
757
+ if (error instanceof Error && "code" in error && error.code === "STIM_COMPILATION_CACHE_CORRUPT") {
758
+ const remedy = "remedy" in error && typeof error.remedy === "string" ? ` ${error.remedy}` : "";
759
+ return {
760
+ ok: false,
761
+ code: COMPILATION_CACHE_CORRUPT,
762
+ message: `${error.message}${remedy}`
763
+ };
764
+ }
642
765
  return {
643
766
  ok: false,
644
767
  code: "native-build-failed",
@@ -671,15 +794,15 @@ async function compileNativeAndroid(job, root, log, time) {
671
794
  process.exit(143);
672
795
  };
673
796
  process.once("SIGTERM", stop);
674
- const logFile = join(workspaceLogsDir(root), "build-android.ndjson");
797
+ const logFile = join(workspaceLogsDir$1(root), "build-android.ndjson");
675
798
  note("build", `native Gradle ${options.variant ?? "debug"}`);
676
799
  try {
677
800
  rmSync(logFile, { force: true });
678
- const built = await time("buildMs", () => buildAndroidOperation(root, {
801
+ const built = await time("buildMs", () => workerOperation(root, (context) => buildAndroidOperation(context, root, {
679
802
  variant: options.variant ?? void 0,
680
803
  abi: options.abi ?? "all",
681
804
  remoteBuild: "local"
682
- }));
805
+ }, { cacheArtifacts: false })));
683
806
  if (built.cacheKey !== null || !built.cacheSkipped || !built.androidPackage) {
684
807
  rmSync(dirname(built.apkPath), {
685
808
  recursive: true,
@@ -710,7 +833,7 @@ async function compileNativeAndroid(job, root, log, time) {
710
833
  if (existsSync(logFile)) for (const record of parseNdjsonText(readFileSync(logFile, "utf8"))) log.write(record);
711
834
  }
712
835
  }
713
- async function compileMacos(job, root, log, time) {
836
+ async function compileMacos(context, job, root, log, time) {
714
837
  const options = job.macos;
715
838
  if (!options) return {
716
839
  ok: false,
@@ -780,7 +903,7 @@ async function compileMacos(job, root, log, time) {
780
903
  "--show-bin-path"
781
904
  ], true);
782
905
  const bundle = join(job.area, "out", job.job, `${options.product}.app`);
783
- stageBundle(root, options.product, options.infoPlist, bin, bundle, options.bundleId, extras);
906
+ await stageBundle(context, root, options.product, options.infoPlist, bin, bundle, options.bundleId, extras);
784
907
  return {
785
908
  ok: true,
786
909
  path: bundle,
@@ -816,6 +939,14 @@ async function compileIos(job, root, log, time) {
816
939
  onNote: (line) => note("build", line)
817
940
  }));
818
941
  if (!built.ok) {
942
+ if (built.compilationCacheCorruption) {
943
+ const report = clearCorruptCompilationCache(built.compilationCacheCorruption, root);
944
+ return {
945
+ ok: false,
946
+ code: report.code,
947
+ message: `${report.message} ${report.remedy}`
948
+ };
949
+ }
819
950
  const first = built.diagnostics[0]?.message;
820
951
  return {
821
952
  ok: false,
@@ -1,6 +1,6 @@
1
- import { k as process_identity_exports } from "./config-BYDxlMY3.mjs";
2
- import { c as writeWorkspaceState, o as withWorkspaceStateLock, r as readWorkspaceState } from "./workspace-state-DJt_MMvf.mjs";
3
- import { s as pidExists } from "./metro-DnCEjCxs.mjs";
1
+ import { p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
2
+ import { c as withWorkspaceStateLock, d as writeWorkspaceState, r as readWorkspaceState } from "./workspace-state-Cjuigeeu.mjs";
3
+ import { l as pidExists } from "./metro-DEXpIhHC.mjs";
4
4
  import { realpathSync } from "node:fs";
5
5
  //#region src/collector/state.ts
6
6
  function collectorRoot(root) {
@@ -1,5 +1,6 @@
1
- import { k as process_identity_exports } from "./config-BYDxlMY3.mjs";
2
- import { t as connectOwnedBrowser } from "./cdp-Dq_ypAlJ.mjs";
1
+ import { p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
2
+ import { en as throwIfCancelled } from "./settings-CsJDEXgK.mjs";
3
+ import { t as connectOwnedBrowser } from "./cdp-CWmIUMbw.mjs";
3
4
  //#region src/web/page.ts
4
5
  /** The record of a verified live browser: its supervisor and Chrome are the processes the record names. */
5
6
  function liveWebRecord(record) {
@@ -12,14 +13,16 @@ const NAVIGATE_ACK_MS = 1e3;
12
13
  * Sends one page-level DevTools command to the owned page, through a connection verified to reach its Chrome.
13
14
  * Resolves to the URL the page was on when the command was sent.
14
15
  */
15
- async function sendToOwnedPage(record, method, params = {}) {
16
- const cdp = await connectOwnedBrowser(record.cdpPort, record.chromeProcess.pid);
16
+ async function sendToOwnedPage(record, method, params = {}, signal) {
17
+ const cdp = await connectOwnedBrowser(record.cdpPort, record.chromeProcess.pid, signal);
17
18
  try {
18
19
  const { targetInfo } = await cdp.send("Target.getTargetInfo", { targetId: record.targetId });
20
+ throwIfCancelled(signal, "browser operation");
19
21
  const { sessionId } = await cdp.send("Target.attachToTarget", {
20
22
  targetId: record.targetId,
21
23
  flatten: true
22
24
  });
25
+ throwIfCancelled(signal, "browser operation");
23
26
  const reply = cdp.send(method, params, sessionId);
24
27
  if (method === "Page.navigate") {
25
28
  reply.catch(() => {});
@@ -0,0 +1,12 @@
1
+ import { resolve } from "path";
2
+ import { realpathSync } from "fs";
3
+ //#region src/commands/gc/paths.ts
4
+ function canonicalPath(p) {
5
+ try {
6
+ return realpathSync(p);
7
+ } catch {
8
+ return resolve(p);
9
+ }
10
+ }
11
+ //#endregion
12
+ export { canonicalPath as t };
@@ -0,0 +1,42 @@
1
+ import { existsSync, renameSync, rmSync, writeFileSync } from "node:fs";
2
+ import { buildCacheRoot as sharedBuildCache, ensurePrivateDir, withDirLock as withDirLock$1, withDirLockAsync as withDirLockAsync$1, workspaceId as workspaceId$1, workspaceName as workspaceName$1, workspaceStateDir as workspaceDir } from "@stim-cli/core";
3
+ import { emulatorLogFile, readJsonObject, sharedCcache as sharedCcache$1, sharedCompilationCache as sharedCompilationCache$1, supervisorLogFile, supervisorPidFile, workspaceAgentDeviceDir, workspaceDerivedData, workspaceLogErrorIndex, workspaceLogsDir as workspaceLogsDir$1, workspaceMetadataFile, workspaceStateFile as workspaceStateFile$1, workspaceStateLock } from "@stim-cli/core/state";
4
+ import { join, resolve } from "path";
5
+ //#region src/workspace/paths.ts
6
+ function ensureWorkspaceStorage(projectRoot) {
7
+ const canonicalRoot = resolve(projectRoot);
8
+ const dir = workspaceDir(canonicalRoot);
9
+ const file = workspaceMetadataFile(canonicalRoot);
10
+ ensurePrivateDir(dir);
11
+ return withDirLock$1(join(dir, "metadata.lock"), () => {
12
+ if (!existsSync(file)) {
13
+ const metadata = {
14
+ projectRoot: canonicalRoot,
15
+ workspace: workspaceName$1(canonicalRoot),
16
+ version: 1
17
+ };
18
+ const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
19
+ writeFileSync(tmp, `${JSON.stringify(metadata, null, 2)}\n`);
20
+ try {
21
+ renameSync(tmp, file);
22
+ } catch (error) {
23
+ rmSync(tmp, { force: true });
24
+ throw error;
25
+ }
26
+ return dir;
27
+ }
28
+ if (readJsonObject(file)?.projectRoot === canonicalRoot) return dir;
29
+ const error = /* @__PURE__ */ new Error(`Stim workspace collision at ${dir}: its workspace.json does not belong to ${canonicalRoot}.`);
30
+ error.code = "STIM_WORKSPACE_COLLISION";
31
+ throw error;
32
+ });
33
+ }
34
+ /** Initializes or validates workspace storage after asynchronously acquiring its metadata lock. */
35
+ function ensureWorkspaceStorageAsync(projectRoot, signal) {
36
+ signal?.throwIfAborted();
37
+ const dir = workspaceDir(resolve(projectRoot));
38
+ ensurePrivateDir(dir);
39
+ return withDirLockAsync$1(join(dir, "metadata.lock"), () => ensureWorkspaceStorage(projectRoot), { signal });
40
+ }
41
+ //#endregion
42
+ export { workspaceStateLock as _, sharedCcache$1 as a, supervisorPidFile as c, workspaceDir as d, workspaceId$1 as f, workspaceStateFile$1 as g, workspaceName$1 as h, sharedBuildCache as i, workspaceAgentDeviceDir as l, workspaceLogsDir$1 as m, ensureWorkspaceStorage as n, sharedCompilationCache$1 as o, workspaceLogErrorIndex as p, ensureWorkspaceStorageAsync as r, supervisorLogFile as s, emulatorLogFile as t, workspaceDerivedData as u, withDirLock$1 as v, withDirLockAsync$1 as y };
@@ -1,6 +1,6 @@
1
- import { m as buildPlacementSettings } from "./client-qQAaXSUs.mjs";
1
+ import { n as buildPlacementSettings } from "./selection-CSl9i5qU.mjs";
2
2
  //#region src/placement-log.ts
3
- /** `machine` is `local` when the run stays on this Mac. */
3
+ /** `machine` is `local` when the run stays on this machine. */
4
4
  function placementRecord(input) {
5
5
  const { choice, fallback } = input;
6
6
  const event = input.event ?? (input.kind === "build" ? "build_placement" : "device_placement");
@@ -42,8 +42,8 @@ function devicePlacementRecord({ platform, fromFlag, easFallback = false, placed
42
42
  });
43
43
  }
44
44
  /**
45
- * The record for where a build runs. `stays` is the reason this Mac builds it, `chose` the remote Mac that takes it,
46
- * and `fallback` why a remote Mac that was meant to build it did not.
45
+ * The record for where a build runs. `stays` is the reason this machine builds it, `chose` the remote machine that takes it,
46
+ * and `fallback` why a remote machine that was meant to build it did not.
47
47
  */
48
48
  function buildPlacementRecord({ platform, buildMachine, candidates = [], ...outcome }) {
49
49
  const base = {
@@ -75,7 +75,7 @@ function buildPlacementRecord({ platform, buildMachine, candidates = [], ...outc
75
75
  choice: {
76
76
  machine: "local",
77
77
  code,
78
- msg: "building on this Mac"
78
+ msg: "building on this machine"
79
79
  },
80
80
  fallback: {
81
81
  code,
@@ -1,12 +1,12 @@
1
- import { S as hostingMachines } from "./client-qQAaXSUs.mjs";
2
- import { r as readHostedNative } from "./ios-state-CBLe1xYw.mjs";
3
- import { l as probeHost, s as automaticDevicePlacement } from "./build-plan-B7SZsc2N.mjs";
1
+ import { d as hostingMachines } from "./selection-CSl9i5qU.mjs";
2
+ import { r as readHostedNative } from "./ios-state-DvFX-K_l.mjs";
3
+ import { i as probeHost, n as automaticDevicePlacement } from "./eas-fallback-DJwZpy0c.mjs";
4
4
  import { automaticMachineEnabled } from "@stim-cli/core/state";
5
5
  //#region src/device-host/plan-placement.ts
6
6
  /**
7
7
  * Where `--plan` assumes the next run puts its simulator or emulator, with no session, reservation or state write.
8
8
  * A named Mac, or the Mac a recorded session already holds, answers with the device its `device-host.offer` would
9
- * give; `auto` repeats the placement decision a run makes now and, when that stays on this Mac, notes any Mac
9
+ * give; `auto` repeats the placement decision a run makes now and, when that stays on this machine, notes any Mac
10
10
  * whose device would key differently. The result predicts the cache key only; a run reads its own device.
11
11
  */
12
12
  async function planHostedDevice({ root, slot, platform, machine, selectors, sameKey, eas, deps = {} }) {
@@ -56,11 +56,11 @@ async function planHostedDevice({ root, slot, platform, machine, selectors, same
56
56
  const differs = (await Promise.all(names.map((name) => probe(name, platform, selectors)))).flatMap(({ probe: each }) => "offer" in each && each.offer.choice && sameKey(each.offer.choice) === false ? [each.machine] : []);
57
57
  if (differs.length) return {
58
58
  kind: "local",
59
- placement: `this Mac; auto may use ${differs.join(", ")}, which builds for another architecture, so its key differs`
59
+ placement: `this machine; auto may use ${differs.join(", ")}, which builds for another architecture, so its key differs`
60
60
  };
61
61
  return {
62
62
  kind: "local",
63
- placement: names.length ? `this Mac; auto may use ${names.join(", ")}` : "this Mac"
63
+ placement: names.length ? `this machine; auto may use ${names.join(", ")}` : "this machine"
64
64
  };
65
65
  } catch (error) {
66
66
  return {
@@ -1,6 +1,6 @@
1
- import { p as getProject } from "./config-BYDxlMY3.mjs";
2
- import { n as findCommandWorkspace } from "./project-_phNIJfs.mjs";
3
- import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-4WopRPg-.mjs";
1
+ import { p as getProject } from "./config-CYcBF478.mjs";
2
+ import { n as findCommandWorkspace } from "./project-BZNjmW_8.mjs";
3
+ import { n as getNamedPort, t as clearNamedPorts } from "./named-ports-BWTzt6mu.mjs";
4
4
  //#region src/commands/ports.ts
5
5
  async function inProject(action) {
6
6
  try {