stim 1.23.1 → 1.25.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 (174) hide show
  1. package/README.md +3 -2
  2. package/dist/{acquire-artifact-BzYRDgaP.mjs → acquire-artifact-zA4S7RHE.mjs} +2 -2
  3. package/dist/{act-vxiMwdf5.mjs → act-BbHS3oV8.mjs} +41 -26
  4. package/dist/{activity-BpWUPgUm.mjs → activity-BpjwrQXU.mjs} +6 -6
  5. package/dist/{agent-device-usage-output-CUlLsbRt.mjs → agent-device-usage-output-Bnkerfod.mjs} +5 -5
  6. package/dist/{android-DtfRGLcc.mjs → android-BGwuK3Mc.mjs} +75 -50
  7. package/dist/{android-CLi6DSiS.mjs → android-CNZgRC-4.mjs} +5 -5
  8. package/dist/{android-C7sVmyI9.mjs → android-Cjcj8MCw.mjs} +140 -46
  9. package/dist/{android-cas-ngferVq2.mjs → android-cas-BVqh2Zep.mjs} +3 -3
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/{android-project-DVWyCbWU.d.mts → android-project-CTYaETc0.d.mts} +6 -2
  12. package/dist/{android-DR5lZ2Az.mjs → android-saBeB4lr.mjs} +13 -3
  13. package/dist/api.d.mts +22 -5
  14. package/dist/api.mjs +32 -31
  15. package/dist/{artifact-Xvgibgzq.mjs → artifact-Co8zixVx.mjs} +19 -17
  16. package/dist/{artifact-DBI3DALs.mjs → artifact-DN8JNwqS.mjs} +18 -17
  17. package/dist/{artifact-platform-CXcmX_j3.mjs → artifact-platform-CMRc0M_r.mjs} +3 -3
  18. package/dist/{browser-web-BJN9ZHxB.mjs → browser-web-CCgZsHmI.mjs} +16 -17
  19. package/dist/{budget-3ivAK99e.mjs → budget-HyShrIpL.mjs} +149 -47
  20. package/dist/{build-Dv9s8Fz-.mjs → build-CAiw8Ezm.mjs} +33 -29
  21. package/dist/{build-cache-Dv7RN200.mjs → build-cache-CKCzxzxA.mjs} +172 -21
  22. package/dist/{build-plan-BmbdHQbr.mjs → build-plan-zCuHGlA8.mjs} +8 -7
  23. package/dist/{cache-manifest-DSeQjt-Q.mjs → cache-manifest-BPXRONJz.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-CH2EWGPB.mjs → ccache-h1FKhZeg.mjs} +6 -6
  26. package/dist/{cdp-3fwICjzi.mjs → cdp-BG3FJCCx.mjs} +1 -1
  27. package/dist/{chrome-Bbw689-6.mjs → chrome-BvV8ssI3.mjs} +1 -1
  28. package/dist/{cli-BkK6Wr5i.mjs → cli-C4w607Pz.mjs} +20 -20
  29. package/dist/cli.mjs +1 -1
  30. package/dist/{client-B4MMzfo_.mjs → client-BQsmyp_-.mjs} +274 -39
  31. package/dist/collector-run.mjs +6 -6
  32. package/dist/{command-output-YKGWivpG.mjs → command-output-BBvS1H6v.mjs} +3 -2
  33. package/dist/{config-DlrsduwG.mjs → config-BZhXY15H.mjs} +3 -3
  34. package/dist/{created-devices-x9rN6bhs.mjs → created-devices-D2Aca-xu.mjs} +6 -2
  35. package/dist/{dependency-state-1I9KZT1Y.mjs → dependency-state-BwNCYG5Q.mjs} +2 -2
  36. package/dist/{detached-entry-BwNEtIrP.mjs → detached-entry-KmieOKgN.mjs} +1 -1
  37. package/dist/{dev-client-BFxiDpkf.mjs → dev-client-CHoXXZeg.mjs} +3 -3
  38. package/dist/{device-CiNYxqp6.mjs → device-B9FqTBYW.mjs} +81 -54
  39. package/dist/{device-B7ljwccX.mjs → device-F5-4z9ef.mjs} +16 -16
  40. package/dist/{device-capacity-DH0QsZYZ.mjs → device-capacity-ZYaRALv5.mjs} +20 -16
  41. package/dist/device-host-worker.mjs +17 -17
  42. package/dist/{device-ios-CbVDtDIy.mjs → device-ios-DkHBrmvH.mjs} +32 -50
  43. package/dist/{device-lease-run-DXPSwdbb.mjs → device-lease-run-ogEeJ62K.mjs} +6 -6
  44. package/dist/{device-pool-B4iOXIrD.mjs → device-pool-BIg8MU8l.mjs} +3 -3
  45. package/dist/{doctor-DRu-8ld6.mjs → doctor-A_Nr_fDe.mjs} +1 -1
  46. package/dist/{doctor-HUC1igzw.mjs → doctor-Bm8TVpGn.mjs} +37 -31
  47. package/dist/{doctor-fingerprint-DZLoYFVb.mjs → doctor-fingerprint-zlujA1Gs.mjs} +1 -1
  48. package/dist/doctor-fingerprint.mjs +1 -1
  49. package/dist/{doctor-C6t4Maue.mjs → doctor-k3P3PizH.mjs} +14 -14
  50. package/dist/{doctor-watchman-iGBpC6KM.mjs → doctor-watchman-BovI1y3-.mjs} +5 -5
  51. package/dist/{eas-build-DMWSSvxq.mjs → eas-build-CyDKNTBP.mjs} +4 -4
  52. package/dist/{eas-fallback-vKlrqxgE.mjs → eas-fallback-gaZi-dJL.mjs} +16 -15
  53. package/dist/{eas-session-ledger-BQF9Yyy9.mjs → eas-session-ledger-BMCA1gdO.mjs} +12 -8
  54. package/dist/{error-diagnostics-DYsjJIHz.mjs → error-diagnostics-B1Mj_-7h.mjs} +17 -42
  55. package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
  56. package/dist/{exec-DEoAhcze.mjs → exec-VFRpu1iA.mjs} +116 -28
  57. package/dist/{gc-BW8E1uSC.mjs → gc-B9jcnmIk.mjs} +205 -28
  58. package/dist/{gc-dDE4QPVu.mjs → gc-eaz403W6.mjs} +2 -2
  59. package/dist/{guide-DYYEO3Wz.mjs → guide-DR0K0xW9.mjs} +328 -89
  60. package/dist/{hosted-android-xcfgCgSF.mjs → hosted-android-Bvb2-ZxD.mjs} +4 -4
  61. package/dist/{hosted-client-Bt-tndxV.mjs → hosted-client-rsRqysJc.mjs} +4 -4
  62. package/dist/{hosted-ios-y19jCYFF.mjs → hosted-ios-RtVcJH3u.mjs} +1 -1
  63. package/dist/{hosted-logs-DzJKzKlj.mjs → hosted-logs-CWKGYWNX.mjs} +11 -6
  64. package/dist/{hosted-macos-BJusKvqL.mjs → hosted-macos-d0pv9Tth.mjs} +7 -7
  65. package/dist/{hosted-native-BmQC6U_x.mjs → hosted-native-BxTizGU2.mjs} +58 -11
  66. package/dist/{idle-shutdown-CJmUOV5x.mjs → idle-shutdown-BIyfl0Zj.mjs} +10 -10
  67. package/dist/{ios-hcBpnEGk.mjs → ios-BQzvJlzw.mjs} +122 -17
  68. package/dist/{ios-CWjqfSm_.mjs → ios-BRVM8b0P.mjs} +81 -49
  69. package/dist/{ios-DTOYZGMJ.mjs → ios-Dvt97HgQ.mjs} +8 -8
  70. package/dist/{ios-xtlRHaeB.mjs → ios-ENC4sRPA.mjs} +1 -1
  71. package/dist/{ios-device-BXZ0c7Kb.mjs → ios-device-B6HK951C.mjs} +1 -1
  72. package/dist/{ios-device-DFGuwF4U.mjs → ios-device-CKSvk0bu.mjs} +3 -3
  73. package/dist/{ios-project-CSZYI1iu.mjs → ios-project-DCUDo06I.mjs} +5 -5
  74. package/dist/{ios-signing-BtAffm0A.mjs → ios-signing-4c_qXvQm.mjs} +2 -2
  75. package/dist/{ios-state-Dtw5K2aI.mjs → ios-state-CT9nV5SP.mjs} +15 -7
  76. package/dist/{js-swap-BSBHldmm.mjs → js-swap-Z9HbC4cj.mjs} +7 -6
  77. package/dist/{launch-D-zq8SHG.mjs → launch-D0lPvFFu.mjs} +49 -30
  78. package/dist/{launch-CP2wDCVd.mjs → launch-DscF1QfM.mjs} +52 -50
  79. package/dist/{logs-pNvA2hHK.mjs → logs-BsIRre8x.mjs} +16 -9
  80. package/dist/{logs-By5aw3g9.mjs → logs-Crs9y34Z.mjs} +8 -6
  81. package/dist/{macos-CPMahOC2.mjs → macos-CcUlJPMu.mjs} +1 -1
  82. package/dist/{macos-C67FZ2ft.mjs → macos-D477nfzH.mjs} +49 -42
  83. package/dist/macos-run.mjs +1 -1
  84. package/dist/maintenance-run.mjs +7 -7
  85. package/dist/{metro-DiXtA3Ty.mjs → metro-1pJgCX4U.mjs} +4 -4
  86. package/dist/{metro-gateway-CKZqKqx7.mjs → metro-gateway-Bp9gJQAN.mjs} +3 -4
  87. package/dist/{named-ports-DkEzOfzO.mjs → named-ports-BVbn8SvC.mjs} +3 -3
  88. package/dist/{native-android-_MWSs3PP.mjs → native-android-BvMizJn1.mjs} +17 -17
  89. package/dist/{native-gradle-artifact-inputs-DHFnmrVf.mjs → native-gradle-artifact-inputs-BJscK4vN.mjs} +5 -5
  90. package/dist/{native-run-Dv88i0aU.mjs → native-run-D5OJsGwA.mjs} +6 -6
  91. package/dist/{native-runtime-DBRfY_PN.mjs → native-runtime-B9w_Qyz3.mjs} +10 -9
  92. package/dist/{native-source-Y0yLhFyQ.mjs → native-source-D-4Dh4JU.mjs} +7 -4
  93. package/dist/{native-xcode-inputs-CqViUh3r.mjs → native-xcode-inputs-Cv4l-obn.mjs} +2 -2
  94. package/dist/{native-xcode-ios-vFgqL_yS.mjs → native-xcode-ios-DGrg90hE.mjs} +21 -20
  95. package/dist/offload-worker.d.mts +12 -4
  96. package/dist/offload-worker.mjs +78 -43
  97. package/dist/{operation-exec-BW0em61G.mjs → operation-exec-CUZifp6Z.mjs} +2 -25
  98. package/dist/{ownership-C5fo5Edb.mjs → ownership-jxxz-19m.mjs} +3 -3
  99. package/dist/{page-DBL2PiUU.mjs → page-CzEA_-5_.mjs} +2 -3
  100. package/dist/phone-reverses-CYb7RRAx.mjs +57 -0
  101. package/dist/{placement-log-BnGgJRRZ.mjs → placement-log-DjOXJRIH.mjs} +1 -1
  102. package/dist/{plan-placement-cr0fEU7b.mjs → plan-placement-BqKgKHCi.mjs} +3 -3
  103. package/dist/{ports-DpXjKkSV.mjs → ports-DtS1Amb0.mjs} +3 -3
  104. package/dist/{prebuild-BligW0QS.mjs → prebuild-JUaqOLpc.mjs} +14 -9
  105. package/dist/{project-DhCtQWWU.mjs → project-BiC68mIp.mjs} +21 -17
  106. package/dist/{pull-request-W1IuLXDt.mjs → pull-request-CbNlkFok.mjs} +2 -2
  107. package/dist/pull-requests.mjs +1 -1
  108. package/dist/{react-native-android-ZlhQfhvq.mjs → react-native-android-DRYqoJc4.mjs} +76 -32
  109. package/dist/{react-native-build-CelbTO_y.mjs → react-native-build-CwZB-agu.mjs} +23 -20
  110. package/dist/{react-native-doctor-LTIaP7lv.mjs → react-native-doctor-BCrytK7h.mjs} +10 -9
  111. package/dist/{react-native-ios-C5W0SA6f.mjs → react-native-ios-Cr1buNFo.mjs} +41 -24
  112. package/dist/{recordings-CQmfzAh7.mjs → recordings-BaoQ0t-J.mjs} +1 -1
  113. package/dist/{registration-BcRgF6Ox.mjs → registration-CN6nlhcD.mjs} +1 -1
  114. package/dist/{reload-QcwnYLYV.mjs → reload-Beftw2X3.mjs} +1 -1
  115. package/dist/{reload-COJWTbae.mjs → reload-FbSgMF8x.mjs} +144 -42
  116. package/dist/{remote-DR8qUERM.mjs → remote-BuZj6AyU.mjs} +16 -7
  117. package/dist/{result-utnBea7x.mjs → result-CR2vk2cj.mjs} +41 -18
  118. package/dist/{run-DidHghD1.mjs → run-BtzE09Dl.mjs} +2 -2
  119. package/dist/{selection-DSMbWEX2.mjs → selection-D5cxEl3t.mjs} +13 -7
  120. package/dist/{server-bare-CafzuyFB.mjs → server-bare-CH9X0RLn.mjs} +56 -4
  121. package/dist/{server-command-B9o92sLM.mjs → server-command-CaBbDNU2.mjs} +5 -5
  122. package/dist/server-expo-C16Zf2k7.mjs +2 -0
  123. package/dist/{server-expo-BXrWxNYh.mjs → server-expo-Ck8EIidM.mjs} +14 -9
  124. package/dist/{settings-C7O8A6ZI.mjs → settings-B5tCoq9N.mjs} +132 -39
  125. package/dist/{settings-PfJx8uK1.mjs → settings-DzH9mGQZ.mjs} +1 -1
  126. package/dist/{settings-write-Chuy7Cte.mjs → settings-write-n0zwfohx.mjs} +7 -7
  127. package/dist/settings.schema.json +51 -0
  128. package/dist/{simslim-BNckWpXi.mjs → simslim-BjxszUAb.mjs} +22 -7
  129. package/dist/{slot-launch-B7AuoWJv.mjs → slot-launch-QeuJMlnJ.mjs} +6 -6
  130. package/dist/{stage-C4u17aES.mjs → stage-D8xlRU2D.mjs} +2 -3
  131. package/dist/{start-BL_BsiWt.mjs → start-C1JLjkNw.mjs} +1 -1
  132. package/dist/{start-CU8mCPC7.mjs → start-YMpNwLhh.mjs} +75 -35
  133. package/dist/{state--smjFSTL.mjs → state-DMRNP7-4.mjs} +4 -4
  134. package/dist/{state-08I3hw3_.mjs → state-DPaM3u5K.mjs} +2 -2
  135. package/dist/{stats-CO6sK0Nh.mjs → stats-CP7STzZw.mjs} +5 -5
  136. package/dist/{stats-report-BzaPrRm6.mjs → stats-report-n2U5plhk.mjs} +1 -1
  137. package/dist/{status-_WPHzVft.mjs → status-CRLiJ-O_.mjs} +24 -24
  138. package/dist/{status-BRROykC8.mjs → status-Fect2w9R.mjs} +1 -1
  139. package/dist/{status-CrJutl6-.mjs → status-cNw6i0_t.mjs} +1 -1
  140. package/dist/{status-watch-BHFasOZN.mjs → status-watch-Bc2J4TZn.mjs} +5 -5
  141. package/dist/status-worker.mjs +1 -1
  142. package/dist/stim-clonefile.c +18 -0
  143. package/dist/{stim-desktop-D5OGpYZM.mjs → stim-desktop-DS0mzR8U.mjs} +2 -2
  144. package/dist/{stop-iuFHjUST.mjs → stop-Br7LKxBE.mjs} +2 -2
  145. package/dist/{stop-CR5689oB.mjs → stop-COP6PQqw.mjs} +5 -5
  146. package/dist/{stop-BJ06ipTZ.mjs → stop-Db9Kh-UA.mjs} +109 -56
  147. package/dist/supervisor-run.mjs +17 -17
  148. package/dist/{support-CbXPbUMJ.mjs → support-Cxj9CmII.mjs} +6 -6
  149. package/dist/{support-TWuQlHQo.mjs → support-qKcbgmI5.mjs} +14 -11
  150. package/dist/{swiftpm-artifact-inputs-DFcGsXDP.mjs → swiftpm-artifact-inputs-iY9fsmOc.mjs} +4 -4
  151. package/dist/{swiftpm-macos-DbwGCpZg.mjs → swiftpm-macos-Bp_sn9P4.mjs} +15 -14
  152. package/dist/{toolchain-XkA2PfJZ.mjs → toolchain-DB1aeqxO.mjs} +1 -1
  153. package/dist/{toolchain-B9hCFCQw.mjs → toolchain-VzLJzZ7O.mjs} +69 -37
  154. package/dist/trigger-BLsHgAGR.mjs +2 -0
  155. package/dist/{trigger-Cbyc41d_.mjs → trigger-CBMe2YLH.mjs} +2 -2
  156. package/dist/{warm-progress-CA3TgT3-.mjs → warm-progress-BV3ZPmcY.mjs} +6 -6
  157. package/dist/{web-DRF_oFXk.mjs → web-B4Yjyt1G.mjs} +12 -10
  158. package/dist/web-DS4UDWvf.mjs +2 -0
  159. package/dist/web-run.mjs +8 -9
  160. package/dist/windows-report.mjs +12 -1
  161. package/dist/windows-report.ps1 +1 -1
  162. package/dist/{workspace-state-U08dEzhG.mjs → workspace-state-CPSp3mav.mjs} +11 -4
  163. package/dist/{workspaces-e41xsjKr.mjs → workspaces-C9w4aeXF.mjs} +36 -32
  164. package/dist/{worktree-B4Nj3EGS.mjs → worktree-CclFIe1Z.mjs} +324 -99
  165. package/dist/{worktree-BEwxVwKF.mjs → worktree-Ct9Gk3KL.mjs} +1 -1
  166. package/dist/{xcode-Rq744mBF.mjs → xcode-CiIIDnuD.mjs} +42 -28
  167. package/package.json +7 -7
  168. package/shim/bundle-response.cjs +53 -1
  169. package/shim/bundle-response.d.cts +1 -1
  170. package/shim/expo-metro-config.cjs +23 -1
  171. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +0 -211
  172. package/dist/server-expo-Ddr8cG_c.mjs +0 -2
  173. package/dist/trigger-yb_nFzPF.mjs +0 -2
  174. package/dist/web-kDE9Myoy.mjs +0 -2
