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,510 +1,49 @@
1
- import { B as deviceSlotKey, E as upsertProject, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals, z as deviceSlotFileKey } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
4
- import { Dt as repoRoot, Ft as makeTemporaryDirectory, It as removeTemporaryEntry, W as resolveCacheProviderConfig, Z as settingOriginScope, et as settingsLayers, ht as gitCommonDir, ot as detectProviders, q as resolveSettings } from "./settings-B717odTD.mjs";
5
- import { D as fingerprintProject, N as resolveBuild, P as storeBuild, R as untrackedNativeFiles, _ as waitForBuild, g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-BX1sJQ2E.mjs";
6
- import { c as writeWorkspaceState, r as readWorkspaceState, w as workspaceLogsDir } from "./workspace-state-DJt_MMvf.mjs";
7
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-BTy8hZ0F.mjs";
8
- import { I as workspaceDevServerMode, R as writeWorkspaceLaunch, _ as detectIsExpo, d as projectRegistry, r as findProjectRoot } from "./project-_phNIJfs.mjs";
9
- import { a as workspaceLinks } from "./stim-desktop-BzBN2Em2.mjs";
10
- import { d as signalProcessTree, s as pidExists, u as resolveProjectMetro } from "./metro-DnCEjCxs.mjs";
11
- import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-C36s2jb9.mjs";
12
- import { Ft as recordRunStats, Nt as recordCapacityRefusal, jt as readRunEstimates, t as budgetGate } from "./budget-f7516Zk0.mjs";
13
- import { t as cancellableSleep } from "./cancellation-C_22VQTH.mjs";
14
- import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
15
- import { c as loadProjectProvider, f as resolveEasCliBin, i as checkEasAuth, m as uploadRemote, p as resolveRemote } from "./remote-cache-OyOyVIS3.mjs";
16
- import { c as startDevServer, g as detectBundleId } from "./start-BWqzODpb.mjs";
17
- import { d as listAllIosSims, m as listIosRuntimes, r as clearIosAppData } from "./ios-RkW4pnQf.mjs";
18
- import { c as readMetroRecords, f as verifyLaunch, i as RELEASE_VERIFY_WAIT_MS, l as unattributedLaunchLines, n as LAUNCH_FATAL, o as isBundleProof, p as verifyReleaseLaunch, r as LAUNCH_UNVERIFIED, s as readCollectorRecords, t as LAUNCH_BUNDLING, u as unverifiedLaunchLines } from "./launch-verify-B6Q8hZP-.mjs";
19
- import { C as restartedAppNote, S as launchIosApp, a as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, f as devClientUrl, u as clearOtherUserApps, v as installIosApp, y as iosAppProcess } from "./app-install-BIKtMfPq.mjs";
20
- import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-k8dTIrbK.mjs";
21
- import { A as readBundleId, f as podsAreStale, g as runPodInstall, j as resolveScheme, k as readBundleExecutable, p as readPodState } from "./toolchain-DxSsNssu.mjs";
22
- import { r as checkDeviceCapacity } from "./device-capacity-CBUAcRyQ.mjs";
23
- import { n as devClientTakesDevMenuParams, t as devClientScheme } from "./dev-client-DAWVIGBu.mjs";
24
- import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-CtCccJtb.mjs";
25
- import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnSignal } from "./device-lease-run-Cw2M4z51.mjs";
26
- import { n as readHostedIos, o as writeHostedIos } from "./ios-state-CBLe1xYw.mjs";
27
- import { o as checkEasFallback, s as automaticDevicePlacement } from "./build-plan-B7SZsc2N.mjs";
28
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DPt0m9Nd.mjs";
29
- import { D as gateMetroOrigin, E as readRemoteSimulatorArch, a as ensureMetroReachable, l as remoteIosDeps, o as ensureRemoteBootOwned, r as bundleEntryPoint, u as resolveRemoteContext } from "./device-remote-xRT0Vmo9.mjs";
30
- import { a as resolveEasDevelopmentBuild } from "./eas-build-JyfqyHfC.mjs";
31
- import { n as verifyCollectorOwnership } from "./ownership-DCtw_2IA.mjs";
32
- import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-BECOiufl.mjs";
33
- import { n as clearIosAdoptionPending } from "./device-ios-COSi6oS1.mjs";
34
- import { t as selectFromPool } from "./device-pool-Bf-pOhSw.mjs";
35
- import { a as printNativeCrashReport, n as IOS_CRASH_REPORT_RETRY, o as simulatorConsolePaths, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-BR677IDM.mjs";
36
- import { r as runPrebuild, t as planPrebuild } from "./prebuild-DYbucPXy.mjs";
37
- import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-CwjbFs9H.mjs";
38
- import { o as reportIosResult } from "./ios-project-K9hY_Jab.mjs";
39
- import { n as prepareHostedIos, t as placeHostedIos } from "./hosted-ios-l-o3iM9J.mjs";
40
- import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-D7pi2Sca.mjs";
41
- import { i as swapJsBundle } from "./js-swap-Bb3nsS07.mjs";
42
- import { existsSync, mkdirSync, mkdtempSync, openSync, rmSync, writeFileSync } from "node:fs";
1
+ import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
+ import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
3
+ import { E as upsertProject, H as deviceSlotKey, V as deviceSlotFileKey, p as getProject, u as getConcurrencyLimits, v as recordIosSchemeApprovals } from "./config-CYcBF478.mjs";
4
+ import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-B1UrjZHL.mjs";
5
+ import { d as writeWorkspaceState, r as readWorkspaceState } from "./workspace-state-Cjuigeeu.mjs";
6
+ import { $ as settingOriginScope, G as resolveCacheProviderConfig, It as repoRootAsync, Qt as cancellableSleep, Xt as removeTemporaryEntry, Y as resolveSettings, Yt as makeTemporaryDirectory, ct as detectProviders, nt as settingsLayers, yt as gitCommonDirAsync } from "./settings-CsJDEXgK.mjs";
7
+ import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot, v as detectIsExpo, z as writeWorkspaceLaunch } from "./project-BZNjmW_8.mjs";
8
+ import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { f as resolveProjectMetro, l as pidExists, p as signalProcessTree } from "./metro-DEXpIhHC.mjs";
10
+ import { $t as readCollectorRecords, Bn as checkEasAuth, Bt as ensureMetroReachable, En as restartedAppNote, Gt as resolveRemoteContext, J as recordRunStats, Jn as resolveRemote, Jt as LAUNCH_FATAL, K as recordCapacityRefusal, Mn as readRemoteSimulatorArch, Nn as gateMetroOrigin, Qt as isBundleProof, Rt as bundleEntryPoint, Sn as iosAppProcess, Tn as launchIosApp, Un as loadProjectProvider, Vt as ensureRemoteBootOwned, W as readRunEstimates, Wt as remoteIosDeps, Xt as RELEASE_VERIFY_WAIT_MS, Yn as uploadRemote, Yt as LAUNCH_UNVERIFIED, an as verifyReleaseLaunch, en as readMetroRecords, hn as devClientUrl, in as verifyLaunch, mn as clearOtherUserApps, nn as unverifiedLaunchLines, qn as resolveEasCliBin, qt as LAUNCH_BUNDLING, t as budgetGate, tn as unattributedLaunchLines, un as IOS_DEV_MENU_OFF_DEFAULTS_PLIST, xn as installIosApp } from "./budget-Bs6SxxzO.mjs";
11
+ import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-BccMFmGQ.mjs";
12
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-BzVfHSrY.mjs";
13
+ import { b as untrackedNativeFiles, g as storeBuild, h as resolveBuild, l as fingerprintProject } from "./build-cache-DmyR9Zzc.mjs";
14
+ import { d as listAllIosSims, m as listIosRuntimes, r as clearIosAppData } from "./ios-CpByZy12.mjs";
15
+ import { o as workspaceLinks } from "./stim-desktop-C12we7lz.mjs";
16
+ import { f as readBundleExecutable, m as resolveScheme, p as readBundleId } from "./xcode-Zlx3qjEs.mjs";
17
+ import { _ as runPodInstall, m as readPodState, p as podsAreStale } from "./toolchain-Hp9sCpK4.mjs";
18
+ import { n as readHostedIos, o as writeHostedIos } from "./ios-state-DvFX-K_l.mjs";
19
+ import { n as prepareHostedIos, t as placeHostedIos } from "./hosted-ios-CUvOf4Vr.mjs";
20
+ import { n as verifyCollectorOwnership } from "./ownership-DEmM5vhh.mjs";
21
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DF8VfT64.mjs";
22
+ import { a as discoverXcodeProject, r as buildIos } from "./react-native-build-rhk4smwQ.mjs";
23
+ import { a as acquireRunLease, c as lostRefusal, d as runLease, s as lostLine, t as DEBUG_VERIFY_STEP_MS, u as releaseLeaseOnAbort } from "./device-lease-run-C8raGFoP.mjs";
24
+ import { r as checkDeviceCapacity } from "./device-capacity-CMlqEcvw.mjs";
25
+ import { n as clearIosAdoptionPending } from "./device-ios-DRUeKaFV.mjs";
26
+ import { i as deviceLabel, o as deviceShortName, t as appNameFromPath } from "./support-Dlu37g6H.mjs";
27
+ import { a as sealAppForDevice, r as gateProfileForDevice } from "./ios-signing-DTTIChGs.mjs";
28
+ import { a as resolveEasDevelopmentBuild } from "./eas-build-BomfRnFT.mjs";
29
+ import { a as printNativeCrashReport, n as IOS_CRASH_REPORT_RETRY, o as simulatorConsolePaths, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-Bf0rZvG9.mjs";
30
+ import { c as startDevServer, g as detectBundleId } from "./start-7lpH7hmN.mjs";
31
+ import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
32
+ import { i as launchOutcomeRecord, n as ensureWorkspaceStorageSafely } from "./native-runtime-Dg1Q7tfF.mjs";
33
+ import { r as runPrebuild, t as planPrebuild } from "./prebuild-uD_ipCxF.mjs";
34
+ import { n as devClientTakesDevMenuParams, t as devClientScheme } from "./dev-client-UOeESKm6.mjs";
35
+ import { n as automaticDevicePlacement, t as checkEasFallback } from "./eas-fallback-DJwZpy0c.mjs";
36
+ import { n as ensureBooted, o as warmMetro, r as ensureOwnedDevice } from "./device-ExJq8Ei7.mjs";
37
+ import { t as selectFromPool } from "./device-pool-DMRpVX9a.mjs";
38
+ import { o as reportIosResult } from "./ios-project-WuwwBdvW.mjs";
39
+ import { c as isWirelessIosDevice, i as iosDeviceProcess, l as listIosDevices, n as installIosDeviceApp, p as verifyIosDeviceReleaseLaunch, r as iosDeviceBounds, t as awaitIosDeviceLaunch, u as localNetworkPending } from "./ios-device-CwFMehUS.mjs";
40
+ import { i as swapJsBundle } from "./js-swap-Cc1dttps.mjs";
41
+ import { mkdirSync, openSync, writeFileSync } from "node:fs";
42
+ import { networkInterfaces } from "node:os";
43
43
  import { basename, join } from "node:path";
44
- import { loadCacheProvider } from "@stim-cli/cache";
45
- import { hostSimulatorArch } from "@stim-cli/core";
46
- import { X509Certificate } from "node:crypto";
47
- import { networkInterfaces, tmpdir } from "node:os";
44
+ import { ambientEnv, hostSimulatorArch } from "@stim-cli/core";
48
45
  import chalk from "chalk";
49
- //#region src/engine/ios-profile.ts
50
- const TAG = /<(\/?)\s*([A-Za-z0-9_]+)(?:\s[^>]*?)?(\/?)>/g;
51
- const ENTITIES = {
52
- amp: "&",
53
- lt: "<",
54
- gt: ">",
55
- quot: "\"",
56
- apos: "'"
57
- };
58
- var PlistError = class extends Error {};
59
- function codePoint(value) {
60
- if (!Number.isInteger(value) || value < 0 || value > 1114111 || value >= 55296 && value <= 57343) throw new PlistError(`character reference out of range: ${value}`);
61
- return String.fromCodePoint(value);
62
- }
63
- function decodeEntities(raw) {
64
- return raw.replace(/&(#x?[0-9A-Fa-f]+|[a-z]+);/g, (match, body) => {
65
- if (body.startsWith("#x") || body.startsWith("#X")) return codePoint(Number.parseInt(body.slice(2), 16));
66
- if (body.startsWith("#")) return codePoint(Number.parseInt(body.slice(1), 10));
67
- return ENTITIES[body] ?? match;
68
- });
69
- }
70
- function peekTag(cursor) {
71
- TAG.lastIndex = cursor.pos;
72
- const match = TAG.exec(cursor.xml);
73
- if (!match) return null;
74
- return {
75
- name: (match[2] ?? "").toLowerCase(),
76
- closing: match[1] === "/",
77
- selfClosing: match[3] === "/",
78
- end: TAG.lastIndex
79
- };
80
- }
81
- function takeTag(cursor) {
82
- const tag = peekTag(cursor);
83
- if (tag) cursor.pos = tag.end;
84
- return tag;
85
- }
86
- function takeText(cursor, name) {
87
- const close = cursor.xml.indexOf(`</${name}>`, cursor.pos);
88
- if (close < 0) {
89
- cursor.pos = cursor.xml.length;
90
- return "";
91
- }
92
- const raw = cursor.xml.slice(cursor.pos, close);
93
- cursor.pos = close + name.length + 3;
94
- return raw;
95
- }
96
- function parseValue(cursor) {
97
- const peeked = peekTag(cursor);
98
- if (!peeked || peeked.closing) return void 0;
99
- const tag = takeTag(cursor);
100
- if (tag.selfClosing) {
101
- if (tag.name === "true") return true;
102
- if (tag.name === "false") return false;
103
- if (tag.name === "array") return [];
104
- if (tag.name === "dict") return {};
105
- return "";
106
- }
107
- switch (tag.name) {
108
- case "plist": return parseValue(cursor);
109
- case "dict": {
110
- const out = {};
111
- for (;;) {
112
- const next = peekTag(cursor);
113
- if (!next) break;
114
- if (next.closing) {
115
- cursor.pos = next.end;
116
- break;
117
- }
118
- cursor.pos = next.end;
119
- if (next.name !== "key") continue;
120
- const key = decodeEntities(next.selfClosing ? "" : takeText(cursor, "key"));
121
- const value = parseValue(cursor);
122
- if (value !== void 0) out[key] = value;
123
- }
124
- return out;
125
- }
126
- case "array": {
127
- const out = [];
128
- for (;;) {
129
- const next = peekTag(cursor);
130
- if (!next) break;
131
- if (next.closing) {
132
- cursor.pos = next.end;
133
- break;
134
- }
135
- const value = parseValue(cursor);
136
- if (value === void 0) break;
137
- out.push(value);
138
- }
139
- return out;
140
- }
141
- case "string":
142
- case "key": return decodeEntities(takeText(cursor, tag.name));
143
- case "integer": return Number.parseInt(takeText(cursor, "integer").trim(), 10);
144
- case "real": return Number.parseFloat(takeText(cursor, "real").trim());
145
- case "date": return new Date(takeText(cursor, "date").trim());
146
- case "data": return Buffer.from(takeText(cursor, "data").replace(/\s+/g, ""), "base64");
147
- case "true":
148
- takeText(cursor, "true");
149
- return true;
150
- case "false":
151
- takeText(cursor, "false");
152
- return false;
153
- default:
154
- takeText(cursor, tag.name);
155
- return "";
156
- }
157
- }
158
- function parsePlist(xml) {
159
- if (typeof xml !== "string" || xml.trim() === "") return null;
160
- const stripped = xml.replace(/<!--[\s\S]*?-->/g, "");
161
- const start = stripped.indexOf("<plist");
162
- const cursor = {
163
- xml: stripped,
164
- pos: start < 0 ? 0 : start
165
- };
166
- try {
167
- const value = parseValue(cursor);
168
- return value === void 0 ? null : value;
169
- } catch {
170
- return null;
171
- }
172
- }
173
- function isDict(value) {
174
- return value !== null && typeof value === "object" && !Array.isArray(value) && !Buffer.isBuffer(value) && !(value instanceof Date);
175
- }
176
- function stringsOf(value) {
177
- if (!Array.isArray(value)) return null;
178
- return value.filter((v) => typeof v === "string");
179
- }
180
- function parseProvisioningProfilePlist(xml) {
181
- const root = parsePlist(xml);
182
- if (!isDict(root)) return null;
183
- const entitlements = isDict(root.Entitlements ?? null) ? root.Entitlements : {};
184
- const teamIdentifier = stringsOf(root.TeamIdentifier);
185
- const expiration = root.ExpirationDate;
186
- const certificates = Array.isArray(root.DeveloperCertificates) ? root.DeveloperCertificates.filter((v) => Buffer.isBuffer(v)) : [];
187
- return {
188
- name: typeof root.Name === "string" ? root.Name : null,
189
- uuid: typeof root.UUID === "string" ? root.UUID : null,
190
- teamIdentifier: teamIdentifier?.[0] ?? null,
191
- expirationDate: expiration instanceof Date && !Number.isNaN(expiration.getTime()) ? expiration : null,
192
- provisionedDevices: stringsOf(root.ProvisionedDevices),
193
- provisionsAllDevices: root.ProvisionsAllDevices === true,
194
- getTaskAllow: entitlements["get-task-allow"] === true,
195
- certificates
196
- };
197
- }
198
- function provisioningProfileKind(profile) {
199
- if (profile.provisionedDevices) return profile.getTaskAllow ? "development" : "ad hoc";
200
- return profile.provisionsAllDevices ? "enterprise" : "App Store";
201
- }
202
- function certificateCommonName(der) {
203
- if (!Buffer.isBuffer(der) || der.length === 0) return null;
204
- let subject;
205
- try {
206
- subject = new X509Certificate(der).subject;
207
- } catch {
208
- return null;
209
- }
210
- for (const part of String(subject).split(/\r?\n/)) {
211
- const trimmed = part.trim();
212
- if (trimmed.startsWith("CN=")) return trimmed.slice(3).trim() || null;
213
- }
214
- return /(?:^|,)\s*CN=([^,]+)/.exec(String(subject))?.[1]?.trim() || null;
215
- }
216
- const IDENTITY_LINE = /^\s*\d+\)\s+([0-9A-Fa-f]{40})\s+"(.+)"\s*$/;
217
- function parseSigningIdentities(text) {
218
- if (typeof text !== "string") return [];
219
- const out = [];
220
- for (const line of text.split(/\r?\n/)) {
221
- const match = IDENTITY_LINE.exec(line);
222
- if (!match) continue;
223
- out.push({
224
- sha1: match[1].toUpperCase(),
225
- name: match[2]
226
- });
227
- }
228
- return out;
229
- }
230
- const SIGNING_CODES = {
231
- noProfile: "STIM_NO_PROFILE",
232
- profileMismatch: "STIM_PROFILE_MISMATCH",
233
- noIdentity: "STIM_NO_SIGNING_IDENTITY",
234
- codesignFailed: "STIM_CODESIGN_FAILED"
235
- };
236
- const XCODE_STEP = "build once from Xcode to install it -- Stim will not, because registering a device or minting a profile changes your Apple Developer account.";
237
- const KEYCHAIN_REMEDY = "Open Xcode > Settings > Accounts and download your certificates, or unlock the login keychain with `security unlock-keychain`. `security find-identity -v -p codesigning` should list `Apple Development: ...`.";
238
- function signingConfiguration(input) {
239
- return input.configuration ?? "Debug";
240
- }
241
- function profileGate(input) {
242
- const now = input.now ?? Date.now();
243
- if (!input.profilePresent) return {
244
- ok: false,
245
- code: SIGNING_CODES.noProfile,
246
- reason: "The app bundle has no embedded.mobileprovision, so it was built unsigned or for the simulator.",
247
- remedy: `Set a team and profile for the target's ${signingConfiguration(input)} configuration in Xcode > Signing & Capabilities, then ${XCODE_STEP}`
248
- };
249
- if (!input.profile) return {
250
- ok: false,
251
- code: SIGNING_CODES.noProfile,
252
- reason: "`openssl smime` could not decode the app bundle's embedded.mobileprovision.",
253
- remedy: `The profile inside the app is corrupt. Delete the build cache entry with \`stim gc --delete\`, then ${XCODE_STEP}`
254
- };
255
- const profile = input.profile;
256
- const named = profile.name ? `"${profile.name}"` : "the embedded profile";
257
- if (!profile.expirationDate || profile.expirationDate.getTime() <= now) return {
258
- ok: false,
259
- code: SIGNING_CODES.profileMismatch,
260
- reason: profile.expirationDate ? `The ${provisioningProfileKind(profile)} profile ${named} expired on ${profile.expirationDate.toISOString()}.` : `The ${provisioningProfileKind(profile)} profile ${named} carries no ExpirationDate, so Stim cannot prove it is still valid.`,
261
- remedy: `Renew the profile under Signing & Capabilities, then ${XCODE_STEP}`
262
- };
263
- if (!profile.provisionedDevices) {
264
- const kind = provisioningProfileKind(profile);
265
- return {
266
- ok: false,
267
- code: SIGNING_CODES.profileMismatch,
268
- reason: `${named} is an ${kind} profile, which carries no ProvisionedDevices list, so Stim cannot prove ${input.udid ?? "the target device"} is admitted.`,
269
- remedy: `Local device runs need a development profile. Select one under Signing & Capabilities, then ${XCODE_STEP}`
270
- };
271
- }
272
- const udid = input.udid;
273
- if (!udid || !profile.provisionedDevices.some((d) => d.toLowerCase() === udid.toLowerCase())) return {
274
- ok: false,
275
- code: SIGNING_CODES.profileMismatch,
276
- reason: `The ${provisioningProfileKind(profile)} profile ${named} lists ${profile.provisionedDevices.length} device(s) and ${udid ?? "the target device"} is not one of them.`,
277
- remedy: `Register ${udid ?? "the device"} at developer.apple.com, regenerate the profile, then ${XCODE_STEP}`
278
- };
279
- return {
280
- ok: true,
281
- profile
282
- };
283
- }
284
- function signingGate(input) {
285
- const gated = profileGate(input);
286
- if (!gated.ok) return gated;
287
- const profile = gated.profile;
288
- const named = profile.name ? `"${profile.name}"` : "the embedded profile";
289
- const identities = Array.isArray(input.identities) ? input.identities : [];
290
- if (identities.length === 0) return {
291
- ok: false,
292
- code: SIGNING_CODES.noIdentity,
293
- reason: "`security find-identity -v -p codesigning` lists no codesigning identity on this machine.",
294
- remedy: KEYCHAIN_REMEDY
295
- };
296
- if (input.pinnedSha1) {
297
- const wanted = input.pinnedSha1.trim().toUpperCase();
298
- const match = identities.find((i) => i.sha1 === wanted);
299
- if (match) return {
300
- ok: true,
301
- identity: match
302
- };
303
- return {
304
- ok: false,
305
- code: SIGNING_CODES.noIdentity,
306
- reason: `ios.signingIdentitySha1 is ${wanted}, which is not in the keychain. Available: ${identities.map((i) => `${i.sha1} "${i.name}"`).join(", ")}.`,
307
- remedy: KEYCHAIN_REMEDY
308
- };
309
- }
310
- const wantedName = input.pinnedName?.trim() || certificateCommonName(profile.certificates[0] ?? null);
311
- if (!wantedName) return {
312
- ok: false,
313
- code: SIGNING_CODES.noIdentity,
314
- reason: `Stim could not read a signing-identity name out of ${named}: its DeveloperCertificates entry has no readable subject CN.`,
315
- remedy: "Set ios.signingIdentity in .stim.json to the identity name to re-sign with, or ios.signingIdentitySha1 to its SHA-1 hash."
316
- };
317
- const matches = identities.filter((i) => i.name === wantedName);
318
- if (matches.length === 1) return {
319
- ok: true,
320
- identity: matches[0]
321
- };
322
- if (matches.length === 0) return {
323
- ok: false,
324
- code: SIGNING_CODES.noIdentity,
325
- reason: `The app was signed by "${wantedName}", which is not in this machine's keychain. Available: ${identities.map((i) => `"${i.name}"`).join(", ")}.`,
326
- remedy: `${KEYCHAIN_REMEDY} Or set ios.signingIdentity in .stim.json to one of the identities listed above.`
327
- };
328
- return {
329
- ok: false,
330
- code: SIGNING_CODES.noIdentity,
331
- reason: `${matches.length} keychain identities share the name "${wantedName}", so Stim cannot pick one: ${matches.map((i) => i.sha1).join(", ")}.`,
332
- remedy: "Set ios.signingIdentitySha1 in .stim.json to the SHA-1 hash of the certificate to sign with."
333
- };
334
- }
335
- //#endregion
336
- //#region src/engine/ios-signing.ts
337
- const EMBEDDED_PROFILE = "embedded.mobileprovision";
338
- const SIGNING_TIMEOUT_MS = 12e4;
339
- function lastLines(text, count = 5) {
340
- return String(text ?? "").split(/\r?\n/).map((line) => line.trimEnd()).filter((line) => line.trim() !== "").slice(-count);
341
- }
342
- function errorText(error) {
343
- const withOutput = error;
344
- const stderr = String(withOutput?.stderr ?? "").trim();
345
- const stdout = String(withOutput?.stdout ?? "").trim();
346
- return stderr || stdout || String(withOutput?.message ?? error);
347
- }
348
- function readEmbeddedProfile(appPath, { exec = null } = {}) {
349
- const executor = exec || getExecutor();
350
- const path = join(appPath, EMBEDDED_PROFILE);
351
- if (!existsSync(path)) return {
352
- present: false,
353
- profile: null
354
- };
355
- try {
356
- return {
357
- present: true,
358
- profile: parseProvisioningProfilePlist(executor.runFile("/usr/bin/openssl", [
359
- "smime",
360
- "-verify",
361
- "-noverify",
362
- "-inform",
363
- "DER",
364
- "-in",
365
- path
366
- ], { timeoutMs: SIGNING_TIMEOUT_MS }))
367
- };
368
- } catch {
369
- return {
370
- present: true,
371
- profile: null
372
- };
373
- }
374
- }
375
- function findSigningIdentities({ exec = null } = {}) {
376
- const executor = exec || getExecutor();
377
- try {
378
- return parseSigningIdentities(executor.runFile("security", [
379
- "find-identity",
380
- "-v",
381
- "-p",
382
- "codesigning"
383
- ], { timeoutMs: SIGNING_TIMEOUT_MS }));
384
- } catch {
385
- return [];
386
- }
387
- }
388
- function gateProfileForDevice(options) {
389
- const read = readEmbeddedProfile(options.appPath, { exec: options.exec ?? null });
390
- return profileGate({
391
- profilePresent: read.present,
392
- profile: read.profile,
393
- identities: [],
394
- udid: options.udid,
395
- configuration: options.configuration ?? null,
396
- ...options.now === void 0 ? {} : { now: options.now }
397
- });
398
- }
399
- function gateAppForDevice(options) {
400
- const read = readEmbeddedProfile(options.appPath, { exec: options.exec ?? null });
401
- return signingGate({
402
- profilePresent: read.present,
403
- profile: read.profile,
404
- identities: read.present ? findSigningIdentities({ exec: options.exec ?? null }) : [],
405
- udid: options.udid,
406
- configuration: options.configuration ?? null,
407
- pinnedName: options.pinnedName ?? null,
408
- pinnedSha1: options.pinnedSha1 ?? null,
409
- ...options.now === void 0 ? {} : { now: options.now }
410
- });
411
- }
412
- function extractEntitlements(appPath, executor) {
413
- try {
414
- return String(executor.runFile("codesign", [
415
- "-d",
416
- "--entitlements",
417
- "-",
418
- "--xml",
419
- appPath
420
- ], { timeoutMs: SIGNING_TIMEOUT_MS })).trim();
421
- } catch {
422
- return "";
423
- }
424
- }
425
- function resealBundle({ appPath, identity, exec = null }) {
426
- const executor = exec || getExecutor();
427
- const signAs = identity.sha1 || identity.name;
428
- let mode = "preserve-metadata";
429
- let preserveError = null;
430
- try {
431
- executor.runFile("codesign", [
432
- "--force",
433
- "--sign",
434
- signAs,
435
- "--preserve-metadata=identifier,entitlements,flags,runtime",
436
- appPath
437
- ], { timeoutMs: SIGNING_TIMEOUT_MS });
438
- } catch (error) {
439
- preserveError = error;
440
- }
441
- let tempDir = null;
442
- if (preserveError) {
443
- const entitlements = extractEntitlements(appPath, executor);
444
- const args = [
445
- "--force",
446
- "--sign",
447
- signAs
448
- ];
449
- if (entitlements !== "") {
450
- tempDir = mkdtempSync(join(tmpdir(), "stim-entitlements-"));
451
- const plist = join(tempDir, "entitlements.plist");
452
- writeFileSync(plist, `${entitlements}\n`, "utf-8");
453
- args.push("--entitlements", plist);
454
- mode = "entitlements";
455
- } else mode = "no-entitlements";
456
- args.push(appPath);
457
- try {
458
- executor.runFile("codesign", args, { timeoutMs: SIGNING_TIMEOUT_MS });
459
- } catch (error) {
460
- return {
461
- ok: false,
462
- code: SIGNING_CODES.codesignFailed,
463
- reason: `codesign could not re-seal ${appPath} with "${identity.name}": ${errorText(error)}`,
464
- remedy: `Unlock the login keychain (\`security unlock-keychain\`) and confirm exactly one identity matches "${identity.name}".`,
465
- lastLines: [...lastLines(errorText(preserveError)), ...lastLines(errorText(error))]
466
- };
467
- } finally {
468
- if (tempDir) rmSync(tempDir, {
469
- recursive: true,
470
- force: true
471
- });
472
- }
473
- }
474
- try {
475
- executor.runFile("codesign", [
476
- "--verify",
477
- "--strict",
478
- appPath
479
- ], { timeoutMs: SIGNING_TIMEOUT_MS });
480
- } catch (error) {
481
- return {
482
- ok: false,
483
- code: SIGNING_CODES.codesignFailed,
484
- reason: `codesign --verify --strict rejected ${appPath} after re-sealing it with "${identity.name}": ${errorText(error)}`,
485
- remedy: "The bundle signed but did not seal. Delete the cached artifact with `stim gc --delete` and build fresh, then retry.",
486
- lastLines: lastLines(errorText(error))
487
- };
488
- }
489
- return {
490
- ok: true,
491
- identity,
492
- mode
493
- };
494
- }
495
- function sealAppForDevice(options) {
496
- const gate = gateAppForDevice(options);
497
- if (!gate.ok) return {
498
- ...gate,
499
- lastLines: []
500
- };
501
- return resealBundle({
502
- appPath: options.appPath,
503
- identity: gate.identity,
504
- exec: options.exec ?? null
505
- });
506
- }
507
- //#endregion
46
+ import { loadCacheProvider } from "@stim-cli/cache";
508
47
  //#region src/engine/ios-lan.ts