@@ -1,20 +1,24 @@
1
- import { t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
- import { D as withConfigLock, G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync, _ as loadConfig, a as clearDevice, b as releaseAndroidConsolePort, i as clearAndroidBootPending, j as acquireAvdClaim, t as allConsolePortsAndSerials, w as setDevice } from "./config-DlrsduwG.mjs";
3
- import { l as phaseLine } from "./command-output-YKGWivpG.mjs";
4
- import { l as androidDataPartitionSizeGbSetting, o as androidAvdConfigSetting } from "./settings-C7O8A6ZI.mjs";
5
- import { s as ownedDeviceLabel } from "./project-DhCtQWWU.mjs";
6
- import { c as pidExists } from "./metro-DiXtA3Ty.mjs";
7
- import { A as teardownParkedAvd, D as teardownOwnedAvd } from "./workspaces-e41xsjKr.mjs";
8
- import { A as listAdbDevices, B as ownedAvdDeviceProfile, F as listAvdsAsync, H as ownedAvdMatchesConfiguration, I as listInstalledSystemImages, K as ownedAvdSystemImage, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, _ as avdPoolConfiguration, _t as parkedMaxSetting, b as configureNewOwnedAvd, et as resolveOwnedAvdSerialAsync, f as assertOwnedAvdStopped, ft as adoptParked, ht as isLegacyDeletionClaim, j as listAdbDevicesAsync, n as OWNED_AVD_CONFIG_DEFAULTS, ot as waitForBoot, t as DEFAULT_AVD_DEVICE_PROFILE, vt as readParked, x as createOwnedAvd, y as bootAndroidEmulator, z as nextConsolePort } from "./android-C7sVmyI9.mjs";
9
- import { I as memoryCulpritAdvice, N as memoryCulpritsUnder, P as readHostMemoryPressure, d as listAllIosSims } from "./ios-hcBpnEGk.mjs";
10
- import { t as clearDeviceIdleShutdown } from "./idle-shutdown-CJmUOV5x.mjs";
11
- import { i as countLiveOwnedDevices, m as withDeviceBootAdmission, n as DeviceAdmissionRefusal } from "./device-capacity-DH0QsZYZ.mjs";
12
- import { i as ensureOwnedIosDevice, r as ensureIosBooted } from "./device-ios-CbVDtDIy.mjs";
13
- import { t as reconcileSimSlim } from "./simslim-BNckWpXi.mjs";
1
+ import { D as ownership_claim_exports, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { D as withConfigLock$1, G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, a as clearDevice, b as releaseAndroidConsolePort, i as clearAndroidBootPending, j as acquireAvdClaim, t as allConsolePortsAndSerials, w as setDevice } from "./config-BZhXY15H.mjs";
3
+ import { l as phaseLine } from "./command-output-BBvS1H6v.mjs";
4
+ import { l as androidDataPartitionSizeGbSetting, o as androidAvdConfigSetting } from "./settings-B5tCoq9N.mjs";
5
+ import { s as ownedDeviceLabel } from "./project-BiC68mIp.mjs";
6
+ import { A as listAdbDevices, B as ownedAvdDeviceProfile, F as listAvdsAsync, H as ownedAvdMatchesConfiguration, I as listInstalledSystemImages, K as ownedAvdSystemImage, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, _ as avdPoolConfiguration, b as configureNewOwnedAvd, ct as waitForBoot, f as assertOwnedAvdStopped, gt as isLegacyDeletionClaim, j as listAdbDevicesAsync, n as OWNED_AVD_CONFIG_DEFAULTS, nt as resolveOwnedAvdSerialAsync, pt as adoptParked, t as DEFAULT_AVD_DEVICE_PROFILE, vt as parkedMaxSetting, x as createOwnedAvd, y as bootAndroidEmulator, yt as readParked, z as nextConsolePort } from "./android-Cjcj8MCw.mjs";
7
+ import { c as pidExists } from "./metro-1pJgCX4U.mjs";
8
+ import { O as teardownOwnedAvd, j as teardownParkedAvd } from "./workspaces-C9w4aeXF.mjs";
9
+ import { h as tailLines } from "./activity-BpjwrQXU.mjs";
10
+ import { F as memoryCulpritsUnderAsync, I as readHostMemoryPressure, R as reportMemoryCulprits, d as listAllIosSims, z as memoryCulpritAdvice } from "./ios-BQzvJlzw.mjs";
11
+ import { t as clearDeviceIdleShutdown } from "./idle-shutdown-BIyfl0Zj.mjs";
12
+ import { i as countLiveOwnedDevices, m as withDeviceBootAdmission, n as DeviceAdmissionRefusal } from "./device-capacity-ZYaRALv5.mjs";
13
+ import { i as ensureOwnedIosDevice, r as ensureIosBooted } from "./device-ios-DkHBrmvH.mjs";
14
+ import { t as reconcileSimSlim } from "./simslim-BjxszUAb.mjs";
14
15
  import { claimRemoveCommand, clearClaimChild, markClaimChildPending, processGroupAlive, releaseClaim, setClaimChild } from "@stim-cli/core/ownership-claim";
15
16
  import { randomUUID } from "node:crypto";
16
17
  import { existsSync } from "node:fs";
17
18
  import { isDeepStrictEqual } from "node:util";
19
+ import { dirname, join, resolve, sep } from "node:path";
20
+ import { rotatedLogPath } from "@stim-cli/core";
21
+ import { acceptsShape, settingDefinition } from "@stim-cli/core/state";
18
22
  import { fileURLToPath } from "node:url";
19
23
  import { captureProcessIdentity } from "@stim-cli/core/process-identity";
20
24
  import chalk from "chalk";
@@ -26,7 +30,7 @@ async function requestLocal(url, platform, prefetch) {
26
30
  const req = request(url, { headers: {
27
31
  accept: "application/json",
28
32
  "expo-platform": platform,
29
- ...prefetch ? { "x-stim-metro-warmup": "1" } : {}
33
+ "x-stim-metro-warmup": "1"
30
34
  } });
31
35
  const timer = setTimeout(() => req.destroy(), WARMUP_TIMEOUT_MS);
32
36
  timer.unref();
@@ -48,7 +52,33 @@ async function requestLocal(url, platform, prefetch) {
48
52
  req.end();
49
53
  });
50
54
  }
51
- async function warmMetro({ port, platform, isExpo, appId, bundleUrl }) {
55
+ const ENTRY_EXTENSIONS = [
56
+ "",
57
+ ".js",
58
+ ".jsx",
59
+ ".ts",
60
+ ".tsx"
61
+ ];
62
+ function entryExists(bundlePath, root) {
63
+ const entry = decodeURIComponent(bundlePath.replace(/\.bundle\/*$/, ""));
64
+ if (entry.startsWith("/.expo/")) return true;
65
+ for (let dir = resolve(root);; dir = dirname(dir)) {
66
+ const file = resolve(dir, `.${entry}`);
67
+ if (file.startsWith(dir + sep) && ENTRY_EXTENSIONS.some((ext) => existsSync(file + ext))) return true;
68
+ if (dirname(dir) === dir) return false;
69
+ }
70
+ }
71
+ function recordedBundleUrl(logsDir, root, platform) {
72
+ const setting = settingDefinition(`metro.warmupUrl.${platform}`);
73
+ if (!logsDir || !root || !setting) return null;
74
+ const log = join(logsDir, "metro.ndjson");
75
+ for (const file of [log, rotatedLogPath(log)]) for (const line of (tailLines(file) ?? []).toReversed()) try {
76
+ const record = JSON.parse(line);
77
+ if (record?.event === "bundle_response_started" && record.platform === platform && acceptsShape(setting, record.url) && entryExists(new URL(record.url, "http://localhost").pathname, root)) return record.url;
78
+ } catch {}
79
+ return null;
80
+ }
81
+ async function warmMetro({ port, platform, isExpo, appId, bundleUrl, logsDir, root }) {
52
82
  try {
53
83
  const origin = `http://127.0.0.1:${port}`;
54
84
  if (await requestLocal(new URL("/_stim/metro-warmup", origin), platform, false) !== "ready") return;
@@ -65,6 +95,7 @@ async function warmMetro({ port, platform, isExpo, appId, bundleUrl }) {
65
95
  sourcePaths: "url-server",
66
96
  ...appId ? { app: appId } : {}
67
97
  }).toString();
98
+ bundleUrl ||= recordedBundleUrl(logsDir, root, platform);
68
99
  if (!bundleUrl && isExpo) {
69
100
  const body = await requestLocal(new URL(origin), platform, false);
70
101
  if (body === null) return;
@@ -91,12 +122,12 @@ var AvdBootError = class extends Error {
91
122
  };
92
123
  var AvdRecoveryError = class extends AvdBootError {};
93
124
  function findOtherOwner(avdName, projectPath, selectedSlot = "default") {
94
- for (const [path, project] of Object.entries(loadConfig()?.projects ?? {})) if (projectDeviceSlots(project).some(({ slot, platforms }) => (path !== projectPath || slot !== selectedSlot) && platforms.android?.avdName?.toLowerCase() === avdName.toLowerCase())) return path;
125
+ for (const [path, project] of Object.entries(loadConfig$1()?.projects ?? {})) if (projectDeviceSlots(project).some(({ slot, platforms }) => (path !== projectPath || slot !== selectedSlot) && platforms.android?.avdName?.toLowerCase() === avdName.toLowerCase())) return path;
95
126
  return null;
96
127
  }
97
128
  async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, systemImage, deviceProfile, configuration, configure, teardown = teardownOwnedAvd }) {
98
- const { claim, reservation, previous, avdName } = await withConfigLockAsync(() => {
99
- const previous = deviceSlotPlatforms(loadConfig()?.projects?.[projectPath], slot)?.android;
129
+ const { claim, reservation, previous, avdName } = await withConfigLockAsync$1(() => {
130
+ const previous = deviceSlotPlatforms(loadConfig$1()?.projects?.[projectPath], slot)?.android;
100
131
  if (previous?.avdName && previous.avdName !== previousAvdName) throw new Error(`Another Stim run assigned AVD ${previous.avdName} to this workspace. Retry to use it.`);
101
132
  if (readParked("android").some((entry) => entry.name === ownedAvdName(label)) || findOtherOwner(ownedAvdName(label), projectPath, slot)) label = `${label}-${randomUUID().slice(0, 8)}`;
102
133
  const avdName = ownedAvdName(label);
@@ -121,7 +152,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
121
152
  throw error;
122
153
  }
123
154
  });
124
- const currentRecord = () => deviceSlotPlatforms(loadConfig()?.projects?.[projectPath], slot)?.android;
155
+ const currentRecord = () => deviceSlotPlatforms(loadConfig$1()?.projects?.[projectPath], slot)?.android;
125
156
  const assertReservation = () => {
126
157
  if (readParked("android").some((entry) => entry.name === avdName)) throw new Error(`AVD ${avdName} was parked by another Stim run. Retry to adopt it safely.`);
127
158
  const owner = findOtherOwner(avdName, projectPath, slot);
@@ -168,7 +199,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
168
199
  if (!message.includes("already exists")) throw error;
169
200
  try {
170
201
  if (!(await listAvdsAsync()).includes(avdName)) throw new AvdRecoveryError(`AVD ${avdName} already exists on disk but is not listed by the emulator. ${message}`, "Run `npx stim gc` to inspect orphaned owned AVDs, then `npx stim gc --delete` to reclaim those safe to delete. Retry `stim android` after cleanup; keep any AVD that GC cannot verify.", error);
171
- await withConfigLockAsync(assertReservation);
202
+ await withConfigLockAsync$1(assertReservation);
172
203
  const resolved = await resolveOwnedAvdSerialAsync(avdName);
173
204
  if (resolved.missing || resolved.notOwned) throw new Error(`AVD ${avdName} could not be verified for recovery. Retry after checking its registration.`, { cause: error });
174
205
  if (!resolved.serial) assertOwnedAvdStopped(avdName);
@@ -183,7 +214,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
183
214
  } : {}
184
215
  };
185
216
  } catch (recoveryError) {
186
- await withConfigLockAsync(() => {
217
+ await withConfigLockAsync$1(() => {
187
218
  if (!isDeepStrictEqual(currentRecord(), reservation)) return;
188
219
  if (previous) setDevice(projectPath, "android", previous, slot);
189
220
  else clearDevice(projectPath, "android", slot, avdName);
@@ -197,7 +228,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
197
228
  } catch (error) {
198
229
  configurationFailure = { error };
199
230
  }
200
- if (!configurationFailure) await withConfigLockAsync(() => {
231
+ if (!configurationFailure) await withConfigLockAsync$1(() => {
201
232
  assertReservation();
202
233
  setDevice(projectPath, "android", {
203
234
  avdName,
@@ -227,9 +258,7 @@ async function prepareOwnedAvd({ projectPath, slot, label, previousAvdName, syst
227
258
  slot,
228
259
  expectedRecord: reservation
229
260
  },
230
- onRemoved: () => {
231
- clearDevice(projectPath, "android", slot, avdName);
232
- }
261
+ onRemoved: () => withConfigLockAsync$1(() => clearDevice(projectPath, "android", slot, avdName))
233
262
  });
234
263
  const orphan = cleanup.status === "failed" || cleanup.status === "skipped" ? ` The owned AVD remains tracked for cleanup (${cleanup.reason || cleanup.status}); fix the cause, then retry or run \`stim gc --delete\`.` : "";
235
264
  throw new Error(`Created owned AVD ${avdName}, but could not configure its AVD settings: ${String(error?.message || error)}${orphan}`, { cause: error });
@@ -257,9 +286,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
257
286
  slot,
258
287
  expectedRecord: record
259
288
  },
260
- onRemoved: () => {
261
- clearDevice(projectPath, "android", slot, avdName);
262
- }
289
+ onRemoved: () => withConfigLockAsync$1(() => clearDevice(projectPath, "android", slot, avdName))
263
290
  });
264
291
  if (cleanup.status === "failed" || cleanup.status === "skipped") throw new AvdRecoveryError(`Owned AVD ${record.avdName} has incomplete setup and could not be deleted (${cleanup.reason || cleanup.status}). Fix the cause, then retry; Stim kept the device record for cleanup.`, "Wait for any active AVD operation to finish. If the refusal names an unresolved claim, inspect its creator and native processes before removing only that claim. Retry `stim android` to reconcile the incomplete device.");
265
292
  record = null;
@@ -277,9 +304,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
277
304
  slot,
278
305
  expectedRecord: record
279
306
  },
280
- onRemoved: () => {
281
- clearDevice(projectPath, "android", slot, avdName);
282
- }
307
+ onRemoved: () => withConfigLockAsync$1(() => clearDevice(projectPath, "android", slot, avdName))
283
308
  });
284
309
  if (cleanup.status === "failed" || cleanup.status === "skipped") throw new AvdRecoveryError(`Owned AVD ${avdName} never finished a boot, but could not be deleted to create one on ${requestedImage} (${cleanup.reason || cleanup.status}). Stim kept the device record.`, "Fix the cause, then retry, or pass `--slot <name>` to create the requested emulator beside it.");
285
310
  out(phaseLine("device", `deleted ${avdName}, which never finished a boot, to create one on ${requestedImage}`));
@@ -290,7 +315,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
290
315
  const configurationBeforeDefaults = avdPoolConfiguration(androidDataPartitionSizeGbSetting(settings), projectAvdConfig, deviceProfile);
291
316
  if (record?.avdName) {
292
317
  if (record.owned) {
293
- const resolved = await resolveOwnedAvdSerialAsync(record.avdName);
318
+ const resolved = await resolveOwnedAvdSerialAsync(record.avdName, { preferredSerial: record.consolePort ? `emulator-${record.consolePort}` : void 0 });
294
319
  const currentProfile = resolved.notOwned || resolved.missing ? null : ownedAvdDeviceProfile(record.avdName);
295
320
  if (requestedProfile && currentProfile && currentProfile !== requestedProfile) throw new AvdRecoveryError(`this project's emulator uses device profile ${currentProfile}, but ${requestedProfile} was requested. Stim will not silently boot a different model.`, "Run `stim worktree remove` (or `stim gc --delete`) to reap the current emulator, then `stim android` again to create the requested one, or pass `--slot <name>` to create it beside the current one.");
296
321
  if (resolved.notOwned) note(chalk.yellow(`Note: recorded AVD ${record.avdName} is not Stim-owned -- creating a fresh owned AVD instead of reusing it.`));
@@ -304,7 +329,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
304
329
  owned: true,
305
330
  deviceName: record.deviceName ?? record.avdName
306
331
  };
307
- setDevice(projectPath, "android", updated, slot);
332
+ await withConfigLockAsync$1(() => setDevice(projectPath, "android", updated, slot));
308
333
  return {
309
334
  ...updated,
310
335
  systemImage: ownedAvdSystemImage(record.avdName),
@@ -369,7 +394,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
369
394
  poolConfiguration: parked.configuration,
370
395
  adoptionPending: true
371
396
  };
372
- if (!adoptParked({
397
+ if (!await adoptParked({
373
398
  platform: "android",
374
399
  projectPath,
375
400
  slot,
@@ -444,7 +469,7 @@ async function ensureOwnedAndroidDevice({ record, projectPath, slot, settingsRoo
444
469
  deviceProfile: created.deviceProfile
445
470
  };
446
471
  }
447
- function claimAndroidConsolePort({ projectPath, slot, avdName, deviceName, livePorts = [], metadata }, { lock = withConfigLock, recordedPorts = () => allConsolePortsAndSerials().androidConsolePorts, record = setDevice } = {}) {
472
+ function claimAndroidConsolePort({ projectPath, slot, avdName, deviceName, livePorts = [], metadata }, { lock = withConfigLock$1, recordedPorts = () => allConsolePortsAndSerials().androidConsolePorts, record = setDevice } = {}) {
448
473
  return lock(() => {
449
474
  const consolePort = nextConsolePort([...recordedPorts(), ...livePorts]);
450
475
  const claim = {
@@ -469,14 +494,15 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
469
494
  platform: "android",
470
495
  key: avdName
471
496
  }, async () => {
472
- const claim = claimAndroidConsolePort({
497
+ const livePorts = liveAndroidConsolePorts();
498
+ const claim = await withConfigLockAsync$1(() => claimAndroidConsolePort({
473
499
  projectPath,
474
500
  slot,
475
501
  avdName,
476
502
  deviceName,
477
- livePorts: liveAndroidConsolePorts(),
503
+ livePorts,
478
504
  metadata
479
- });
505
+ }));
480
506
  const serial = `emulator-${claim.consolePort}`;
481
507
  try {
482
508
  reportAndroidMemoryPressure(out);
@@ -492,7 +518,7 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
492
518
  if (result.failed) throw new AvdBootError(result.reason, result.remedy);
493
519
  const running = await getAvdNameForSerialAsync(serial);
494
520
  if (running && running !== avdName) throw new Error(`${serial} is running AVD ${running}, not this workspace's owned AVD ${avdName}; refusing to use it.`);
495
- clearAndroidBootPending(projectPath, avdName, slot);
521
+ await withConfigLockAsync$1(() => clearAndroidBootPending(projectPath, avdName, slot));
496
522
  await muteBootedEmulator(serial, avdName, out);
497
523
  const { bootPending: _booted, ...booted } = claim;
498
524
  return {
@@ -501,7 +527,7 @@ async function bootOwnedAvdOnFreshPort({ avdName, deviceSlotWait, metadata, proj
501
527
  setup: true
502
528
  };
503
529
  } catch (error) {
504
- releaseAndroidConsolePort(projectPath, claim.consolePort, slot);
530
+ await withConfigLockAsync$1(() => releaseAndroidConsolePort(projectPath, claim.consolePort, slot));
505
531
  throw error;
506
532
  }
507
533
  }, {
@@ -566,11 +592,11 @@ async function muteBootedEmulator(serial, avdName, out) {
566
592
  function reportAndroidMemoryPressure(out) {
567
593
  const pressure = readHostMemoryPressure();
568
594
  if (pressure === "warning" || pressure === "critical") {
569
- const named = memoryCulpritAdvice(memoryCulpritsUnder(pressure));
570
- out(chalk.dim(phaseLine("memory", `macOS reports ${pressure} host memory pressure; emulator boot may be slow.${named ? ` ${named}` : ""} Free memory with \`stim stop\` only in workspaces you own; ask before closing other apps or devices.`)));
595
+ out(chalk.dim(phaseLine("memory", `macOS reports ${pressure} host memory pressure; emulator boot may be slow. Free memory with \`stim stop\` only in workspaces you own; ask before closing other apps or devices.`)));
596
+ reportMemoryCulprits(pressure, (named) => out(chalk.dim(phaseLine("memory", named))));
571
597
  }
572
598
  }
573
- function androidBootRemedy(pressure) {
599
+ async function androidBootRemedy(pressure) {
574
600
  let count = null;
575
601
  try {
576
602
  const live = countLiveOwnedDevices({
@@ -583,7 +609,7 @@ function androidBootRemedy(pressure) {
583
609
  });
584
610
  count = typeof live === "number" ? live : null;
585
611
  } catch {}
586
- const named = memoryCulpritAdvice(memoryCulpritsUnder(pressure));
612
+ const named = memoryCulpritAdvice(await memoryCulpritsUnderAsync(pressure));
587
613
  const observation = pressure === "warning" || pressure === "critical" ? `macOS reports ${pressure} host memory pressure. ${named ? `${named} ` : ""}` : "";
588
614
  const devices = count ? `${count} Stim-owned ${count === 1 ? "device is" : "devices are"} running. ` : "";
589
615
  if (observation || devices) return `${observation}${devices}Stop an unneeded device with \`stim stop\` only in a workspace you own, then run \`stim android\` again; ask before closing other apps or devices. These observations do not establish the cause of the timeout or an OOM crash.`;
@@ -617,7 +643,7 @@ async function waitForAndroidBoot({ serial, timeoutMs, pid = null, alive = pidEx
617
643
  return {
618
644
  failed: true,
619
645
  reason: `${exited ? `The emulator process for ${serial} exited before the device finished booting.` : `Emulator ${serial} did not finish booting within ${Math.round(elapsedMs / 1e3)}s.`} Diagnostic: ${JSON.stringify(result.diagnostic)}`,
620
- remedy: exited ? "Inspect the emulator log for the process exit, fix what it reports, then run `stim android` again." : androidBootRemedy(pressure)
646
+ remedy: exited ? "Inspect the emulator log for the process exit, fix what it reports, then run `stim android` again." : await androidBootRemedy(pressure)
621
647
  };
622
648
  }
623
649
  async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot, timeoutMs, out, logFile = null, alive = pidExists }) {
@@ -627,7 +653,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
627
653
  };
628
654
  let resolved;
629
655
  try {
630
- resolved = await resolveOwnedAvdSerialAsync(device.avdName);
656
+ resolved = await resolveOwnedAvdSerialAsync(device.avdName, { preferredSerial: device.consolePort ? `emulator-${device.consolePort}` : void 0 });
631
657
  } catch (e) {
632
658
  return {
633
659
  failed: true,
@@ -643,8 +669,8 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
643
669
  reason: `AVD ${device.avdName} is not Stim-owned; refusing to boot it.`
644
670
  };
645
671
  const avdName = device.avdName;
646
- const booted = (result) => {
647
- if (!result.failed) clearAndroidBootPending(projectPath, avdName, slot);
672
+ const booted = async (result) => {
673
+ if (!result.failed) await withConfigLockAsync$1(() => clearAndroidBootPending(projectPath, avdName, slot));
648
674
  return result;
649
675
  };
650
676
  if (resolved.serial) return booted(await waitForAndroidBoot({
@@ -659,14 +685,15 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
659
685
  out
660
686
  }));
661
687
  const boot = async () => {
662
- const claim = claimAndroidConsolePort({
688
+ const livePorts = liveAndroidConsolePorts();
689
+ const claim = await withConfigLockAsync$1(() => claimAndroidConsolePort({
663
690
  projectPath,
664
691
  slot,
665
692
  avdName,
666
693
  deviceName: device.deviceName,
667
- livePorts: liveAndroidConsolePorts(),
694
+ livePorts,
668
695
  metadata: device
669
- });
696
+ }));
670
697
  const serial = `emulator-${claim.consolePort}`;
671
698
  reportAndroidMemoryPressure(out);
672
699
  out(chalk.dim(phaseLine("device", `booting ${avdName} as ${serial}`)));
@@ -674,7 +701,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
674
701
  try {
675
702
  pid = await bootAndroidEmulator(avdName, claim.consolePort, { logFile });
676
703
  } catch (e) {
677
- releaseAndroidConsolePort(projectPath, claim.consolePort, slot);
704
+ await withConfigLockAsync$1(() => releaseAndroidConsolePort(projectPath, claim.consolePort, slot));
678
705
  return {
679
706
  failed: true,
680
707
  reason: `Could not start emulator for AVD ${avdName}: ${e?.message || e}`
@@ -687,7 +714,7 @@ async function ensureAndroidBooted({ device, deviceSlotWait, projectPath, slot,
687
714
  alive,
688
715
  out
689
716
  });
690
- if (result.failed) releaseAndroidConsolePort(projectPath, claim.consolePort, slot);
717
+ if (result.failed) await withConfigLockAsync$1(() => releaseAndroidConsolePort(projectPath, claim.consolePort, slot));
691
718
  else await muteBootedEmulator(serial, avdName, out);
692
719
  return booted(result);
693
720
  };
@@ -721,7 +748,7 @@ function didSetUpDevice(device, remote) {
721
748
  return remote ? void 0 : Boolean(device.setup || device.booting);
722
749
  }
723
750
  async function ensureOwnedDevice({ platform, project, projectPath, slot, settingsRoot = projectPath, label = ownedDeviceLabel(projectPath), settings, flags = {}, note = () => {}, out = () => {}, logFile = null, alive = pidExists, configureAvd = configureNewOwnedAvd, teardownAvd = teardownOwnedAvd, reconcileIosSimulator = reconcileSimSlim, simSnapshot }) {
724
- clearDeviceIdleShutdown(projectPath, platform, slot);
751
+ await clearDeviceIdleShutdown(projectPath, platform, slot);
725
752
  if (slot && slot !== "default") label = `${label}-${slot}`;
726
753
  const record = deviceSlotPlatforms(project, slot)?.[platform] ?? null;
727
754
  if (platform === "ios") return ensureOwnedIosDevice({
@@ -1,20 +1,20 @@
1
- import { m as operationState, t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-DlrsduwG.mjs";
1
+ import { b as operationState, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-BZhXY15H.mjs";
3
3
  import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
4
- import { r as clockTime } from "./command-output-YKGWivpG.mjs";
5
- import { Ht as makeTemporaryDirectory, K as resolveIosProjectDir, Ut as removeTemporaryEntry, q as resolveProjectSettings, tt as settingValueAt } from "./settings-C7O8A6ZI.mjs";
6
- import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-DhCtQWWU.mjs";
7
- import { In as runProcessOperation } from "./budget-3ivAK99e.mjs";
8
- import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-BpWUPgUm.mjs";
9
- import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, s as androidPoolCandidates, tt as resolvePhysicalDevice } from "./android-C7sVmyI9.mjs";
10
- import { m as resolveScheme, v as xcodebuildArgs } from "./xcode-Rq744mBF.mjs";
11
- import { a as discoverXcodeProject } from "./react-native-build-CelbTO_y.mjs";
12
- import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-DXPSwdbb.mjs";
13
- import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-TWuQlHQo.mjs";
14
- import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-BtAffm0A.mjs";
15
- import { t as selectFromPool } from "./device-pool-B4iOXIrD.mjs";
16
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-DFGuwF4U.mjs";
17
- import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-CqViUh3r.mjs";
4
+ import { r as clockTime } from "./command-output-BBvS1H6v.mjs";
5
+ import { J as resolveProjectSettings, Ut as makeTemporaryDirectory, Wt as removeTemporaryEntry, nt as settingValueAt, q as resolveIosProjectDir } from "./settings-B5tCoq9N.mjs";
6
+ import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-BiC68mIp.mjs";
7
+ import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-Cjcj8MCw.mjs";
8
+ import { zn as runProcessOperation } from "./budget-HyShrIpL.mjs";
9
+ import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-BpjwrQXU.mjs";
10
+ import { m as resolveScheme, v as xcodebuildArgs } from "./xcode-CiIIDnuD.mjs";
11
+ import { a as discoverXcodeProject } from "./react-native-build-CwZB-agu.mjs";
12
+ import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-ogEeJ62K.mjs";
13
+ import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-qKcbgmI5.mjs";
14
+ import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-4c_qXvQm.mjs";
15
+ import { t as selectFromPool } from "./device-pool-BIg8MU8l.mjs";
16
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-CKSvk0bu.mjs";
17
+ import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-Cv4l-obn.mjs";
18
18
  import { existsSync, readdirSync, realpathSync, statSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
20
  import { join } from "node:path";
@@ -1,15 +1,15 @@
1
- import { a as workspaceProcessLockError, i as withWorkspaceProcessLock, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
1
+ import { D as ownership_claim_exports, d as workspaceProcessLockError, u as withWorkspaceProcessLock } from "./exec-VFRpu1iA.mjs";
2
2
  import { m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
3
- import { G as projectDeviceSlots, H as deviceSlotPlatforms, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-DlrsduwG.mjs";
4
- import { a as formatElapsed, l as phaseLine } from "./command-output-YKGWivpG.mjs";
5
- import { g as deviceReclaimIdleMinutesSetting } from "./settings-C7O8A6ZI.mjs";
3
+ import { G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-BZhXY15H.mjs";
4
+ import { a as formatElapsed, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
5
+ import { g as deviceReclaimIdleMinutesSetting } from "./settings-B5tCoq9N.mjs";
6
+ import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-Cjcj8MCw.mjs";
6
7
  import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
7
- import { K as recordCapacityRefusal, q as recordCapacityWait } from "./budget-3ivAK99e.mjs";
8
+ import { J as recordCapacityRefusal, Y as recordCapacityWait } from "./budget-HyShrIpL.mjs";
8
9
  import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
9
- import { f as withIdleWorkspace } from "./workspaces-e41xsjKr.mjs";
10
- import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-C7sVmyI9.mjs";
11
- import { d as listAllIosSims, f as listAllIosSimsAsync, l as iosRuntimeMatches, y as parseRuntimeVersion } from "./ios-hcBpnEGk.mjs";
12
- import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-CJmUOV5x.mjs";
10
+ import { p as withIdleWorkspace } from "./workspaces-C9w4aeXF.mjs";
11
+ import { d as listAllIosSims, f as listAllIosSimsAsync, l as iosRuntimeMatches, y as parseRuntimeVersion } from "./ios-BQzvJlzw.mjs";
12
+ import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-BIyfl0Zj.mjs";
13
13
  import { realpathSync } from "node:fs";
14
14
  import { basename, join } from "node:path";
15
15
  import { LOG_ROTATE_BYTES, workspaceId } from "@stim-cli/core";
@@ -524,24 +524,28 @@ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrenc
524
524
  await sleep(Math.min(2e3, Math.max(0, waitMs - elapsedMs)));
525
525
  }
526
526
  } catch (error) {
527
- if (error instanceof DeviceAdmissionRefusal && error.code === "STIM_AT_CAPACITY") recordCapacityRefusal({
528
- platform: device.platform,
529
- max,
530
- workspace
531
- }, now());
527
+ if (error instanceof DeviceAdmissionRefusal && error.code === "STIM_AT_CAPACITY") {
528
+ const at = now();
529
+ await withConfigLockAsync$1(() => recordCapacityRefusal({
530
+ platform: device.platform,
531
+ max,
532
+ workspace
533
+ }, at)).catch(() => {});
534
+ }
532
535
  throw error;
533
536
  } finally {
534
537
  (0, ownership_claim_exports.releaseClaim)(ticket);
535
538
  if (visibleWait) waitingFor(null);
536
539
  if (started !== void 0) {
537
540
  const ms = Math.max(0, Math.round(now() - started));
538
- recordCapacityWait({
541
+ const at = now();
542
+ await withConfigLockAsync$1(() => recordCapacityWait({
539
543
  platform: device.platform,
540
544
  ms,
541
545
  max,
542
546
  workspace,
543
547
  ...reclaimed ? { reclaimed } : {}
544
- }, now());
548
+ }, at)).catch(() => {});
545
549
  onWait(ms);
546
550
  }
547
551
  }
@@ -1,21 +1,21 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
2
  import { n as ensureWorkspaceStorage } from "./paths-DQtTgsBf.mjs";
3
- import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-DlrsduwG.mjs";
4
- import { d as writeWorkspaceState } from "./workspace-state-U08dEzhG.mjs";
5
- import { i as macosProcess, o as requiredMacosRecord } from "./state-08I3hw3_.mjs";
3
+ import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-BZhXY15H.mjs";
4
+ import { d as writeWorkspaceState } from "./workspace-state-CPSp3mav.mjs";
5
+ import { i as macosProcess, o as requiredMacosRecord } from "./state-DPaM3u5K.mjs";
6
+ import { A as listAdbDevices, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, ct as waitForBoot, d as androidToolPath, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, nt as resolveOwnedAvdSerialAsync, t as DEFAULT_AVD_DEVICE_PROFILE, tt as resetAdoptedAvd, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-Cjcj8MCw.mjs";
7
+ import { n as forgetCreatedDeviceAsync } from "./created-devices-D2Aca-xu.mjs";
8
+ import { a as parsePidof, i as parseLogcatLine, t as androidClockOffset } from "./android-saBeB4lr.mjs";
6
9
  import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
7
- import { Cn as launchAndroidApp, Dn as reverseMetroPorts, On as writeDebugHttpHost, Sn as iosAppProcess, Tn as launchIosApp, dn as androidAppProcess, wn as launchAndroidReleaseApp, xn as installIosApp, yn as installAndroidApp } from "./budget-3ivAK99e.mjs";
8
- import { D as teardownOwnedAvd, k as teardownOwnedIosSim } from "./workspaces-e41xsjKr.mjs";
9
- import { t as forgetCreatedDevice } from "./created-devices-x9rN6bhs.mjs";
10
- import { $ as resetAdoptedAvd, A as listAdbDevices, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, d as androidToolPath, et as resolveOwnedAvdSerialAsync, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, ot as waitForBoot, t as DEFAULT_AVD_DEVICE_PROFILE, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-C7sVmyI9.mjs";
11
- import { C as resetIosKeychain, P as readHostMemoryPressure, T as resolveIosCreation, a as createOwnedIosSim, d as listAllIosSims, g as listUserApps, k as uninstallIosApp, n as bootIosSim, w as resetIosPrivacy } from "./ios-hcBpnEGk.mjs";
12
- import { r as stopMacosAppHeld } from "./stop-CR5689oB.mjs";
10
+ import { An as reverseMetroPorts, Dn as launchAndroidReleaseApp, En as launchAndroidApp, On as launchIosApp, Sn as installAndroidApp, Tn as iosAppProcess, jn as writeDebugHttpHost, mn as androidAppProcess, wn as installIosApp } from "./budget-HyShrIpL.mjs";
11
+ import { A as teardownOwnedIosSim, O as teardownOwnedAvd } from "./workspaces-C9w4aeXF.mjs";
12
+ import { C as resetIosKeychain, I as readHostMemoryPressure, T as resolveIosCreation, a as createOwnedIosSim, d as listAllIosSims, g as listUserApps, k as uninstallIosApp, n as bootIosSim, w as resetIosPrivacy } from "./ios-BQzvJlzw.mjs";
13
+ import { r as stopMacosAppHeld } from "./stop-COP6PQqw.mjs";
13
14
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
14
- import { i as countLiveOwnedDevices } from "./device-capacity-DH0QsZYZ.mjs";
15
- import { n as parseLogcatLine, r as parsePidof, t as androidClockOffset } from "./android-DR5lZ2Az.mjs";
16
- import { _ as findAapt } from "./support-CbXPbUMJ.mjs";
17
- import { t as waitForMacosRegistration } from "./registration-BcRgF6Ox.mjs";
18
- import { n as parseLogStreamLine } from "./ios-xtlRHaeB.mjs";
15
+ import { i as countLiveOwnedDevices } from "./device-capacity-ZYaRALv5.mjs";
16
+ import { _ as findAapt } from "./support-Cxj9CmII.mjs";
17
+ import { t as waitForMacosRegistration } from "./registration-CN6nlhcD.mjs";
18
+ import { n as parseLogStreamLine } from "./ios-ENC4sRPA.mjs";
19
19
  import { createHash, randomUUID } from "node:crypto";
20
20
  import { chmodSync, closeSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statfsSync, symlinkSync, writeFileSync } from "node:fs";
21
21
  import { availableParallelism, freemem, homedir, loadavg } from "node:os";
@@ -652,7 +652,7 @@ async function runHostedDevice(mode, selectors, app) {
652
652
  if (outcome.status !== "torn-down" && outcome.status !== "missing") throw new Error(outcome.reason ?? "Hosted simulator teardown was not established.");
653
653
  const after = inventory().find((sim) => sim.udid === device.udid);
654
654
  if (after) throw new Error(`Hosted simulator ${device.udid} is still listed (${after.state}); deletion could not be verified. If its runtime is unavailable, delete it with xcrun simctl delete and stop the session again.`);
655
- forgetCreatedDevice("ios", device.udid);
655
+ await forgetCreatedDeviceAsync("ios", device.udid);
656
656
  removeHostedAppData(home);
657
657
  return {
658
658
  state: "stopped",
@@ -851,7 +851,7 @@ async function runHostedAndroidDevice(mode, request, app) {
851
851
  const name = device.avdName;
852
852
  if ((await listAvdsAsync({ timeoutMs: 5e3 })).includes(name) || avdStorageRoots().some((root) => avdPathExists(join(root, `${name}.ini`)) || avdPathExists(join(root, `${name}.avd`)))) throw new Error("The hosted AVD or its data still exists; deletion could not be verified.");
853
853
  if (await getAvdNameForSerialAsync(device.serial) === device.avdName) throw new Error("The hosted Android emulator is still running.");
854
- if (ledger === "listed") forgetCreatedDevice("android", device.avdName);
854
+ if (ledger === "listed") await forgetCreatedDeviceAsync("android", device.avdName);
855
855
  removeHostedAppData(home);
856
856
  return {
857
857
  state: "stopped",