509
48
  const IP_TXT = "ip.txt";
510
49
  function chooseLanAddress({ pinned = null, candidates }) {
@@ -694,7 +233,7 @@ async function replaceCollector({ root, slot = "default", udid, bundleId, appNam
694
233
  cwd: root,
695
234
  detached: true,
696
235
  stdio,
697
- env: process.env
236
+ env: ambientEnv()
698
237
  });
699
238
  child?.unref?.();
700
239
  } catch (err) {
@@ -724,8 +263,8 @@ const DEFAULT_DEPS = {
724
263
  resolveSettings,
725
264
  settingsLayers,
726
265
  settingOriginScope,
727
- gitCommonDir,
728
- repoRoot,
266
+ gitCommonDir: gitCommonDirAsync,
267
+ repoRoot: repoRootAsync,
729
268
  detectBundleId,
730
269
  detectIsExpo,
731
270
  devClientScheme,
@@ -786,7 +325,7 @@ const DEFAULT_DEPS = {
786
325
  acquireRunLease,
787
326
  runLease,
788
327
  selectFromPool,
789
- releaseLeaseOnSignal,
328
+ releaseLeaseOnAbort,
790
329
  iosDeviceProcess,
791
330
  verifyIosDeviceReleaseLaunch,
792
331
  readBundleId,
@@ -852,7 +391,7 @@ function iosMetroRuntime(prepare) {
852
391
  function missingCrashReportHint({ physical, remote, crashed }) {
853
392
  return crashed && !physical && !remote ? `No attributable native crash report captured yet. ${IOS_CRASH_REPORT_RETRY}` : "No attributable native crash report captured. Read `stim logs --source device` for available output.";
854
393
  }
855
- async function verifyIosProcessRun({ root, slot, appPath, d, launched, configuration, phase, note, logsDir, launchedAt, bundleId, udid, physical, appName, remoteDevice, embeddedJavaScript }) {
394
+ async function verifyIosProcessRun({ operation, root, slot, appPath, d, launched, configuration, phase, note, logsDir, launchedAt, bundleId, udid, physical, appName, remoteDevice, embeddedJavaScript }) {
856
395
  const readNativeCrashes = () => remoteDevice ? [] : captureNativeCrashes({
857
396
  root,
858
397
  slot,
@@ -862,12 +401,12 @@ async function verifyIosProcessRun({ root, slot, appPath, d, launched, configura
862
401
  since: launchedAt,
863
402
  appPath,
864
403
  physical
865
- }, logsDir);
404
+ }, logsDir, operation?.signal, operation?.env);
866
405
  const processCheck = physical ? await d.verifyIosDeviceReleaseLaunch({
867
406
  udid,
868
407
  appName: appName ?? bundleId
869
408
  }) : await d.verifyReleaseLaunch({ pid: launched?.pid ?? null });
870
- const crashes = readNativeCrashes();
409
+ const crashes = await readNativeCrashes();
871
410
  if (processCheck?.verified && !crashes.length) {
872
411
  phase("verify", `process alive ${formatDuration(processCheck.waitedMs ?? 0)} after launch (${configuration}: no bundle fetch to observe)`);
873
412
  return { state: true };
@@ -882,7 +421,7 @@ async function verifyIosProcessRun({ root, slot, appPath, d, launched, configura
882
421
  note(chalk.yellow(phaseLine("", `${embeddedJavaScript ? "Release" : "Process"} readiness was not established. Run \`stim logs --errors\` for captured crash reports, or \`stim logs --source device\` for the full device output.`)));
883
422
  return { state: crashes.length || processCheck?.reason === "exited" ? LAUNCH_FATAL : LAUNCH_UNVERIFIED };
884
423
  }
885
- async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note, metroCheck, logsDir, launchedAt, metroPort, isExpo, bundleId, udid, scheme, physical, appName, lanAddress, lanOrigin, remoteDevice, metroOrigin, enterActivity }) {
424
+ async function verifyIosMetroRun({ operation, root, slot, appPath, d, launched, phase, note, metroCheck, logsDir, launchedAt, metroPort, isExpo, bundleId, udid, scheme, physical, appName, lanAddress, lanOrigin, remoteDevice, metroOrigin, enterActivity }) {
886
425
  const runCommand = nativeRunCommand("ios", slot, {
887
426
  physical,
888
427
  deviceId: udid
@@ -896,15 +435,15 @@ async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note
896
435
  since: launchedAt,
897
436
  appPath,
898
437
  physical
899
- }, logsDir);
900
- const deviceProcess = () => {
901
- const running = d.iosDeviceProcess({
438
+ }, logsDir, operation?.signal, operation?.env);
439
+ const deviceProcess = async () => {
440
+ const running = await d.iosDeviceProcess({
902
441
  udid,
903
442
  appName: appName ?? bundleId
904
443
  });
905
444
  return running.state === "unknown" ? null : running.state === "running";
906
445
  };
907
- const siblings = metroCheck ? siblingPlatformSlots(root, "ios", slot) : [];
446
+ const siblings = metroCheck ? await siblingPlatformSlots(root, "ios", slot) : [];
908
447
  const verification = metroCheck ? await d.verifyLaunch({
909
448
  requireBundleResponse: true,
910
449
  slot: launchSlotScope(root, slot),
@@ -918,16 +457,16 @@ async function verifyIosMetroRun({ root, slot, appPath, d, launched, phase, note
918
457
  platform: "ios",
919
458
  mode: workspaceDevServerMode(root, isExpo),
920
459
  readNativeCrashes,
921
- processAlive: remoteDevice ? null : physical ? deviceProcess : () => {
460
+ processAlive: remoteDevice ? null : physical ? deviceProcess : async () => {
922
461
  if (launched?.pid) return d.pidExists(launched.pid);
923
- const running = iosAppProcess(udid, bundleId);
462
+ const running = await iosAppProcess(udid, bundleId);
924
463
  return running.state === "unknown" ? null : running.state === "running";
925
464
  }
926
465
  }) : {
927
466
  verified: false,
928
467
  skipped: true
929
468
  };
930
- const nativeCrashes = verification.errors?.some((record) => record.event === "native_crash") ? [] : readNativeCrashes();
469
+ const nativeCrashes = verification.errors?.some((record) => record.event === "native_crash") ? [] : await readNativeCrashes();
931
470
  if (nativeCrashes.length) verification.fatal = true;
932
471
  verification.errors = await errorDiagnostics([...verification.errors ?? [], ...nativeCrashes], {
933
472
  root,
@@ -1040,14 +579,14 @@ function reportLaunchErrors(errors, note, root) {
1040
579
  for (const line of report.lines) note(chalk.yellow(phaseLine("launch", line)));
1041
580
  return report.lines.length > 0;
1042
581
  }
1043
- function installsOverWifi(d, udid, selectedWireless, note) {
1044
- const current = d.listIosDevices().find((entry) => entry.udid === udid);
582
+ async function installsOverWifi(d, udid, selectedWireless, note) {
583
+ const current = (await d.listIosDevices()).find((entry) => entry.udid === udid);
1045
584
  const wireless = current ? isWirelessIosDevice(current) : selectedWireless;
1046
585
  if (wireless) note(phaseLine("device", `${current?.name ?? udid} is paired over Wi-Fi, so the install and launch go over the network and take longer than over a cable`));
1047
586
  return wireless;
1048
587
  }
1049
- function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1050
- const swept = d.clearOtherUserApps({
588
+ async function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
589
+ const swept = await d.clearOtherUserApps({
1051
590
  udid,
1052
591
  keep: bundleId
1053
592
  });
@@ -1055,7 +594,7 @@ function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1055
594
  if (swept.listed && swept.failed.length === 0) {
1056
595
  if (swept.kept && bundleId) {
1057
596
  try {
1058
- d.clearIosAppData(udid, bundleId, { defaultsPlist: devClient ? IOS_DEV_MENU_OFF_DEFAULTS_PLIST : null });
597
+ await d.clearIosAppData(udid, bundleId, { defaultsPlist: devClient ? IOS_DEV_MENU_OFF_DEFAULTS_PLIST : null });
1059
598
  } catch (error) {
1060
599
  return `Could not clear the data ${bundleId} kept from the previous workspace: ${String(error?.message || error)}`;
1061
600
  }
@@ -1070,12 +609,12 @@ function cleanAdoptedIosApps({ d, udid, bundleId, devClient, phase, note }) {
1070
609
  function installMayBeProven(adopting, parkedCacheKey, storeKey) {
1071
610
  return !adopting || !parkedCacheKey || parkedCacheKey === storeKey;
1072
611
  }
1073
- function resolveRunBundleId(d, projectBundleId, appPath, bundleId) {
612
+ async function resolveRunBundleId(d, projectBundleId, appPath, bundleId) {
1074
613
  if (!appPath || bundleId) return bundleId;
1075
- return d.readBundleId(appPath) || projectBundleId();
614
+ return await d.readBundleId(appPath) || await projectBundleId();
1076
615
  }
1077
- function readRunExecutable(d, appPath, note) {
1078
- const executable = appPath ? d.readBundleExecutable(appPath) : null;
616
+ async function readRunExecutable(d, appPath, note) {
617
+ const executable = appPath ? await d.readBundleExecutable(appPath) : null;
1079
618
  if (appPath && !executable) note(chalk.dim(`Could not read CFBundleExecutable from ${appPath}; the device log predicate falls back to the .app basename.`));
1080
619
  return executable;
1081
620
  }
@@ -1101,7 +640,7 @@ function launchFailureRemedy(remoteDevice, udid, bundleId, logFile) {
1101
640
  if (remoteDevice) return remoteDevice.failureRemedy();
1102
641
  return `If the simulator timed out, run \`stim doctor --platform ios\` and resolve any reported host memory pressure before retrying. Otherwise run \`xcrun simctl launch --terminate-running-process --console ${udid} ${bundleId}\` to see what the app reports, and check ${logFile}.`;
1103
642
  }
1104
- async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devicePlacement, artifact, d, root, slot, json, release, configuration, buildScheme, isExpo, metroCheck, metroPort, logsDir, logFile, device, udid, physical, wireless, lanAddress, lanOriginUrl, remoteDevice, bootPromise, bootDuration, bootPending, fail, phase, note, logWriter, elapsed, startedAt, closeWriter, lease, releaseLease, recordRun, reclaimed, devServer, enterPhase, enterActivity }) {
643
+ async function finishIosRun({ operation, output, projectBundleId, runtime, runtimePreparation, devicePlacement, artifact, d, root, slot, json, release, configuration, buildScheme, isExpo, metroCheck, metroPort, logsDir, logFile, device, udid, physical, wireless, lanAddress, lanOriginUrl, remoteDevice, bootPromise, bootDuration, bootPending, fail, phase, note, logWriter, elapsed, startedAt, closeWriter, lease, releaseLease, recordRun, reclaimed, devServer, enterPhase, enterActivity }) {
1105
644
  const { path: appPath, bundleId: initialBundleId, failureFields: buildFailure, cache } = artifact;
1106
645
  const { hit: cacheHit, providerName, buildMachine, builtOn, offloadedTo, offloadFallback, readEnabled: useBuildCache, missReason, waitedForBuild, compilation: compilationCache } = cache;
1107
646
  const storeHash = cache.identity?.fingerprint ?? null;
@@ -1130,7 +669,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1130
669
  }
1131
670
  return null;
1132
671
  };
1133
- bundleId = resolveRunBundleId(d, projectBundleId, appPath, bundleId);
672
+ bundleId = await resolveRunBundleId(d, projectBundleId, appPath, bundleId);
1134
673
  if (appPath && !bundleId) return fail({
1135
674
  code: "STIM_INSTALL_FAILED",
1136
675
  message: `Could not read a bundle identifier from the cached app at ${appPath}.`,
@@ -1155,13 +694,13 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1155
694
  const scheme = runtime.scheme(root, appPath, d);
1156
695
  const devMenuParams = runtime.devMenuParams(root, d);
1157
696
  const appName = appNameFromPath(appPath);
1158
- const appExecutable = readRunExecutable(d, appPath, note);
697
+ const appExecutable = await readRunExecutable(d, appPath, note);
1159
698
  const dropSwapDir = artifact.release;
1160
699
  let installSkipped = false;
1161
700
  let launched;
1162
701
  let launchedAt = d.now();
1163
702
  if (physical) {
1164
- const overWifi = installsOverWifi(d, udid, wireless, note);
703
+ const overWifi = await installsOverWifi(d, udid, wireless, note);
1165
704
  const bounds = iosDeviceBounds(overWifi);
1166
705
  const lostBeforeInstall = raiseLeaseFor(bounds.installMs, true);
1167
706
  if (lostBeforeInstall) return fail(lostBeforeInstall);
@@ -1171,7 +710,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1171
710
  });
1172
711
  enterPhase("install");
1173
712
  const installTimer = stepTimer(d.now);
1174
- const installed = d.installIosDeviceApp({
713
+ const installed = await d.installIosDeviceApp({
1175
714
  udid,
1176
715
  appPath,
1177
716
  bundleId,
@@ -1288,7 +827,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1288
827
  } else {
1289
828
  const adopting = Boolean(device?.adoptionPending);
1290
829
  if (adopting) {
1291
- const cleanupFailure = cleanAdoptedIosApps({
830
+ const cleanupFailure = await cleanAdoptedIosApps({
1292
831
  d,
1293
832
  udid,
1294
833
  bundleId,
@@ -1309,7 +848,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1309
848
  }
1310
849
  enterPhase("install");
1311
850
  const installTimer = stepTimer(d.now);
1312
- const installed = d.installIosApp({
851
+ const installed = await d.installIosApp({
1313
852
  udid,
1314
853
  appPath,
1315
854
  bundleId,
@@ -1369,7 +908,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1369
908
  metroPort: port,
1370
909
  devClientScheme,
1371
910
  devMenuParams: menuParams,
1372
- consolePaths: simulatorConsolePaths({
911
+ consolePaths: await simulatorConsolePaths({
1373
912
  deviceId: udid,
1374
913
  appId: bundleId,
1375
914
  since: launchedAt
@@ -1378,7 +917,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1378
917
  });
1379
918
  if ("error" in launched) return fail(launched.error);
1380
919
  if (launched.failed) {
1381
- printNativeCrashReport({
920
+ await printNativeCrashReport({
1382
921
  root,
1383
922
  slot,
1384
923
  platform: "ios",
@@ -1386,7 +925,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1386
925
  appId: bundleId,
1387
926
  since: launchedAt,
1388
927
  appPath
1389
- }, logsDir, (line) => note(chalk.red(phaseLine("launch", line))), Boolean(remoteDevice));
928
+ }, logsDir, (line) => note(chalk.red(phaseLine("launch", line))), Boolean(remoteDevice), operation?.signal, operation?.env);
1390
929
  return fail({
1391
930
  code: launched.code || "STIM_LAUNCH_FAILED",
1392
931
  message: launched.reason,
@@ -1428,6 +967,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1428
967
  });
1429
968
  if (physical) raiseLeaseFor(runtime.verificationWaitMs, false);
1430
969
  const { state: launchState, warning: launchWarning, unattributed } = await runtime.verify(runtimePreparation, {
970
+ operation,
1431
971
  root,
1432
972
  slot,
1433
973
  appPath,
@@ -1481,6 +1021,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1481
1021
  const uploadsAbandoned = await artifact.completeUploads();
1482
1022
  return {
1483
1023
  facts: reportIosResult({
1024
+ output,
1484
1025
  devicePlacement,
1485
1026
  root,
1486
1027
  slot,
@@ -1519,7 +1060,7 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1519
1060
  recordRun,
1520
1061
  reclaimed,
1521
1062
  devServer,
1522
- links: workspaceLinks(root, {
1063
+ links: await workspaceLinks(root, {
1523
1064
  platform: "ios",
1524
1065
  slot
1525
1066
  })
@@ -1528,4 +1069,4 @@ async function finishIosRun({ projectBundleId, runtime, runtimePreparation, devi
1528
1069
  };
1529
1070
  }
1530
1071
  //#endregion
1531
- export { collectorEntry as a, copyAppAside as c, gateProfileForDevice as d, DEFAULT_DEPS as i, lanOriginUrlFor as l, iosMetroRuntime as n, replaceCollector as o, iosProcessRuntime as r, chooseLanAddress as s, finishIosRun as t, writeIpTxt as u };
1072
+ export { collectorEntry as a, copyAppAside as c, DEFAULT_DEPS as i, lanOriginUrlFor as l, iosMetroRuntime as n, replaceCollector as o, iosProcessRuntime as r, chooseLanAddress as s, finishIosRun as t, writeIpTxt as u };